-
-Heal Charm VDU
- [Tags] verify
- Variable Should Exist ${vnf_charm_id} msg=VNF is not available
- Heal Network Service ${ns_id} --vnf ${vnf_charm_id} --cause "Heal VM of charm_vnf" --vdu ${vdu_charm_name} --count-index 1 --run-day1
-
-
-Check VNF After Healing
- [Tags] verify
- Variable Should Exist ${vnf_charm_id} msg=VNF is not available
-
- @{ip_list}= Get Vnf Vdur IPs ${vnf_charm_id}
- Should Be Equal ${ip_list} ${charm_ip_list} IP addresses have changed after healing
-
- ${id}= Get VNF VIM ID ${vnf_charm_id}
- @{ids}= Split String ${id}
- Should Be Equal ${vdu_charm_ids}[0] ${ids}[0] VDU[0] id has changed after healing
- Should Not Be Equal ${vdu_charm_ids}[1] ${ids}[1] VDU[1] id has not changed after healing
- Should Be Equal ${vdu_charm_ids}[2] ${ids}[2] VDU[2] id has changed after healing
-
- ${ip}= Get Vdu Attribute ${vnf_charm_id} ip-address 1
- ${stdout}= Execute Remote Command Check Rc Return Output ${ip} ${username} ${password} ${privatekey} sudo ls ${vnf_charm_cloudinit_file}
- log ${stdout}
- Check If remote File Exists ${ip} ${username} ${password} ${privatekey} ${vnf_charm_day1_file}
-
+Heal Manual Scale VDU
+ [Documentation] Heal manually via OSM commands all stopped VMs . They should be started again.
+ 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
+
+Update VIM Objects
+ [Documentation] Retrieve all VMs and volumes from the NS and stores them in VIM_VDUS and VIM_VOLUMES lists.
+ ... This is done again to guarantee that all objects are cleaned in the VIM in case the heal operation
+ ... added new objects.
+ Variable Should Exist ${NS_ID} msg=NS is not available
+ @{vdu_updated}= Create List
+ @{vnf_id_list}= Get Ns Vnf List ${NS_ID}
+ FOR ${vnf_id} IN @{vnf_id_list}
+ ${id}= Get VNF VIM ID ${vnf_id}
+ @{vdu_ids}= Split String ${id}
+ Append To List ${vdu_updated} @{vdu_ids}
+ FOR ${id} IN @{vdu_ids}
+ IF not "${id}" in "@{VIM_VDUS}"
+ Append To List ${VIM_VDUS} ${id}
+ END
+ END
+ END
+ FOR ${vdu_id} IN @{vdu_updated}
+ ${volumes_attached}= Get Server Property ${vdu_id} volumes_attached
+ ${match}= Get Regexp Matches ${volumes_attached} '([0-9a-f\-]+)' 1
+ IF ${match} != @{EMPTY}
+ IF not "${match}[0]" in "@{VIM_VOLUMES}"
+ Append To List ${VIM_VOLUMES} ${match}[0]
+ END
+ END
+ END
+ Log Many @{VIM_VDUS}
+ Log Many @{VIM_VOLUMES}