Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[1LP][RFR] Automate: test_ec2_targeted_refresh_floating_ip #10205

Merged
merged 1 commit into from
Jun 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions cfme/tests/cloud/test_targeted_refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from cfme import test_requirements
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.blockers import BZ
from cfme.utils.generators import random_vm_name
from cfme.utils.wait import wait_for
Expand Down Expand Up @@ -80,11 +81,14 @@ def test_targeted_refresh_instance(appliance, create_vm, provider, request):
wait_for_power_state(vms_collection, instance.mgmt.name, "terminated")


@pytest.mark.manual
def test_ec2_targeted_refresh_floating_ip():
@pytest.mark.meta(automates=[1746860])
def test_ec2_targeted_refresh_floating_ip(provider, create_vm):
"""
AWS naming is Elastic IP

Bugzilla:
1746860

Polarion:
assignee: mmojzis
casecomponent: Cloud
Expand All @@ -101,7 +105,28 @@ def test_ec2_targeted_refresh_floating_ip():
7. Floating IP UPDATE
8. Floating IP DELETE
"""
pass
ec2_connection = provider.mgmt.ec2_connection
vm = provider.mgmt.get_vm(name=create_vm.name)
vm_id = vm.raw.id

view = navigate_to(create_vm, "Details")
ui_ip_address = create_vm.all_ip_addresses

allocation = ec2_connection.allocate_address(Domain="vpc")
ec2_connection.associate_address(AllocationId=allocation["AllocationId"], InstanceId=vm_id)
wait_for(
lambda: create_vm.all_ip_addresses != ui_ip_address,
fail_func=view.toolbar.reload.click,
timeout=180,
)
assert allocation["PublicIp"] in create_vm.all_ip_addresses

ec2_connection.release_address(AllocationId=allocation["AllocationId"])
wait_for(
lambda: allocation["PublicIp"] not in create_vm.all_ip_addresses,
fail_func=view.toolbar.reload.click,
timeout=360,
)


def test_targeted_refresh_network(appliance, provider, request):
Expand Down