Updated k8s04: new test to upgrade KDU with new keyword in ns_lib
[osm/tests.git] / robot-systest / lib / ns_lib.robot
index 57eb6f5..148e381 100644 (file)
@@ -17,8 +17,8 @@ ${ns_delete_max_wait_time}   4min
 ${ns_delete_pol_time}   15sec
 ${ns_action_max_wait_time}   1min
 ${ns_action_pol_time}   15sec
-${vnf_scale_max_wait_time}   5min
-${vnf_scale_pol_time}   30sec
+${vnf_scale_max_wait_time}   2min
+${vnf_scale_pol_time}   15sec
 
 
 *** Keywords ***
@@ -202,7 +202,7 @@ Execute Manual VNF Scale
     ${osm_vnf_scale_command}=  Catenate  ${osm_vnf_scale_command}  ${ns_name}  ${vnf_member_index}
     ${rc}  ${stdout}=  Run and Return RC and Output  ${osm_vnf_scale_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}
+    Wait Until Keyword Succeeds  ${vnf_scale_max_wait_time}  ${vnf_scale_pol_time}  Check For NS Operation Completed  ${stdout}
     [Return]  ${stdout}
 
 
@@ -247,3 +247,13 @@ Get Vnf Vdur Names
     @{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 r - config.replicaCount
+    Should Be Equal As Integers  ${rc}  ${success_return_code}  msg=${stdout}  values=False
+    [Return]  ${stdout}
+