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 | |
| 17 | for dirc in api common docker drools-applications drools-pdp engine gui pap pdp; do |
| 18 | asserts_file_exist policy/$dirc $src_folder/$dirc |
| 19 | done |
| 20 | } |
| 21 | |
| 22 | # test_compile_all_policy_repos() - Verify compiling of Policy source code |
| 23 | function test_compile_all_policy_repos { |
| 24 | clone_all_policy_repos |
| 25 | compile_all_policy_repos |
| 26 | |
| 27 | asserts_file_exist $src_folder/drools-applications/controlloop/common/actors/actor.test/target/actor.test-1.1.0-SNAPSHOT.jar |
| 28 | } |
| 29 | |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 30 | # test_get_policy_images() - Verify that Policy Docker images are retrieved properly |
| 31 | function test_get_policy_images { |
| 32 | clone_all_policy_repos |
| 33 | get_policy_images |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 34 | |
| 35 | for image in os nexus db base drools pe; do |
| 36 | asserts_image onap/policy/policy-$image |
| 37 | done |
| 38 | } |
| 39 | |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 40 | # test_install_policy() - Verify that Policy services are started properly |
| 41 | function test_install_policy { |
| 42 | clone_all_policy_repos |
| 43 | get_policy_images |
| 44 | install_policy |
| 45 | |
| 46 | for image in pe drools db nexus; do |
| 47 | asserts_image_running onap/policy/policy-$image |
| 48 | done |
| 49 | } |
| 50 | |
Shashank Kumar Shankar | b249c8a | 2017-07-27 13:20:26 -0700 | [diff] [blame] | 51 | if [ "$1" != '*' ]; then |
| 52 | unset covered_functions |
| 53 | covered_functions=$1 |
| 54 | fi |
Victor Morales | 9651265 | 2017-08-16 13:44:28 -0500 | [diff] [blame] | 55 | main "${covered_functions[@]}" |