aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tests/test_policy
blob: f5490a460481db15c156a37803db7eae686a522c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

source /var/onap_tests/_test_base
source /var/onap/policy

covered_functions=(
"clone_all_policy_repos"
"compile_all_policy_repos"
"get_policy_images"
"install_policy"
)

# test_clone_all_policy_repos() - Verify cloning of Policy source code
function test_clone_all_policy_repos {
    clone_all_policy_repos

    for dirc in api common docker drools-applications drools-pdp engine gui pap pdp; do
        asserts_file_exist policy/$dirc $src_folder/$dirc
    done
}

# test_compile_all_policy_repos() - Verify compiling of Policy source code
function test_compile_all_policy_repos {
    clone_all_policy_repos
    compile_all_policy_repos

    asserts_file_exist $src_folder/drools-applications/controlloop/common/actors/actor.test/target/actor.test-1.1.0-SNAPSHOT.jar
}

# test_get_policy_images() - Verify that Policy Docker images are retrieved properly
function test_get_policy_images {
    clone_all_policy_repos
    get_policy_images

    for image in os nexus db base drools pe; do
        asserts_image onap/policy/policy-$image
    done
}

# test_install_policy() - Verify that Policy services are started properly
function test_install_policy {
    clone_all_policy_repos
    get_policy_images
    install_policy

    for image in pe drools db nexus; do
        asserts_image_running onap/policy/policy-$image
    done
}

if [ "$1" != '*' ]; then
    unset covered_functions
    covered_functions=$1
fi
main "${covered_functions[@]}"