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 { |
| 15 | clone_all_policy_repos |
| 16 | |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 17 | 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 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 | 460cdb4 | 2017-09-15 22:34:59 -0700 | [diff] [blame^] | 30 | clone_all_policy_repos |
| 31 | compile_all_policy_repos |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 32 | |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 33 | 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 Morales | 460cdb4 | 2017-09-15 22:34:59 -0700 | [diff] [blame^] | 37 | for actor in appc appclcm so test vfc; do |
Victor Morales | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 38 | 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 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 | dcfa2cf | 2017-08-30 19:12:14 -0500 | [diff] [blame] | 44 | 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 Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 74 | } |
| 75 | |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 76 | # test_get_policy_images() - Verify that Policy Docker images are retrieved properly |
| 77 | function test_get_policy_images { |
| 78 | clone_all_policy_repos |
| 79 | get_policy_images |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 80 | |
| 81 | for image in os nexus db base drools pe; do |
| 82 | asserts_image onap/policy/policy-$image |
| 83 | done |
| 84 | } |
| 85 | |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 86 | # test_install_policy() - Verify that Policy services are started properly |
| 87 | function 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 Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 97 | if [ "$1" != '*' ]; then |
| 98 | unset covered_functions |
| 99 | covered_functions=$1 |
| 100 | fi |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 101 | main "${covered_functions[@]}" |