summaryrefslogtreecommitdiffstats
path: root/kud/tests/plugin_fw.sh
diff options
context:
space:
mode:
authorRitu Sood <ritu.sood@intel.com>2021-03-09 17:38:03 +0000
committerGerrit Code Review <gerrit@onap.org>2021-03-09 17:38:03 +0000
commitd8cceb1f629eb45752d1eee01420cdaec38958c9 (patch)
treed34b8fb1b6dfd70823c62d4aff8bcf846c7c4a94 /kud/tests/plugin_fw.sh
parent1ae98dd48acbe0450373b8d49282ca54761ff250 (diff)
parent5b9fca50ab64a0f51b29fe0a4269deea46be90a2 (diff)
Merge "Enable plugin_fw.sh to preserve CNF after tests"
Diffstat (limited to 'kud/tests/plugin_fw.sh')
-rwxr-xr-xkud/tests/plugin_fw.sh33
1 files changed, 23 insertions, 10 deletions
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"