blob: b666cf9db1c1c6c1f56e17be49d25ae60df2325d [file] [log] [blame]
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -07001#!/bin/bash
2
3source /var/onap_tests/_test_base
4source /var/onap/policy
5
6covered_functions=(
7"clone_all_policy_repos"
8"compile_all_policy_repos"
Victor Morales96512652017-08-16 13:44:28 -05009"get_policy_images"
10"install_policy"
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070011)
12
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070013# test_clone_all_policy_repos() - Verify cloning of Policy source code
14function test_clone_all_policy_repos {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080015 clone_repos "policy"
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070016
Victor Morales54646642017-12-08 11:57:42 -080017 asserts_file_exist ${src_folders[policy]}/api/pom.xml
18 asserts_file_exist ${src_folders[policy]}/common/pom.xml
19 asserts_file_exist ${src_folders[policy]}/docker/pom.xml
20 asserts_file_exist ${src_folders[policy]}/drools-applications/pom.xml
21 asserts_file_exist ${src_folders[policy]}/drools-pdp/pom.xml
22 asserts_file_exist ${src_folders[policy]}/engine/pom.xml
23 asserts_file_exist ${src_folders[policy]}/gui/pom.xml
24 asserts_file_exist ${src_folders[policy]}/pap/pom.xml
25 asserts_file_exist ${src_folders[policy]}/pdp/pom.xml
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070026}
27
28# test_compile_all_policy_repos() - Verify compiling of Policy source code
29function test_compile_all_policy_repos {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080030 clone_repos "policy"
31 compile_repos "policy"
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070032
Victor Morales54646642017-12-08 11:57:42 -080033 asserts_file_exist ${src_folders[policy]}/common/common-logging/target/ONAP-Logging-*-SNAPSHOT.jar
34 asserts_file_exist ${src_folders[policy]}/common/integrity-audit/target/integrity-audit-*-SNAPSHOT.jar
35 asserts_file_exist ${src_folders[policy]}/common/integrity-monitor/target/integrity-monitor-*-SNAPSHOT.jar
36 asserts_file_exist ${src_folders[policy]}/common/site-manager/target/site-manager-*-SNAPSHOT.jar
Victor Morales460cdb42017-09-15 22:34:59 -070037 for actor in appc appclcm so test vfc; do
Victor Morales54646642017-12-08 11:57:42 -080038 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/actors/actor.$actor/target/actor.$actor-*-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050039 done
Victor Morales54646642017-12-08 11:57:42 -080040 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/actors/actorServiceProvider/target/actorServiceProvider-*-SNAPSHOT.jar
41 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/eventmanager/target/eventmanager-*-SNAPSHOT.jar
42 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/guard/target/guard-*-SNAPSHOT.jar
Victor Morales460cdb42017-09-15 22:34:59 -070043 for module in aai appc appclcm events rest sdc so trafficgenerator vfc; do
Victor Morales54646642017-12-08 11:57:42 -080044 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/model-impl/$module/target/$module-*-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050045 done
Victor Morales54646642017-12-08 11:57:42 -080046 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/policy-yaml/target/policy-yaml-*-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050047 for package in apps artifacts; do
Victor Morales54646642017-12-08 11:57:42 -080048 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/packages/$package/target/$package-*-SNAPSHOT.zip
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050049 done
Victor Morales54646642017-12-08 11:57:42 -080050 #asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/packages/basex/target/basex-*-SNAPSHOT.tar.gz
51 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/templates/template.demo/target/template.demo-*-SNAPSHOT.jar
52 asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/templates/template.demo/target/template.demo-*-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050053 for feature in eelf healthcheck session-persistence; do
Victor Morales54646642017-12-08 11:57:42 -080054 asserts_file_exist ${src_folders[policy]}/drools-pdp/feature-$feature/target/feature-$feature-*-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050055 done
Victor Morales54646642017-12-08 11:57:42 -080056 #asserts_file_exist ${src_folders[policy]}/drools-pdp/packages/base/target/base-*-SNAPSHOT.tar.gz
57 #asserts_file_exist ${src_folders[policy]}/drools-pdp/packages/install/target/install-drools-*-SNAPSHOT.zip
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050058 for policy in core endpoints management utils; do
Victor Morales54646642017-12-08 11:57:42 -080059 asserts_file_exist ${src_folders[policy]}/drools-pdp/policy-$policy/target/policy-$policy-*-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050060 done
61 for engine in BRMSGateway LogParser ONAP-PDP ONAP-XACML ONAP-REST; do
Victor Morales54646642017-12-08 11:57:42 -080062 asserts_file_exist ${src_folders[policy]}/engine/$engine/target/$engine-*-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050063 done
64 for engine in ONAP-PAP-REST ONAP-PDP-REST ONAP-SDK-APP; do
Victor Morales54646642017-12-08 11:57:42 -080065 asserts_file_exist ${src_folders[policy]}/engine/$engine/target/$engine-*-SNAPSHOT.war
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050066 done
Victor Morales54646642017-12-08 11:57:42 -080067 asserts_file_exist ${src_folders[policy]}/engine/packages/base/target/base-*-SNAPSHOT.tar.gz
68 asserts_file_exist ${src_folders[policy]}/engine/packages/install/target/install-*-SNAPSHOT.zip
69 asserts_file_exist ${src_folders[policy]}/engine/POLICY-SDK-APP/target/POLICY-SDK-APP-*-SNAPSHOT.war
70 asserts_file_exist ${src_folders[policy]}/engine/PolicyEngineAPI/target/PolicyEngineAPI-*-SNAPSHOT.jar
71 asserts_file_exist ${src_folders[policy]}/engine/PolicyEngineClient/target/PolicyEngineClient-*-SNAPSHOT.jar
72 asserts_file_exist ${src_folders[policy]}/engine/PolicyEngineUtils/target/PolicyEngineUtils-*-SNAPSHOT.jar
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070073}
74
Victor Morales96512652017-08-16 13:44:28 -050075# test_get_policy_images() - Verify that Policy Docker images are retrieved properly
76function test_get_policy_images {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080077 clone_repos "policy"
Victor Morales96512652017-08-16 13:44:28 -050078 get_policy_images
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070079
80 for image in os nexus db base drools pe; do
81 asserts_image onap/policy/policy-$image
82 done
83}
84
Victor Morales96512652017-08-16 13:44:28 -050085# test_install_policy() - Verify that Policy services are started properly
86function test_install_policy {
Victor Moralesf1f1ba52017-11-20 16:38:28 -080087 clone_repos "policy"
Victor Morales96512652017-08-16 13:44:28 -050088 get_policy_images
89 install_policy
90
91 for image in pe drools db nexus; do
92 asserts_image_running onap/policy/policy-$image
93 done
94}
95
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070096if [ "$1" != '*' ]; then
97 unset covered_functions
98 covered_functions=$1
99fi
Victor Morales96512652017-08-16 13:44:28 -0500100main "${covered_functions[@]}"