diff options
author | Victor Morales <victor.morales@intel.com> | 2017-11-16 10:50:28 -0800 |
---|---|---|
committer | Victor Morales <victor.morales@intel.com> | 2017-11-16 10:50:28 -0800 |
commit | 88d193e157c75cc544b92401aaac5ce6caaa3d8a (patch) | |
tree | 669ee7aa26db7a368f2c01eb5e1b33adb33bee86 /bootstrap/vagrant-onap/tests | |
parent | a1ef1718517a0b0ea19c6ffbaa1fb4027a6431a1 (diff) |
Implement steps for Multicloud Images
It was implemented the steps required for retrieving or building
docker images as well as their execution.
Change-Id: I20f79c5375377a9406f92f9e3e32a2cbec23a4f9
Signed-off-by: Victor Morales <victor.morales@intel.com>
Depends-On: Idc876574ceee39b7cf389978d6a33eb7c66291a6
Issue-Id: MULTICLOUD-53
Diffstat (limited to 'bootstrap/vagrant-onap/tests')
-rwxr-xr-x | bootstrap/vagrant-onap/tests/asserts | 12 | ||||
-rw-r--r-- | bootstrap/vagrant-onap/tests/test_multicloud | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/bootstrap/vagrant-onap/tests/asserts b/bootstrap/vagrant-onap/tests/asserts index 52f0bce92..0fc8d38a1 100755 --- a/bootstrap/vagrant-onap/tests/asserts +++ b/bootstrap/vagrant-onap/tests/asserts @@ -2,6 +2,18 @@ source /var/onap/commons +# asserts_http_status_code() - Function that determines if a HTTP status code is retrieved from URL +function asserts_http_status_code { + local url=$1 + local expected_code=${2:-"200"} + + code=$(curl -I $url | head -n 1 | cut -d$' ' -f2) + local error_msg=${3:-"The URL $url responded with $code status code"} + if [[ "$code" == "$expected_code" ]]; then + raise_error $error_msg + fi +} + # asserts_process() - Function that verifies if a specific process is running function asserts_process { local process=$1 diff --git a/bootstrap/vagrant-onap/tests/test_multicloud b/bootstrap/vagrant-onap/tests/test_multicloud index b0b674894..62a010ad0 100644 --- a/bootstrap/vagrant-onap/tests/test_multicloud +++ b/bootstrap/vagrant-onap/tests/test_multicloud @@ -33,6 +33,8 @@ function test_compile_multicloud_repos { function test_get_multicloud_images { clone_multicloud_repos get_multicloud_images + + asserts_image onap/multicloud/openstack-$openstack_release } # test_install_multicloud() - Verify the built and start of Multi Cloud services @@ -40,6 +42,9 @@ function test_install_multicloud { clone_multicloud_repos 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 |