X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fns_lib.robot;h=c8da2713e73425735c9559d003011a09ec3e3845;hb=refs%2Fchanges%2F16%2F14116%2F1;hp=aa0830ff414d9ddc067db7a99cbebef5b3d4308f;hpb=9553b6fa14f5e73d8dbf46d31ebcd8a796bfa005;p=osm%2Ftests.git diff --git a/robot-systest/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot index aa0830f..c8da271 100644 --- a/robot-systest/lib/ns_lib.robot +++ b/robot-systest/lib/ns_lib.robot @@ -284,7 +284,7 @@ Get Operations List Check For NS Operation Completed - [Documentation] Check wheter the status of the desired operation is "COMPLETED" or not. + [Documentation] Check whether the status of the desired operation is "COMPLETED" or not. [Arguments] ${ns_operation_id} @@ -296,7 +296,7 @@ Check For NS Operation Completed Check For NS Operation Failed - [Documentation] Check wheter the status of the desired operation is "FAILED" or not. + [Documentation] Check whether the status of the desired operation is "FAILED" or not. [Arguments] ${ns_operation_id} @@ -308,7 +308,7 @@ Check For NS Operation Failed Check For NS Operation Ended - [Documentation] Check wheter the status of the desired operation is "FAILED" or "COMPLETED". + [Documentation] Check whether the status of the desired operation is "FAILED" or "COMPLETED". [Arguments] ${ns_operation_id} @@ -319,6 +319,18 @@ Check For NS Operation Ended Should Contain Any ${stdout} FAILED COMPLETED msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False +Check For NS Operation Cancelled + [Documentation] Check whether the operation was cancelled or not. + + [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 -r '.operationState, .isCancelPending' + Log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + Should Contain ${stdout} FAILED_TEMP\nfalse msg=Timeout waiting for ns-action with id ${ns_operation_id} values=False + + Get Ns Vnfr Ids [Documentation] Return a list with the IDs of the VNF records of a NS instance. @@ -393,3 +405,23 @@ Get Operations By Type Should Be Equal As Integers ${rc} ${success_return_code} Should Not Be Empty ${stdout} [Return] ${stdout} + +Cancel operation By Id + [Documentation] Cancels an ongoing operation by operation ID + + [Arguments] ${op_id} ${cancel_mode}=GRACEFUL + + Should Not Be Empty ${op_id} + ${rc} ${stdout}= Run and Return RC and Output osm ns-op-cancel ${op_id} --cancel_mode ${cancel_mode} --wait + Log ${stdout} + Should Be Equal As Integers ${rc} ${success_return_code} + [Return] ${stdout} + +GET Dual Ip + [Documentation] Get dual ip from the ns list + [Arguments] ${ns_id} + Should Not Be Empty ${ns_id} + ${rc} ${stdout}= Run and Return RC and Output osm ns-show ${ns_id} --literal | grep -A2 ip-address | awk '{print $2}' | paste -sd ',' | sed 's/^,//; s/,/, /g' | sed 's/^/[/; s/$/]/' + Log ${stdout} + [Return] ${stdout} +