diff options
author | Konrad Bańka <k.banka@samsung.com> | 2019-07-04 08:49:12 +0200 |
---|---|---|
committer | Konrad Bańka <k.banka@samsung.com> | 2019-07-16 14:06:46 +0200 |
commit | 8d49d940823c9d0d653c9793a3d92a707f0862a9 (patch) | |
tree | e409151b10a768fab2c2b68b0ec6b1f9818e8ffa /kud/tests | |
parent | c9a8ac4b9a1a08e59f993edcec3148af56cb7c47 (diff) |
Provide connection info for plugin testcase
Plugin.sh testcase was unable to instantiate VNF as it was
missing k8s backend configuration. This configuration is
now provided before instantiation and torn down on test end.
Issue-ID: MULTICLOUD-639
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: I7ffaa3d4e2df84b38b50e11900406b55f94c6de8
Diffstat (limited to 'kud/tests')
-rwxr-xr-x | kud/tests/plugin.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/kud/tests/plugin.sh b/kud/tests/plugin.sh index 59daa1c3..0d786f9f 100755 --- a/kud/tests/plugin.sh +++ b/kud/tests/plugin.sh @@ -20,6 +20,7 @@ source _functions.sh base_url="http://localhost:9015" #Will resolve to file $KUBE_CONFIG_DIR/kud cloud_region_id="kud" +cloud_region_owner="test_owner" namespace="testns" csar_id="94e414f6-9ca4-11e8-bb6a-52540067263b" rb_name="test-rbdef" @@ -121,6 +122,21 @@ if [[ "$rbp_ret" != *"${profile_name}"* ]]; then exit 1 fi +print_msg "Setup cloud data" +payload="$(cat <<EOF +{ + "cloud-region": "$cloud_region_id", + "cloud-owner": "$cloud_region_owner" +} +EOF +)" +if ! curl -sf -F "metadata=$payload" \ + -F "file=@$HOME/.kube/config" \ + "${base_url}/v1/connectivity-info"; then + echo "Unsuccessful register of cloud region" + exit 1 +fi + print_msg "Instantiate Profile" payload_raw=" { @@ -169,5 +185,14 @@ if [[ 404 -ne $(curl -o /dev/null -w %{http_code} -s -X GET "${base_url}/${inst_ exit 1 fi +print_msg "Deleting ${cloud_region_id} cloud region connection" +if ! curl -w "%{http_code}" -X DELETE -sf \ + "${base_url}/v1/connectivity-info/${cloud_region_id}"; then + echo "Failed to delete cloud region connection" + #DELETE on /v1/connectivity-info/{region} currently doesn't return non 2** + #https code no matter if region has been deleted, or there was no entry + exit 1 +fi + # Teardown teardown $plugin_deployment_name |