blob: 08231fc7a420c0f5fe757cab30f32207c23c182b [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 {
15 clone_all_policy_repos
16
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050017 asserts_file_exist $policy_src_folder/api/pom.xml
18 asserts_file_exist $policy_src_folder/common/pom.xml
19 asserts_file_exist $policy_src_folder/docker/pom.xml
20 asserts_file_exist $policy_src_folder/drools-applications/pom.xml
21 asserts_file_exist $policy_src_folder/drools-pdp/pom.xml
22 asserts_file_exist $policy_src_folder/engine/pom.xml
23 asserts_file_exist $policy_src_folder/gui/pom.xml
24 asserts_file_exist $policy_src_folder/pap/pom.xml
25 asserts_file_exist $policy_src_folder/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 Morales460cdb42017-09-15 22:34:59 -070030 clone_all_policy_repos
31 compile_all_policy_repos
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070032
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050033 asserts_file_exist $policy_src_folder/common/common-logging/target/ONAP-Logging-1.1.0-SNAPSHOT.jar
34 asserts_file_exist $policy_src_folder/common/integrity-audit/target/integrity-audit-1.1.0-SNAPSHOT.jar
35 asserts_file_exist $policy_src_folder/common/integrity-monitor/target/integrity-monitor-1.1.0-SNAPSHOT.jar
36 asserts_file_exist $policy_src_folder/common/site-manager/target/site-manager-1.1.0-SNAPSHOT.jar
Victor Morales460cdb42017-09-15 22:34:59 -070037 for actor in appc appclcm so test vfc; do
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050038 asserts_file_exist $policy_src_folder/drools-applications/controlloop/common/actors/actor.$actor/target/actor.$actor-1.1.0-SNAPSHOT.jar
39 done
40 asserts_file_exist $policy_src_folder/drools-applications/controlloop/common/actors/actorServiceProvider/target/actorServiceProvider-1.1.0-SNAPSHOT.jar
41 asserts_file_exist $policy_src_folder/drools-applications/controlloop/common/eventmanager/target/eventmanager-1.1.0-SNAPSHOT.jar
42 asserts_file_exist $policy_src_folder/drools-applications/controlloop/common/guard/target/guard-1.1.0-SNAPSHOT.jar
Victor Morales460cdb42017-09-15 22:34:59 -070043 for module in aai appc appclcm events rest sdc so trafficgenerator vfc; do
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050044 asserts_file_exist $policy_src_folder/drools-applications/controlloop/common/model-impl/$module/target/$module-1.1.0-SNAPSHOT.jar
45 done
46 asserts_file_exist $policy_src_folder/drools-applications/controlloop/common/policy-yaml/target/policy-yaml-1.1.0-SNAPSHOT.jar
47 for package in apps artifacts; do
48 asserts_file_exist $policy_src_folder/drools-applications/controlloop/packages/$package/target/$package-1.1.0-SNAPSHOT.zip
49 done
50 asserts_file_exist $policy_src_folder/drools-applications/controlloop/packages/basex/target/basex-1.1.0-SNAPSHOT.tar.gz
51 asserts_file_exist $policy_src_folder/drools-applications/controlloop/templates/template.demo/target/template.demo-1.1.0-SNAPSHOT.jar
Victor Moralesf6c0bf12017-10-27 11:08:04 -070052 asserts_file_exist $policy_src_folder/drools-applications/controlloop/templates/template.demo/target/template.demo-1.1.0-SNAPSHOT.jar
Victor Moralesdcfa2cf2017-08-30 19:12:14 -050053 for feature in eelf healthcheck session-persistence; do
54 asserts_file_exist $policy_src_folder/drools-pdp/feature-$feature/target/feature-$feature-1.1.0-SNAPSHOT.jar
55 done
56 asserts_file_exist $policy_src_folder/drools-pdp/packages/base/target/base-1.1.0-SNAPSHOT.tar.gz
57 asserts_file_exist $policy_src_folder/drools-pdp/packages/install/target/install-drools-1.1.0-SNAPSHOT.zip
58 for policy in core endpoints management utils; do
59 asserts_file_exist $policy_src_folder/drools-pdp/policy-$policy/target/policy-$policy-1.1.0-SNAPSHOT.jar
60 done
61 for engine in BRMSGateway LogParser ONAP-PDP ONAP-XACML ONAP-REST; do
62 asserts_file_exist $policy_src_folder/engine/$engine/target/$engine-1.1.0-SNAPSHOT.jar
63 done
64 for engine in ONAP-PAP-REST ONAP-PDP-REST ONAP-SDK-APP; do
65 asserts_file_exist $policy_src_folder/engine/$engine/target/$engine-1.1.0-SNAPSHOT.war
66 done
67 asserts_file_exist $policy_src_folder/engine/packages/base/target/base-1.1.0-SNAPSHOT.tar.gz
68 asserts_file_exist $policy_src_folder/engine/packages/install/target/install-1.1.0-SNAPSHOT.zip
69 asserts_file_exist $policy_src_folder/engine/POLICY-SDK-APP/target/POLICY-SDK-APP-1.1.0-SNAPSHOT.war
70 asserts_file_exist $policy_src_folder/engine/PolicyEngineAPI/target/PolicyEngineAPI-1.1.0-SNAPSHOT.jar
71 asserts_file_exist $policy_src_folder/engine/PolicyEngineClient/target/PolicyEngineClient-1.1.0-SNAPSHOT.jar
72 asserts_file_exist $policy_src_folder/engine/PolicyEngineUtils/target/PolicyEngineUtils-1.1.0-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 {
77 clone_all_policy_repos
78 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 {
87 clone_all_policy_repos
88 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[@]}"