Fix OSM_HOSTNAME for public cloud tests in Azure
[osm/tests.git] / robot-systest / testsuite / heal_02-scale_vdu_healing.robot
index 0e2defd..328274d 100644 (file)
@@ -67,6 +67,10 @@ ${SUCCESS_RETURN_CODE}   0
 @{VIM_VDUS}   @{EMPTY}
 @{VIM_VOLUMES}   @{EMPTY}
 
+# Variables to control time for healing and polling
+${VNF_MAX_TIME_TO_BE_READY}   120sec
+${VNF_POL_TIME}   30sec
+
 
 *** Test Cases ***
 Create VNF Descriptors
@@ -149,6 +153,19 @@ Get Manual Scale VNF Info
     Log   ${VDU_MANUALSCALE_IDS}[1]
     @{manualscale_ip_list}=   Get Vnf Vdur IPs   ${VNF_MANUALSCALE_ID}
     Set Suite Variable   @{MANUALSCALE_IP_LIST}   @{manualscale_ip_list}
+    ${ip}=   Get Vdu Attribute   ${VNF_MANUALSCALE_ID}   ip-address   1
+    Set Suite Variable   ${HEALED_VDU_MGMT_IP}   ${ip}
+
+Check Day0 And Day1 In VDU Before Halting VM
+    [Documentation]   Check that the VDU is accessible via SSH in its mgmt IP address.
+    ...               It also checks if day-0 worked and a remote file has been created in the VDU.
+    ...               It also checks if day-1 worked and a remote file has been created in the VDU.
+    ${ip}=   Get Vdu Attribute   ${VNF_MANUALSCALE_ID}   ip-address   1
+    Variable Should Exist   ${HEALED_VDU_MGMT_IP}   msg=IP address of the healed VDU is not available
+    Wait Until Keyword Succeeds   ${VNF_MAX_TIME_TO_BE_READY}   ${VNF_POL_TIME}   Test SSH Connection   ${HEALED_VDU_MGMT_IP}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}
+    ${stdout}=   Execute Remote Command Check Rc Return Output   ${ip}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}   sudo ls ${VNF_MANUALSCALE_CLOUDINIT_FILE}
+    Log   ${stdout}
+    # Check If Remote File Exists   ${HEALED_VDU_MGMT_IP}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}   ${VNF_MANUALSCALE_DAY1_FILE}
 
 Halt Manual Scale VDU
     [Documentation]   Halt one of the VM of the Manual Scale VNF.
@@ -161,22 +178,30 @@ Heal Manual Scale VDU
     Variable Should Exist   ${VNF_MANUALSCALE_ID}   msg=VNF is not available
     Heal Network Service   ${NS_ID}   --vnf ${VNF_MANUALSCALE_ID} --cause "Heal VM of manual_scale_vnf" --vdu ${VDU_MANUALSCALE_NAME} --count-index 1 --run-day1
 
-# Check VNF After Healing
-#     [Documentation]   Check that the IDs of the VM and volumes have not changed after healing.
-#     Variable Should Exist   ${VNF_MANUALSCALE_ID}   msg=VNF is not available
-#     @{ip_list}=   Get Vnf Vdur IPs   ${VNF_MANUALSCALE_ID}
-#     Should Be Equal   ${ip_list}   ${MANUALSCALE_IP_LIST}   IP addresses have changed after healing
-#     ${id}=   Get VNF VIM ID   ${VNF_MANUALSCALE_ID}
-#     @{ids}=   Split String   ${id}
-#     Should Be Equal   ${VDU_MANUALSCALE_IDS}[0]   ${ids}[0]   VDU[0] id has changed after healing
-#     Should Not Be Equal   ${VDU_MANUALSCALE_IDS}[1]   ${ids}[1]   VDU[1] id has not changed after healing
-#     Should Be Equal   ${VDU_MANUALSCALE_IDS}[2]   ${ids}[2]   VDU[2] id has changed after healing
-#     ${ip}=   Get Vdu Attribute   ${VNF_MANUALSCALE_ID}   ip-address   1
-#     ${stdout}=   Execute Remote Command Check Rc Return Output   ${ip}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}   sudo ls ${VNF_MANUALSCALE_CLOUDINIT_FILE}
-#     Log   ${stdout}
-#     Check If Remote File Exists   ${ip}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}   ${VNF_MANUALSCALE_DAY1_FILE}
-#     ${vim_info}=   Get Vdu Attribute   ${VNF_MANUALSCALE_ID}   vim_info   1
-#     Should Contain   ${vim_info}   id: ${FLAVOR_ID}   msg=Flavor ID is incorrect
+Check VNF After Healing
+    [Documentation]   Check that the IDs of the VM and volumes have not changed after healing.
+    Variable Should Exist   ${VNF_MANUALSCALE_ID}   msg=VNF is not available
+    @{ip_list}=   Get Vnf Vdur IPs   ${VNF_MANUALSCALE_ID}
+    Should Be Equal   ${ip_list}   ${MANUALSCALE_IP_LIST}   IP addresses have changed after healing
+    ${id}=   Get VNF VIM ID   ${VNF_MANUALSCALE_ID}
+    @{ids}=   Split String   ${id}
+    Should Be Equal   ${VDU_MANUALSCALE_IDS}[0]   ${ids}[0]   VDU[0] id has changed after healing
+    Should Not Be Equal   ${VDU_MANUALSCALE_IDS}[1]   ${ids}[1]   VDU[1] id has not changed after healing
+    Should Be Equal   ${VDU_MANUALSCALE_IDS}[2]   ${ids}[2]   VDU[2] id has changed after healing
+    ${vim_info}=   Get Vdu Attribute   ${VNF_MANUALSCALE_ID}   vim_info   1
+    Should Contain   ${vim_info}   id: ${FLAVOR_ID}   msg=Flavor ID is incorrect
+    ${ip}=   Get Vdu Attribute   ${VNF_MANUALSCALE_ID}   ip-address   1
+    Should Be Equal   ${HEALED_VDU_MGMT_IP}   ${ip}
+
+Check Day0 And Day1 In VDU After Healing
+    [Documentation]   Check that the healed VDU is accessible via SSH in its mgmt IP address.
+    ...               It also checks if day-0 worked after healing and a remote file has been created in the VDU.
+    ...               It also checks if day-1 worked after healing and a remote file has been created in the VDU.
+    Variable Should Exist   ${HEALED_VDU_MGMT_IP}   msg=IP address of the healed VDU is not available
+    Wait Until Keyword Succeeds   ${VNF_MAX_TIME_TO_BE_READY}   ${VNF_POL_TIME}   Test SSH Connection   ${HEALED_VDU_MGMT_IP}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}
+    ${stdout}=   Execute Remote Command Check Rc Return Output   ${HEALED_VDU_MGMT_IP}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}   sudo ls ${VNF_MANUALSCALE_CLOUDINIT_FILE}
+    Log   ${stdout}
+    # Check If Remote File Exists   ${HEALED_VDU_MGMT_IP}   ${USERNAME}   ${PASSWORD}   ${PRIVATEKEY}   ${VNF_MANUALSCALE_DAY1_FILE}
 
 Update VIM Objects
     [Documentation]   Retrieve all VMs and volumes from the NS and stores them in VIM_VDUS and VIM_VOLUMES lists.