Remove unnecessary grep and tr from some tests
Change-Id: I1cd911ee35614f1726dd95abe6a5b1923a8b772c
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/robot-systest/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot
index 36ecd57..aa0830f 100644
--- a/robot-systest/lib/ns_lib.robot
+++ b/robot-systest/lib/ns_lib.robot
@@ -108,7 +108,7 @@
[Arguments] ${ns_id}
Should Not Be Empty ${ns_id}
- @{vnf_list_string}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1
+ @{vnf_list_string}= Run and Return RC and Output osm vnf-list --ns ${ns_id} | grep ${ns_id} | awk '{print $2}' 2>&1
# Returns a String of vnf_id and needs to be converted into a list
@{vnf_list} = Split String ${vnf_list_string}[1]
Log List ${vnf_list}
@@ -289,7 +289,7 @@
[Arguments] ${ns_operation_id}
Should Not Be Empty ${ns_operation_id}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq -r .operationState
Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain ${stdout} COMPLETED msg=The ns-action with id ${ns_operation_id} was not completed values=False
@@ -301,7 +301,7 @@
[Arguments] ${ns_operation_id}
Should Not Be Empty ${ns_operation_id}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq -r .operationState
Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain ${stdout} FAILED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False
@@ -313,7 +313,7 @@
[Arguments] ${ns_operation_id}
Should Not Be Empty ${ns_operation_id}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq -r .operationState
Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
Should Contain Any ${stdout} FAILED COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False
@@ -325,7 +325,7 @@
[Arguments] ${ns_id}
Should Not Be Empty ${ns_id}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-list | grep ${ns_id} | awk '{print $2}' 2>&1
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-list --ns ${ns_id} | grep ${ns_id} | awk '{print $2}' 2>&1
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
@{vdur} = Split String ${stdout}
[Return] @{vdur}
@@ -337,7 +337,7 @@
[Arguments] ${vnf_id}
Should Not Be Empty ${vnf_id}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq .vdur[].name | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq -r .vdur[].name
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
@{vdur} = Split String ${stdout}
[Return] @{vdur}
@@ -350,7 +350,7 @@
Should Not Be Empty ${vnf_id}
Should Not Be Empty ${kdu_name}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --kdu ${kdu_name} | yq .config.replicaCount | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --kdu ${kdu_name} | yq -r .config.replicaCount
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
${return} = Set Variable If '${stdout}' == 'null' ${EMPTY} ${stdout}
[Return] ${return}
@@ -362,7 +362,7 @@
[Arguments] ${ns_name}
Should Not Be Empty ${ns_name}
- ${rc} ${stdout}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq ._admin.deployed.VCA[].application | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm ns-show ${ns_name} --literal | yq -r ._admin.deployed.VCA[].application
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
@{app_names} = Split String ${stdout}
[Return] ${app_names}
@@ -373,10 +373,10 @@
[Arguments] ${ns_name} ${vnf_id} ${vdur_id}
- ${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
+ ${rc} ${affinity_group_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq -r '."affinity-or-anti-affinity-group-id"[0]' 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 '."affinity-or-anti-affinity-group"[] | select(.id == "'${affinity_group_id}'")' | yq '.name' | tr -d \\" 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 -r '.name' 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/openstack_lib.robot b/robot-systest/lib/openstack_lib.robot
index bdf49aa..19dddc9 100644
--- a/robot-systest/lib/openstack_lib.robot
+++ b/robot-systest/lib/openstack_lib.robot
@@ -196,7 +196,7 @@
[Arguments] ${flavor_name} ${cpu}=1 ${ram}=1024 ${disk}=10
Should Not Be Empty ${flavor_name}
- ${rc} ${flavor_id}= Run and Return RC and Output openstack flavor create ${flavor_name} --ram ${ram} --disk ${disk} --vcpus ${cpu} -f yaml | yq '.id' | tr -d \\"
+ ${rc} ${flavor_id}= Run and Return RC and Output openstack flavor create ${flavor_name} --ram ${ram} --disk ${disk} --vcpus ${cpu} -f yaml | yq -r '.id'
Log ${flavor_id}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${flavor_id}
diff --git a/robot-systest/lib/vnf_lib.robot b/robot-systest/lib/vnf_lib.robot
index b3d4aa7..b7d6cc3 100644
--- a/robot-systest/lib/vnf_lib.robot
+++ b/robot-systest/lib/vnf_lib.robot
@@ -26,7 +26,7 @@
[Arguments] ${vnf_id}
Should Not Be Empty ${vnf_id}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | grep vim-id | awk '{print $2}'
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq -r '.vdur[]."vim-id"'
Log ${stdout}
Should Be Equal As Integers ${rc} ${success_return_code}
[Return] ${stdout}
@@ -51,7 +51,7 @@
[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 '.vdur[] | select(.id == "'${vdur_id}'")' | yq '."vim-id"' | tr -d \\"
+ ${rc} ${vm_vim_id}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(.id == "'${vdur_id}'")' | yq -r '."vim-id"'
Log ${vm_vim_id}
Should Be Equal As Integers ${rc} ${success_return_code} msg=${vm_vim_id} values=False
[Return] ${vm_vim_id}
@@ -63,7 +63,7 @@
[Arguments] ${vnf_id}
Should Not Be Empty ${vnf_id}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[].interfaces[]."ip-address"' | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq -r '.vdur[].interfaces[]."ip-address"'
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
@{ip} = Split String ${stdout}
[Return] @{ip}
@@ -76,6 +76,6 @@
Should Not Be Empty ${vnf_id}
Should Not Be Empty ${attribute}
- ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(."count-index" == ${count_index})' | yq '."${attribute}"' | tr -d \\"
+ ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq '.vdur[] | select(."count-index" == ${count_index})' | yq -r '."${attribute}"'
Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False
[Return] ${stdout}