aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tests/test_sdc
blob: 6d5470e808a1f382a3a8a09a87a813af71817abb (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash

source /var/onap_tests/_test_base
source /var/onap/sdc

covered_functions=(
"clone_all_sdc_repos" "compile_all_sdc_repos" "get_sdc_images" "install_sdc"
)

# test_clone_all_sdc_repos() - Verifies the retrieval of SDC source code repos
function test_clone_all_sdc_repos {
    clone_repos "sdc"

    asserts_file_exist $sdc_src_folder/pom.xml
    asserts_file_exist $sdc_src_folder/sdc-os-chef/pom.xml
    asserts_file_exist $sdc_src_folder/jtosca/pom.xml
    asserts_file_exist $sdc_src_folder/sdc-distribution-client/pom.xml
    asserts_file_exist $sdc_src_folder/sdc-titan-cassandra/pom.xml
    asserts_file_exist $sdc_src_folder/sdc-tosca/pom.xml
    asserts_file_exist $sdc_src_folder/sdc_common/pom.xml
}

# test_compile_all_sdc_repos() - Verifies the correct compilation of SDC repositories
function test_compile_all_sdc_repos {
    clone_repos "sdc"
    compile_repos "sdc"

    #asserts_file_exist $sdc_src_folder/jtosca/target/jtosca-1.1.10-SNAPSHOT.jar
    #asserts_file_exist $sdc_src_folder/sdc-distribution-client/sdc-distribution-ci/target/sdc-distribution-ci-1.1.*-SNAPSHOT.jar
    #asserts_file_exist $sdc_src_folder/sdc-distribution-client/sdc-distribution-client/target/sdc-distribution-client-1.1.*-SNAPSHOT.jar
    #asserts_file_exist $sdc_src_folder/sdc-titan-cassandra/target/jamm-0.3.0.jar
    #asserts_file_exist $sdc_src_folder/sdc-tosca/target/sdc-tosca-1.1.*-SNAPSHOT.jar

    #for dirc in logging sdc-artifact-generator; do
    for dirc in logging; do
        name="openecomp-$dirc"
        for module in api core; do
            fullname="$name-$module"
            asserts_file_exist $sdc_src_folder/sdc_common/$name-lib/$fullname/target/$fullname-1.1.0-SNAPSHOT.jar
        done
    done
}

# test_get_sdc_images() - Verifies the correct retrieval of SDC Docker images
function test_get_sdc_images {
    clone_repos "sdc"
    get_sdc_images

    for image in sanity elasticsearch cassandra kibana frontend backend; do
        asserts_image openecomp/base_sdc-$image
    done
}

# test_install_sdc() - Verifies that SDC services are up and running
function test_install_sdc {
    clone_repos "sdc"
    get_sdc_images
    install_sdc

    for image in elasticsearch cassandra kibana frontend backend; do
        asserts_image_running openecomp/base_sdc-$image
    done
}

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