From 21e74da5550521ee2cc561210b4d36c0047a41bc Mon Sep 17 00:00:00 2001 From: garciadeblas Date: Tue, 18 Jun 2024 12:58:38 +0200 Subject: [PATCH] Fix bug 2334 in heal_03 to add loop to check presence of remote file after healing Change-Id: I4d341df2e4b4d6ebecf4f3e57a6783f91e4825ca Signed-off-by: garciadeblas --- .../testsuite/heal_03-multiple_healing.robot | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/robot-systest/testsuite/heal_03-multiple_healing.robot b/robot-systest/testsuite/heal_03-multiple_healing.robot index ec520c9..fc81b0b 100644 --- a/robot-systest/testsuite/heal_03-multiple_healing.robot +++ b/robot-systest/testsuite/heal_03-multiple_healing.robot @@ -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 @@ -184,9 +201,17 @@ Check VNFs 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} + 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 ${ip} ${USERNAME} ${PASSWORD} ${PRIVATEKEY} ${VNF_MANUALSCALE_DAY1_FILE} + # 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. -- 2.25.1