Properly escape query string to jq 58/114458/1
authorTodd Malsbary <todd.malsbary@intel.com>
Tue, 20 Oct 2020 19:20:26 +0000 (12:20 -0700)
committerTodd Malsbary <todd.malsbary@intel.com>
Fri, 30 Oct 2020 23:30:14 +0000 (16:30 -0700)
Without this change, the '.request.release-name' query causes jq to
get confused by the '-' and fail the test script:

    jq: error: name/0 is not defined at <top-level>, line 1:
    .request.release-name
    jq: 1 compile error

Issue-ID: MULTICLOUD-1241
Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
Change-Id: I386cd46db8e44c92bc24d8eb8a9e3964d9b87d39

kud/tests/plugin_fw.sh

index a503d66..de9c12e 100755 (executable)
@@ -124,9 +124,9 @@ print_msg "Retrieving VNF details"
 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
+test "$(jq -r '.request.labels.testCaseName' <<< "${response}")" == plugin_fw.sh
 print_msg "Assert ReleaseName has been correctly overriden"
-test "$(jq -r .request.release-name <<< "${response}")" == "${release_name}"
+test "$(jq -r '.request."release-name"' <<< "${response}")" == "${release_name}"
 
 #Teardown
 print_msg "Deleting VNF Instance"