diff options
-rwxr-xr-x | kud/hosting_providers/vagrant/installer.sh | 2 | ||||
-rwxr-xr-x | kud/hosting_providers/vagrant/setup.sh | 2 | ||||
-rwxr-xr-x | kud/tests/plugin_fw.sh | 33 |
3 files changed, 25 insertions, 12 deletions
diff --git a/kud/hosting_providers/vagrant/installer.sh b/kud/hosting_providers/vagrant/installer.sh index 8211fa31..2a15de33 100755 --- a/kud/hosting_providers/vagrant/installer.sh +++ b/kud/hosting_providers/vagrant/installer.sh @@ -44,7 +44,7 @@ function _install_pip { sudo -E pip install --no-cache-dir --upgrade pip else sudo apt-get install -y python-dev - curl -sL https://bootstrap.pypa.io/2.7/get-pip.py | sudo python + curl -sL https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python fi } diff --git a/kud/hosting_providers/vagrant/setup.sh b/kud/hosting_providers/vagrant/setup.sh index 0f5442ab..db6a732c 100755 --- a/kud/hosting_providers/vagrant/setup.sh +++ b/kud/hosting_providers/vagrant/setup.sh @@ -176,7 +176,7 @@ sudo modprobe vhost_net ${INSTALLER_CMD} "${packages[@]}" if ! which pip; then - curl -sL https://bootstrap.pypa.io/2.7/get-pip.py | sudo python + curl -sL https://bootstrap.pypa.io/pip/2.7/get-pip.py | sudo python else sudo -H -E pip install --no-cache-dir --upgrade pip fi diff --git a/kud/tests/plugin_fw.sh b/kud/tests/plugin_fw.sh index de9c12e2..4d59006b 100755 --- a/kud/tests/plugin_fw.sh +++ b/kud/tests/plugin_fw.sh @@ -2,13 +2,16 @@ # SPDX-license-identifier: Apache-2.0 ############################################################################## # Copyright (c) 2018 -# Copyright © 2020 Samsung Electronics +# Copyright © 2021 Samsung Electronics # 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 ############################################################################## +# Script respects environment variable SKIP_CNF_TEARDOWN +# If set to "yes", it will preserve CNF for manual handling + set -o errexit set -o nounset set -o pipefail @@ -129,16 +132,26 @@ print_msg "Assert ReleaseName has been correctly overriden" test "$(jq -r '.request."release-name"' <<< "${response}")" == "${release_name}" #Teardown -print_msg "Deleting VNF Instance" -delete_resource "${base_url}/instance/${vnf_id}" - -print_msg "Deleting Profile" -delete_resource "${base_url}/rb/definition/${rb_name}/${rb_version}/profile/${profile_name}" +if [ "${SKIP_CNF_TEARDOWN:-}" == "yes" ]; then + print_msg "Leaving CNF running for further debugging" + echo "Remember to later issue following DELETE calls to clean environment" + cat <<EOF + curl -X DELETE "${base_url}/instance/${vnf_id}" + curl -X DELETE "${base_url}/rb/definition/${rb_name}/${rb_version}/profile/${profile_name}" + curl -X DELETE "${base_url}/rb/definition/${rb_name}/${rb_version}" + curl -X DELETE "${base_url}/connectivity-info/${cloud_region_id}" +EOF +else + print_msg "Deleting VNF Instance" + delete_resource "${base_url}/instance/${vnf_id}" -print_msg "Deleting Resource Bundle" -delete_resource "${base_url}/rb/definition/${rb_name}/${rb_version}" + print_msg "Deleting Profile" + delete_resource "${base_url}/rb/definition/${rb_name}/${rb_version}/profile/${profile_name}" -print_msg "Deleting ${cloud_region_id} cloud region connection" -delete_resource "${base_url}/connectivity-info/${cloud_region_id}" + print_msg "Deleting Resource Bundle" + delete_resource "${base_url}/rb/definition/${rb_name}/${rb_version}" + print_msg "Deleting ${cloud_region_id} cloud region connection" + delete_resource "${base_url}/connectivity-info/${cloud_region_id}" +fi print_msg "Test finished successfully" |