Robot fix for Autohealing tests
[osm/tests.git] / robot-systest / testsuite / heal_04-autohealing.robot
index 990b44a..024cd3d 100644 (file)
@@ -31,7 +31,7 @@ Resource          %{ROBOT_DEVOPS_FOLDER}/lib/openstack_lib.robot
 ${vnfd_pkg}   autoheal_vnf\r
 ${vnfd_name}   autoheal_vnfd\r
 ${vdu_name}   autoheal_vnfd-VM\r
-${vnf_index}   1\r
+${vnf_index}   autoheal-basic-1\r
 ${nsd_pkg}   autoheal_ns\r
 ${nsd_name}  autoheal_nsd\r
 # NS instance name and configuration\r
@@ -46,25 +46,26 @@ ${password}   ${EMPTY}
 \r
 ${success_return_code}   0\r
 \r
+#Healing wait time\r
+${healing_pol_time}   15sec\r
+${healing_max_wait_time}   10m\r
+\r
 *** Test Cases ***\r
 Create VNF Descriptors\r
-    [Tags]  prepare\r
     Create VNFD   '%{PACKAGES_FOLDER}/${vnfd_pkg}'\r
 \r
 \r
 Create NS Descriptor\r
-    [Tags]  prepare\r
     Create NSD   '%{PACKAGES_FOLDER}/${nsd_pkg}'\r
 \r
 \r
 Network Service Instance Test\r
-    [Tags]  prepare\r
     ${id}=   Create Network Service   ${nsd_name}   %{VIM_TARGET}   ${ns_name}   ${ns_config}   ${publickey}\r
     Set Suite Variable   ${ns_id}   ${id}\r
 \r
 \r
 Get NS Id\r
-    [Tags]   verify   cleanup\r
+    [Tags]   cleanup\r
     ${variables}   Get Variables\r
     IF   not "\${ns_id}" in "${variables}"\r
         ${id}=   Get Ns Id   ${ns_name}\r
@@ -73,7 +74,6 @@ Get NS Id
 \r
 \r
 Get VNF Info\r
-    [Tags]  verify\r
     Variable Should Exist  ${ns_id}  msg=NS is not available\r
     ${ip_addr}=  Get Vnf Management Ip Address   ${ns_id}   ${vnf_index}\r
     log   ${ip_addr}\r
@@ -91,20 +91,25 @@ Get VNF Info
 \r
 \r
 Stop Autoheal VDU\r
-    [Tags]  verify\r
     Variable Should Exist  ${vdu_autoheal_id}  msg=VDU is not available\r
     Halt Server   ${vdu_autoheal_id}\r
     Sleep   20\r
 \r
 \r
-Check VNF After Healing\r
-    [Tags]  verify\r
+Wait For Autohealing To Be Completed\r
     FOR    ${Index}    IN RANGE    0    15\r
-        ${server_status}=  Get Server Property   ${vdu_autoheal_id}   status\r
-        ${status}=    Run Keyword And Return Status    Should Be Equal    ${server_status}    ACTIVE\r
+        ${status}=    Run Keyword And Return Status    Get Operations By Type    ${ns_id}    heal\r
         Run Keyword If  ${status}    Exit For Loop\r
     ...  ELSE  Sleep    10\r
     END\r
+    ${stdout}=    Get Operations By Type    ${ns_id}    heal\r
+    ${healing_max_wait_time}=   Convert Time   ${healing_max_wait_time}   result_format=number\r
+    ${healing_max_wait_time}=   Evaluate   ${healing_max_wait_time} * ${vim_timeout_multiplier}\r
+    Wait Until Keyword Succeeds  ${healing_max_wait_time}  ${healing_pol_time}  Check For NS Operation Ended  ${stdout}\r
+    Check For NS Operation Completed  ${stdout}\r
+\r
+\r
+Check VNF After Healing\r
     Variable Should Exist  ${vnf_autoheal_id}  msg=VNF is not available\r
 \r
     @{ip_list}=  Get Vnf Vdur IPs   ${vnf_autoheal_id}\r