blob: 0c544cd7ddcdbc749c3d1b04f6c97d26360dd6ff [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
52 asserts_file_exist $policy_src_folder/drools-applications/controlloop/templates/template.demo.v1.0.0/archetype-cl-legacy/target/archetype-cl-legacy-1.1.0-SNAPSHOT.jar
53 asserts_file_exist $policy_src_folder/drools-applications/controlloop/templates/template.demo.v1.0.0/template.demo/target/demo-1.1.0-SNAPSHOT.jar
54 for feature in eelf healthcheck session-persistence; do
55 asserts_file_exist $policy_src_folder/drools-pdp/feature-$feature/target/feature-$feature-1.1.0-SNAPSHOT.jar
56 done
57 asserts_file_exist $policy_src_folder/drools-pdp/packages/base/target/base-1.1.0-SNAPSHOT.tar.gz
58 asserts_file_exist $policy_src_folder/drools-pdp/packages/install/target/install-drools-1.1.0-SNAPSHOT.zip
59 for policy in core endpoints management utils; do
60 asserts_file_exist $policy_src_folder/drools-pdp/policy-$policy/target/policy-$policy-1.1.0-SNAPSHOT.jar
61 done
62 for engine in BRMSGateway LogParser ONAP-PDP ONAP-XACML ONAP-REST; do
63 asserts_file_exist $policy_src_folder/engine/$engine/target/$engine-1.1.0-SNAPSHOT.jar
64 done
65 for engine in ONAP-PAP-REST ONAP-PDP-REST ONAP-SDK-APP; do
66 asserts_file_exist $policy_src_folder/engine/$engine/target/$engine-1.1.0-SNAPSHOT.war
67 done
68 asserts_file_exist $policy_src_folder/engine/packages/base/target/base-1.1.0-SNAPSHOT.tar.gz
69 asserts_file_exist $policy_src_folder/engine/packages/install/target/install-1.1.0-SNAPSHOT.zip
70 asserts_file_exist $policy_src_folder/engine/POLICY-SDK-APP/target/POLICY-SDK-APP-1.1.0-SNAPSHOT.war
71 asserts_file_exist $policy_src_folder/engine/PolicyEngineAPI/target/PolicyEngineAPI-1.1.0-SNAPSHOT.jar
72 asserts_file_exist $policy_src_folder/engine/PolicyEngineClient/target/PolicyEngineClient-1.1.0-SNAPSHOT.jar
73 asserts_file_exist $policy_src_folder/engine/PolicyEngineUtils/target/PolicyEngineUtils-1.1.0-SNAPSHOT.jar
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070074}
75
Victor Morales96512652017-08-16 13:44:28 -050076# test_get_policy_images() - Verify that Policy Docker images are retrieved properly
77function test_get_policy_images {
78 clone_all_policy_repos
79 get_policy_images
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070080
81 for image in os nexus db base drools pe; do
82 asserts_image onap/policy/policy-$image
83 done
84}
85
Victor Morales96512652017-08-16 13:44:28 -050086# test_install_policy() - Verify that Policy services are started properly
87function test_install_policy {
88 clone_all_policy_repos
89 get_policy_images
90 install_policy
91
92 for image in pe drools db nexus; do
93 asserts_image_running onap/policy/policy-$image
94 done
95}
96
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070097if [ "$1" != '*' ]; then
98 unset covered_functions
99 covered_functions=$1
100fi
Victor Morales96512652017-08-16 13:44:28 -0500101main "${covered_functions[@]}"