blob: f5490a460481db15c156a37803db7eae686a522c [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
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
23function 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 Morales96512652017-08-16 13:44:28 -050030# test_get_policy_images() - Verify that Policy Docker images are retrieved properly
31function test_get_policy_images {
32 clone_all_policy_repos
33 get_policy_images
Shashank Kumar Shankarb249c8a2017-07-27 13:20:26 -070034
35 for image in os nexus db base drools pe; do
36 asserts_image onap/policy/policy-$image
37 done
38}
39
Victor Morales96512652017-08-16 13:44:28 -050040# test_install_policy() - Verify that Policy services are started properly
41function 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 Shankarb249c8a2017-07-27 13:20:26 -070051if [ "$1" != '*' ]; then
52 unset covered_functions
53 covered_functions=$1
54fi
Victor Morales96512652017-08-16 13:44:28 -050055main "${covered_functions[@]}"