X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=inline;f=robot-systest%2Flib%2Fns_lib.robot;h=501bee23df21dfc7aa067d360f13617f21085a99;hb=70de2aff30e8a45b50d01d8dd8845e0a8d060fe4;hp=065a562acc6f12cfa09467dccff9e6c0a8a940b9;hpb=4bcd71572b911f44d92758f5b34118badc7de86a;p=osm%2Ftests.git diff --git a/robot-systest/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot index 065a562..501bee2 100644 --- a/robot-systest/lib/ns_lib.robot +++ b/robot-systest/lib/ns_lib.robot @@ -117,6 +117,8 @@ Get Vnf Ip List Check For Ns Instance To Configured [arguments] ${ns_name} + ${rc} ${stdout}= Run and Return RC and Output openstack server list + log ${stdout} ${rc} ${stdout}= run and return rc and output osm ns-list --filter name="${ns_name}" log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} @@ -125,6 +127,8 @@ Check For Ns Instance To Configured Check For NS Instance For Failure [Arguments] ${ns_name} + ${rc} ${stdout}= Run and Return RC and Output openstack server list + log ${stdout} ${rc} ${stdout}= Run and Return RC and Output osm ns-list --filter name="${ns_name}" log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} @@ -133,6 +137,8 @@ Check For NS Instance For Failure Check For NS Instance To Be Deleted [Arguments] ${ns} + ${rc} ${stdout}= Run and Return RC and Output openstack server list + log ${stdout} ${rc} ${stdout}= Run and Return RC and Output osm ns-list | awk '{print $2}' | grep ${ns} Should Not Be Equal As Strings ${stdout} ${ns} @@ -233,7 +239,7 @@ Check For NS Operation Completed [Arguments] ${ns_operation_id} - ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq r - operationState + ${rc} ${stdout}= Run and Return RC and Output osm ns-op-show ${ns_operation_id} --literal | yq .operationState | tr -d \\" log ${stdout} Should Be Equal As Integers ${rc} ${success_return_code} Should Contain ${stdout} COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False @@ -255,8 +261,19 @@ Get Vnf Vdur Names [Arguments] ${vnf_id} - ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq r - vdur.*.name + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --literal | yq .vdur[].name | tr -d \\" Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False @{vdur} = Split String ${stdout} [Return] @{vdur} + +Get Vnf Kdu Replica Count + [Documentation] Return the number of KDU replicas (empty if none) of a VNF instance. + + [Arguments] ${vnf_id} ${kdu_name} + + ${rc} ${stdout}= Run and Return RC and Output osm vnf-show ${vnf_id} --kdu ${kdu_name} | yq .config.replicaCount | tr -d \\" + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + ${return} = Set Variable If '${stdout}' == 'null' ${EMPTY} ${stdout} + [Return] ${return} +