Expose override parameters usage in KUD API tests 75/111375/2
authorKonrad Bańka <k.banka@samsung.com>
Tue, 18 Aug 2020 13:51:38 +0000 (15:51 +0200)
committerRitu Sood <Ritu.Sood@intel.com>
Fri, 21 Aug 2020 14:17:29 +0000 (14:17 +0000)
Update plugin_fw.sh test script to also check for proper work of
override parameters functionality of instance API.
Also update instance API response to exclude duplicated
override-parameters entry, that's anyway accessible under
'.request.override-values' json path.

Issue-ID: MULTICLOUD-1176
Signed-off-by: Konrad Bańka <k.banka@samsung.com>
Change-Id: Ie1a336ceb7de1a656f77d4c43ee4775c60cb88fb

kud/tests/plugin_fw.sh
src/k8splugin/internal/app/instance.go

index eec467c..9c98177 100755 (executable)
@@ -92,7 +92,9 @@ payload="$(cat <<EOF
     "rb-name": "${rb_name}",
     "rb-version": "${rb_version}",
     "profile-name": "${profile_name}",
-    "cloud-region": "${cloud_region_id}"
+    "cloud-region": "${cloud_region_id}",
+    "labels": {"testCaseName": "plugin_fw.sh"},
+    "override-values": {"global.onapPrivateNetworkName": "onap-private-net-test"}
 }
 EOF
 )"
@@ -100,19 +102,24 @@ response="$(call_api -d "${payload}" "${base_url}/instance")"
 echo "$response"
 vnf_id="$(jq -r '.id' <<< "${response}")"
 
-print_msg "Validating VNF instance"
-# Check if all pods are up
+print_msg "[BEGIN] Basic checks for instantiated resource"
+print_msg "Check if override value has been applied correctly"
+kubectl get network -n "${namespace}" onap-private-net-test
+print_msg "Wait for all pods to start"
 wait_for_pod -n "${namespace}" -l app=sink
 wait_for_pod -n "${namespace}" -l app=firewall
 wait_for_pod -n "${namespace}" -l app=packetgen
 # TODO: Provide some health check to verify vFW work
-
-print_msg "Waiting for VNF instances"
-sleep 480
+print_msg "Not waiting for vFW to fully install as no further checks are implemented in testcase"
+#print_msg "Waiting 8minutes for vFW installation"
+#sleep 8m
+print_msg "[END] Basic checks for instantiated resource"
 
 print_msg "Retrieving VNF details"
-call_api "${base_url}/instance/${vnf_id}"
-
+response="$(call_api "${base_url}/instance/${vnf_id}")"
+echo "$response"
+print_msg "Assert additional label has been assigned to rb instance"
+test "$(jq -r .request.labels.testCaseName <<< "${response}")" == plugin_fw.sh
 
 #Teardown
 print_msg "Deleting VNF Instance"
index d6eb91b..ad67764 100644 (file)
@@ -46,7 +46,6 @@ type InstanceResponse struct {
        Request        InstanceRequest           `json:"request"`
        Namespace      string                    `json:"namespace"`
        Resources      []helm.KubernetesResource `json:"resources"`
-       OverrideValues map[string]string         `json:"override-values"`
 }
 
 // InstanceMiniResponse contains the response from instantiation