From: Alexis Romero Date: Thu, 7 Apr 2022 12:49:27 +0000 (+0200) Subject: Tests Basic 24: Fix for format error using yq X-Git-Tag: v12.0.0rc1~29 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F67%2F11867%2F2;p=osm%2Ftests.git Tests Basic 24: Fix for format error using yq Change-Id: I8b28a85ef10923f7e98f0053694b6520e46f440b Signed-off-by: Alexis Romero --- diff --git a/robot-systest/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot index 34b0abf..0976241 100644 --- a/robot-systest/lib/ns_lib.robot +++ b/robot-systest/lib/ns_lib.robot @@ -305,10 +305,10 @@ Get VDU Affinity Group Name [Arguments] ${ns_name} ${vnf_id} ${vdur_id} - ${rc} ${affinity_group_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq eval '.vdur[] | select(.id == "${vdur_id}") | .affinity-or-anti-affinity-group-id[0]' 2>&1 + ${rc} ${affinity_group_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq '."affinity-or-anti-affinity-group-id"[0]' | tr -d \\" 2>&1 log ${affinity_group_id} Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_id} values=False - ${rc} ${affinity_group_name}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq eval '.affinity-or-anti-affinity-group[] | select(.id == ${affinity_group_id}) | .name' 2>&1 + ${rc} ${affinity_group_name}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq '."affinity-or-anti-affinity-group"[] | select(.id == "'${affinity_group_id}'")' | yq '.name' | tr -d \\" 2>&1 log ${affinity_group_name} Should Be Equal As Integers ${rc} ${success_return_code} msg=${affinity_group_name} values=False [Return] ${affinity_group_name} diff --git a/robot-systest/lib/vnf_lib.robot b/robot-systest/lib/vnf_lib.robot index 7659a36..7b7d86d 100644 --- a/robot-systest/lib/vnf_lib.robot +++ b/robot-systest/lib/vnf_lib.robot @@ -44,7 +44,7 @@ Get VDU VIM Id [Arguments] ${vnf_id} ${vdur_id} Should Not Be Empty ${vnf_id} - ${rc} ${vm_vim_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq eval '.vdur[] | select(.id == "${vdur_id}") | .vim-id' + ${rc} ${vm_vim_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq '."vim-id"' | tr -d \\" log ${vm_vim_id} Should Be Equal As Integers ${rc} ${success_return_code} msg=${vm_vim_id} values=False [Return] ${vm_vim_id}