aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/tests/test_appc
blob: f567d7f1bc9453e79ad976cff55032ab9463a3bb (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash

source /var/onap_tests/_test_base
source /var/onap/appc

covered_functions=(
"clone_all_appc_repos" "compile_all_appc_repos" "get_appc_images" "install_appc"
)

# test_clone_all_appc_repos() - Verify that the APPC source code is cloned
function test_clone_all_appc_repos {
    clone_repos "appc"

    asserts_file_exist ${src_folders[appc]}/pom.xml
    asserts_file_exist ${src_folders[appc]}/deployment/pom.xml
}

# test_compile_all_appc_repos() - Verify that the APPC source code is compiled properly
function test_compile_all_appc_repos {
    clone_repos "appc"
    compile_repos "appc"

    for adapter in appc-ansible-adapter appc-chef-adapter appc-dmaap-adapter appc-iaas-adapter appc-netconf-adapter appc-rest-adapter appc-rest-healthcheck-adapter; do
        asserts_file_exist ${src_folders[appc]}/appc-adapters/$adapter/$adapter-bundle/target/$adapter-bundle-*-SNAPSHOT.jar
        asserts_file_exist ${src_folders[appc]}/appc-adapters/$adapter/$adapter-features/target/$adapter-features-*-SNAPSHOT.jar
        if [[ "$adapter" == "appc-netconf-adapter" ]]; then
            asserts_file_exist ${src_folders[appc]}/appc-adapters/$adapter/appc-netconf-installer/target/$adapter-*-SNAPSHOT.zip
        else
            asserts_file_exist ${src_folders[appc]}/appc-adapters/$adapter/$adapter-installer/target/$adapter-*-SNAPSHOT.zip
        fi
    done
    asserts_file_exist ${src_folders[appc]}/appc-adapters/appc-dmaap-adapter/appc-message-adapter-api/target/appc-message-adapter-api-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-adapters/appc-dmaap-adapter/appc-message-adapter-factory/target/appc-message-adapter-factory-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-api/target/appc-ssh-adapter-api-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-features/target/appc-ssh-adapter-features-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-sshd/target/appc-ssh-adapter-sshd-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-adapters/appc-ssh-adapter/appc-ssh-adapter-tests/target/appc-ssh-adapter-tests-*-SNAPSHOT.jar

    #for component in appc-event-listener appc-oam appc-provider; do
    for component in appc-event-listener appc-provider; do
        asserts_file_exist ${src_folders[appc]}/$component/$component-bundle/target/$component-bundle-*-SNAPSHOT.jar
        asserts_file_exist ${src_folders[appc]}/$component/$component-features/target/$component-features-*-SNAPSHOT.jar
        asserts_file_exist ${src_folders[appc]}/$component/$component-installer/target/$component-*-SNAPSHOT.zip
    done
    #for component in appc-oam appc-provider; do
    for component in appc-provider; do
        asserts_file_exist ${src_folders[appc]}/$component/$component-model/target/$component-model-*-SNAPSHOT.jar
    done

    asserts_file_exist ${src_folders[appc]}/appc-common/target/appc-common-*-SNAPSHOT.jar

    asserts_file_exist ${src_folders[appc]}/appc-dg/appc-dg-shared/appc-dg-dependency-model/target/appc-dg-dependency-model-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-dg/appc-dg-shared/appc-dg-domain-model-lib/target/appc-dg-domain-model-lib-*-SNAPSHOT.jar

    asserts_file_exist ${src_folders[appc]}/appc-dispatcher/appc-command-executor/appc-command-executor-api/target/appc-command-executor-api-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-dispatcher/appc-dispatcher-common/appc-data-access-lib/target/appc-data-access-lib-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-dispatcher/appc-dispatcher-common/domain-model-lib/target/domain-model-lib-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-dispatcher/appc-dispatcher-common/execution-queue-management-lib/target/execution-queue-management-lib-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-dispatcher/appc-license-manager/appc-license-manager-api/target/appc-license-manager-api-*-SNAPSHOT.jar
    asserts_file_exist ${src_folders[appc]}/appc-dispatcher/appc-request-handler/appc-request-handler-api/target/appc-request-handler-api-*-SNAPSHOT.jar


    #asserts_file_exist ${src_folders[appc]}/appc-lifecycle-management/appc-lifecycle-management-api/target/appc-lifecycle-management-api-*-SNAPSHOT.jar
    #asserts_file_exist ${src_folders[appc]}/appc-lifecycle-management/appc-lifecycle-management-core/target/appc-lifecycle-management-core-*-SNAPSHOT.jar
    #asserts_file_exist ${src_folders[appc]}/appc-lifecycle-management/appc-lifecycle-management-features/target/appc-lifecycle-management-features-*-SNAPSHOT.jar
    #asserts_file_exist ${src_folders[appc]}/appc-lifecycle-management/appc-lifecycle-management-installer/target/appc-lifecycle-management-*-SNAPSHOT.zip
    #asserts_file_exist ${src_folders[appc]}/appc-lifecycle-management/state-machine-lib/target/state-machine-lib-*-SNAPSHOT.jar

    asserts_file_exist ${src_folders[appc]}/appc-metric/appc-metric-bundle/target/appc-metric-bundle-*-SNAPSHOT.jar

    asserts_file_exist ${src_folders[appc]}/deployment/platform-logic/installer/target/platform-logic-installer-*-SNAPSHOT.zip
}

# test_get_appc_images() - Verify that APPC Docker images can be retrieved
function test_get_appc_images {
    clone_repos "appc"
    get_appc_images

    asserts_image openecomp/appc-image
}

# test_install_appc() - Verify that the APPC Docker images are up and running
function test_install_appc {
    clone_repos "appc"
    get_appc_images
    install_appc

    asserts_image_running openecomp/appc-image
}

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