Fix OSM_HOSTNAME for public cloud tests in Azure
[osm/tests.git] / robot-systest / testsuite / heal_03-multiple_healing.robot
index d77c88b..fc81b0b 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
@@ -141,6 +145,8 @@ 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}
 
 Get Volume VNF Info
     [Documentation]   Get info about volumes and VM of the VNF with several volumes and stores them in suite variables.
@@ -157,6 +163,17 @@ Get Volume VNF Info
     Set Suite Variable   @{VOLUMES_IP_LIST}   @{volumes_ip_list}
     Log   @{VOLUMES_IP_LIST}
 
+Check Day0 And Day1 In VDU Before Stopping 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}
+
 Stop VDUs
     [Documentation]   Stop all VMs.
     Variable Should Exist   @{VDU_MANUALSCALE_IDS}   msg=Manual Scale VDUs are not available
@@ -172,21 +189,29 @@ Heal VDUs
     Variable Should Exist   ${VNF_VOLUMES_ID}   msg=Volume VNF is not available
     Heal Network Service   ${NS_ID}   --vnf ${VNF_VOLUMES_ID} --cause "Heal myvdu1 of several_volumes_vnf" --vdu several_volumes-VM --vnf ${VNF_MANUALSCALE_ID} --cause "Heal two VMs of manual_scale_vnf" --vdu mgmtVM --count-index 1 --run-day1 --vdu mgmtVM --count-index 2
 
-# Check VNFs After Healing
-#     [Documentation]   Check that the IDs of the VM and volumes have not changed after healing.
-#     Variable Should Exist   ${VNF_MANUALSCALE_ID}   msg=Manual scale VNF is not available
-#     Variable Should Exist   ${VNF_VOLUMES_ID}   msg=Volume VNF is not available
-#     ${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 Not Be Equal   ${VDU_MANUALSCALE_IDS}[2]   ${ids}[2]   VDU[2] id has not changed after healing
-#     ${id}=   Get VNF VIM ID   ${VNF_VOLUMES_ID}
-#     Should Not Be Equal   ${id}   ${VDU_VOLUMES_ID}   VDU id has not 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}
+Check VNFs After Healing
+    [Documentation]   Check that the IDs of the VM and volumes have not changed after healing.
+    Variable Should Exist   ${VNF_MANUALSCALE_ID}   msg=Manual scale VNF is not available
+    Variable Should Exist   ${VNF_VOLUMES_ID}   msg=Volume VNF is not available
+    ${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 Not Be Equal   ${VDU_MANUALSCALE_IDS}[2]   ${ids}[2]   VDU[2] id has not changed after healing
+    ${id}=   Get VNF VIM ID   ${VNF_VOLUMES_ID}
+    Should Not Be Equal   ${id}   ${VDU_VOLUMES_ID}   VDU id has not changed after healing
+    ${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.