X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=robot-systest%2Flib%2Fns_lib.robot;h=125ad14bb78775d2ac69225d0e49683777ef57e7;hb=refs%2Fheads%2Fsol006;hp=4ee5bd635f6b2108eae2d17633456314dea47253;hpb=9b272c5957aa517abcc01aaca364f8e21a60626e;p=osm%2Ftests.git diff --git a/robot-systest/lib/ns_lib.robot b/robot-systest/lib/ns_lib.robot index 4ee5bd6..125ad14 100644 --- a/robot-systest/lib/ns_lib.robot +++ b/robot-systest/lib/ns_lib.robot @@ -13,7 +13,7 @@ *** Variables *** ${success_return_code} 0 ${ns_launch_pol_time} 30sec -${ns_delete_max_wait_time} 1min +${ns_delete_max_wait_time} 4min ${ns_delete_pol_time} 15sec ${ns_action_max_wait_time} 1min ${ns_action_pol_time} 15sec @@ -152,6 +152,31 @@ Execute NS Action [Return] ${stdout} +Execute NS K8s Action + [Documentation] Execute an action over the desired K8s NS. + ... Parameters are given to this function in key=value format (one argument per key/value pair). + ... Return the ID of the operation associated to the executed action. + ... Examples of execution: + ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} + ... \${ns_op_id}= Execute NS Action \${ns_name} \${ns_action} \${vnf_member_index} \${param1}=\${value1} \${param2}=\${value2} + + [Arguments] ${ns_name} ${ns_action} ${vnf_member_index} ${kdu_name} @{action_params} + + ${params}= Set Variable ${EMPTY} + FOR ${param} IN @{action_params} + ${match} ${param_name} ${param_value} = Should Match Regexp ${param} (.+)=(.+) msg=Syntax error in parameters + ${params}= Catenate SEPARATOR= ${params} "${param_name}":"${param_value}", + END + ${osm_ns_action_command}= Set Variable osm ns-action --action_name ${ns_action} --vnf_name ${vnf_member_index} --kdu_name ${kdu_name} + ${osm_ns_action_command}= Run Keyword If '${params}'!='${EMPTY}' Catenate ${osm_ns_action_command} --params '{${params}}' + ... ELSE Set Variable ${osm_ns_action_command} + ${osm_ns_action_command}= Catenate ${osm_ns_action_command} ${ns_name} + ${rc} ${stdout}= Run and Return RC and Output ${osm_ns_action_command} + Should Be Equal As Integers ${rc} ${success_return_code} msg=${stdout} values=False + Wait Until Keyword Succeeds ${ns_action_max_wait_time} ${ns_action_pol_time} Check For NS Operation Completed ${stdout} + [Return] ${stdout} + + Execute Manual VNF Scale [Documentation] Execute a manual VNF Scale action. ... The parameter 'scale_type' must be SCALE_IN or SCALE_OUT.