Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | source /var/onap_tests/_test_base |
| 4 | source /var/onap/policy |
| 5 | |
| 6 | covered_functions=( |
| 7 | "clone_all_policy_repos" |
| 8 | "compile_all_policy_repos" |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 9 | "get_policy_images" |
| 10 | "install_policy" |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 11 | ) |
| 12 | |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 13 | # test_clone_all_policy_repos() - Verify cloning of Policy source code |
| 14 | function test_clone_all_policy_repos { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 15 | clone_repos "policy" |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 16 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 17 | 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 Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | # test_compile_all_policy_repos() - Verify compiling of Policy source code |
| 29 | function test_compile_all_policy_repos { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 30 | clone_repos "policy" |
| 31 | compile_repos "policy" |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 32 | |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 33 | 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 Morales | 460cdb4 | 2017-09-15 22:34:59 -0700 | [diff] [blame] | 37 | for actor in appc appclcm so test vfc; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 38 | asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/actors/actor.$actor/target/actor.$actor-*-SNAPSHOT.jar |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 39 | done |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 40 | 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 Morales | 460cdb4 | 2017-09-15 22:34:59 -0700 | [diff] [blame] | 43 | for module in aai appc appclcm events rest sdc so trafficgenerator vfc; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 44 | asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/model-impl/$module/target/$module-*-SNAPSHOT.jar |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 45 | done |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 46 | asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/common/policy-yaml/target/policy-yaml-*-SNAPSHOT.jar |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 47 | for package in apps artifacts; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 48 | asserts_file_exist ${src_folders[policy]}/drools-applications/controlloop/packages/$package/target/$package-*-SNAPSHOT.zip |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 49 | done |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 50 | #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 Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 53 | for feature in eelf healthcheck session-persistence; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 54 | asserts_file_exist ${src_folders[policy]}/drools-pdp/feature-$feature/target/feature-$feature-*-SNAPSHOT.jar |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 55 | done |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 56 | #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 Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 58 | for policy in core endpoints management utils; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 59 | asserts_file_exist ${src_folders[policy]}/drools-pdp/policy-$policy/target/policy-$policy-*-SNAPSHOT.jar |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 60 | done |
| 61 | for engine in BRMSGateway LogParser ONAP-PDP ONAP-XACML ONAP-REST; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 62 | asserts_file_exist ${src_folders[policy]}/engine/$engine/target/$engine-*-SNAPSHOT.jar |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 63 | done |
| 64 | for engine in ONAP-PAP-REST ONAP-PDP-REST ONAP-SDK-APP; do |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 65 | asserts_file_exist ${src_folders[policy]}/engine/$engine/target/$engine-*-SNAPSHOT.war |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 66 | done |
Victor Morales | 5464664 | 2017-12-08 11:57:42 -0800 | [diff] [blame] | 67 | 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 Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 73 | } |
| 74 | |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 75 | # test_get_policy_images() - Verify that Policy Docker images are retrieved properly |
| 76 | function test_get_policy_images { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 77 | clone_repos "policy" |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 78 | get_policy_images |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 79 | |
| 80 | for image in os nexus db base drools pe; do |
| 81 | asserts_image onap/policy/policy-$image |
| 82 | done |
| 83 | } |
| 84 | |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 85 | # test_install_policy() - Verify that Policy services are started properly |
| 86 | function test_install_policy { |
Victor Morales | f1f1ba5 | 2017-11-20 16:38:28 -0800 | [diff] [blame] | 87 | clone_repos "policy" |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 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 Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 96 | if [ "$1" != '*' ]; then |
| 97 | unset covered_functions |
| 98 | covered_functions=$1 |
| 99 | fi |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 100 | main "${covered_functions[@]}" |