Clean up scenario floating IP waiting
In changes I0f7e1c9096dc1903903fb31c5e854f07800efbfd and I05e079237aec332925a88476e45071b34dc722c6 we started waiting for a floating IP to appear in the Nova 'show server details' API before continuing with the test. This left some useless test code left over that needlessly asserted that the floating IP was showing up (or had disappeared, in the case of disassociation) from the Nova 'show server details' API after the waiter had already checked the same thing. This patch cleans this up. Change-Id: I692402cf0d831c524ca5f49daf4aa9b0d19d41b5
This commit is contained in:
committed by
Martin Kopec
parent
4e994020d0
commit
e4ee76252f
@@ -86,20 +86,6 @@ class TestMinimumBasicScenario(manager.ScenarioTest):
|
||||
'%s' % (secgroup['id'], server['id']))
|
||||
raise exceptions.TimeoutException(msg)
|
||||
|
||||
def _get_floating_ip_in_server_addresses(self, floating_ip, server):
|
||||
for addresses in server['addresses'].values():
|
||||
for address in addresses:
|
||||
if (address['OS-EXT-IPS:type'] == 'floating' and
|
||||
address['addr'] == floating_ip['floating_ip_address']):
|
||||
return address
|
||||
|
||||
def _is_floating_ip_detached_from_server(self, server, floating_ip):
|
||||
server_info = self.servers_client.show_server(
|
||||
server['id'])['server']
|
||||
address = self._get_floating_ip_in_server_addresses(
|
||||
floating_ip, server_info)
|
||||
return (not address)
|
||||
|
||||
@decorators.idempotent_id('bdbb5441-9204-419d-a225-b4fdbfb1a1a8')
|
||||
@utils.services('compute', 'volume', 'image', 'network')
|
||||
def test_minimum_basic_scenario(self):
|
||||
@@ -173,15 +159,6 @@ class TestMinimumBasicScenario(manager.ScenarioTest):
|
||||
self.servers_client, server, floating_ip,
|
||||
wait_for_disassociate=True)
|
||||
|
||||
if not test_utils.call_until_true(
|
||||
self._is_floating_ip_detached_from_server,
|
||||
CONF.compute.build_timeout,
|
||||
CONF.compute.build_interval, server, floating_ip):
|
||||
msg = ("Floating IP '%s' should not be in server addresses: %s"
|
||||
% (floating_ip['floating_ip_address'],
|
||||
server['addresses']))
|
||||
raise exceptions.TimeoutException(msg)
|
||||
|
||||
@decorators.idempotent_id('a8fd48ec-1d01-4895-b932-02321661ec1e')
|
||||
@testtools.skipUnless(CONF.volume_feature_enabled.snapshot,
|
||||
"Cinder volume snapshots are disabled")
|
||||
@@ -232,17 +209,8 @@ class TestMinimumBasicScenario(manager.ScenarioTest):
|
||||
fip = self.create_floating_ip(server)
|
||||
floating_ip = self.associate_floating_ip(
|
||||
fip, server)
|
||||
# fetch the server again to make sure the addresses were refreshed
|
||||
# after associating the floating IP
|
||||
waiters.wait_for_server_floating_ip(self.servers_client, server,
|
||||
floating_ip)
|
||||
server = self.servers_client.show_server(server['id'])['server']
|
||||
address = self._get_floating_ip_in_server_addresses(
|
||||
floating_ip, server)
|
||||
self.assertIsNotNone(
|
||||
address,
|
||||
"Failed to find floating IP '%s' in server addresses: %s" %
|
||||
(floating_ip['floating_ip_address'], server['addresses']))
|
||||
ssh_ip = floating_ip['floating_ip_address']
|
||||
else:
|
||||
ssh_ip = self.get_server_ip(server)
|
||||
@@ -278,12 +246,3 @@ class TestMinimumBasicScenario(manager.ScenarioTest):
|
||||
waiters.wait_for_server_floating_ip(
|
||||
self.servers_client, server, floating_ip,
|
||||
wait_for_disassociate=True)
|
||||
|
||||
if not test_utils.call_until_true(
|
||||
self._is_floating_ip_detached_from_server,
|
||||
CONF.compute.build_timeout, CONF.compute.build_interval,
|
||||
server, floating_ip):
|
||||
msg = ("Floating IP '%s' should not be in server addresses: %s"
|
||||
% (floating_ip['floating_ip_address'],
|
||||
server['addresses']))
|
||||
raise exceptions.TimeoutException(msg)
|
||||
|
||||
Reference in New Issue
Block a user