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" |
| 9 | "init_policy" |
| 10 | ) |
| 11 | |
| 12 | src_folder=/opt/policy |
| 13 | |
| 14 | # test_clone_all_policy_repos() - Verify cloning of Policy source code |
| 15 | function test_clone_all_policy_repos { |
| 16 | clone_all_policy_repos |
| 17 | |
| 18 | for dirc in api common docker drools-applications drools-pdp engine gui pap pdp; do |
| 19 | asserts_file_exist policy/$dirc $src_folder/$dirc |
| 20 | done |
| 21 | } |
| 22 | |
| 23 | # test_compile_all_policy_repos() - Verify compiling of Policy source code |
| 24 | function test_compile_all_policy_repos { |
| 25 | clone_all_policy_repos |
| 26 | compile_all_policy_repos |
| 27 | |
| 28 | asserts_file_exist $src_folder/drools-applications/controlloop/common/actors/actor.test/target/actor.test-1.1.0-SNAPSHOT.jar |
| 29 | } |
| 30 | |
| 31 | # test_init_policy() - Verify Policy images are created or cloned |
| 32 | function test_init_policy { |
| 33 | init_policy |
| 34 | |
| 35 | for image in os nexus db base drools pe; do |
| 36 | asserts_image onap/policy/policy-$image |
| 37 | done |
| 38 | } |
| 39 | |
| 40 | if [ "$1" != '*' ]; then |
| 41 | unset covered_functions |
| 42 | covered_functions=$1 |
| 43 | fi |
| 44 | main "${covered_functions[@]}" |