aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_multicloud
blob: 2a17406fff20f0983b6da3d0256e40582311f03f (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
#!/bin/bash
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2017-2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#############################################################################

source /var/onap_tests/_test_base
source /var/onap/multicloud

covered_functions=(
"clone_multicloud_repos" "compile_multicloud_repos" "get_multicloud_images" "install_multicloud"
)

# test_clone_multicloud_repos() - Verify that Multi Cloud repositories are cloned properly
function test_clone_multicloud_repos {
    clone_repos "multicloud"

    #asserts_file_exist ${src_folders[multicloud]}/
    asserts_file_exist ${src_folders[multicloud]}/framework/pom.xml
    asserts_file_exist ${src_folders[multicloud]}/openstack/pom.xml
    asserts_file_exist ${src_folders[multicloud]}/openstack/vmware/pom.xml
    asserts_file_exist ${src_folders[multicloud]}/openstack/windriver/pom.xml
    #asserts_file_exist ${src_folders[multicloud]}/azure/
}

# test_compile_multicloud_repos() -
function test_compile_multicloud_repos {
    clone_repos "multicloud"
    compile_repos "multicloud"

    asserts_file_exist ${src_folders[multicloud]}/openstack/newton/target/multicloud-openstack-newton-1.0.0-SNAPSHOT.zip
    asserts_file_exist ${src_folders[multicloud]}/openstack/ocata/target/multicloud-openstack-ocata-1.0.0-SNAPSHOT.zip
    asserts_file_exist ${src_folders[multicloud]}/openstack/windriver/target/multicloud-openstack-windriver-1.0.0-SNAPSHOT.zip
}

# test_get_multicloud_images() -
function test_get_multicloud_images {
    clone_repos "multicloud"
    get_multicloud_images

    asserts_image onap/multicloud/openstack-$openstack_release
}

# test_install_multicloud() - Verify the built and start of Multi Cloud services
function test_install_multicloud {
    clone_repos "multicloud"
    get_multicloud_images
    install_multicloud

    # NOTE(electrocucaracha): Depends on https://gerrit.onap.org/r/#/c/23631/
    asserts_http_status_code http://127.0.0.1:9003/api/multicloud-$openstack_release/v0/swagger.json
}

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