Fix check for FloatingIP status before check connection
This patch changes the order in which the floatingIP
status is being checked in all the network_basic and
network_advanced tests.
The check for floatingip status should be done before
your check for public network connectivity to the VM.
This would give the real details for the test case if
it was related to floatingip setup or something in the
test environment.
Change-Id: Ie606ba5194fe87047d553056ba0a82bcf8830ac0
Partial-Bug: #1426764
diff --git a/tempest/scenario/test_network_advanced_server_ops.py b/tempest/scenario/test_network_advanced_server_ops.py
index 6e82a41..19a8716 100644
--- a/tempest/scenario/test_network_advanced_server_ops.py
+++ b/tempest/scenario/test_network_advanced_server_ops.py
@@ -84,10 +84,11 @@
should_connect=should_connect,
servers_for_debug=[self.server])
floating_ip = self.floating_ip.floating_ip_address
+ # Check FloatingIP status before checking the connectivity
+ self.check_floating_ip_status(self.floating_ip, 'ACTIVE')
self.check_public_network_connectivity(floating_ip, username,
private_key, should_connect,
servers=[self.server])
- self.check_floating_ip_status(self.floating_ip, 'ACTIVE')
def _wait_server_status_and_check_network_connectivity(self):
self.servers_client.wait_for_server_status(self.server['id'], 'ACTIVE')
diff --git a/tempest/scenario/test_network_basic_ops.py b/tempest/scenario/test_network_basic_ops.py
index f29fecf..08746b8 100644
--- a/tempest/scenario/test_network_basic_ops.py
+++ b/tempest/scenario/test_network_basic_ops.py
@@ -190,12 +190,13 @@
if should_connect:
private_key = self._get_server_key(server)
floatingip_status = 'ACTIVE'
+ # Check FloatingIP Status before initiating a connection
+ if should_check_floating_ip_status:
+ self.check_floating_ip_status(floating_ip, floatingip_status)
# call the common method in the parent class
super(TestNetworkBasicOps, self).check_public_network_connectivity(
ip_address, ssh_login, private_key, should_connect, msg,
self.servers)
- if should_check_floating_ip_status:
- self.check_floating_ip_status(floating_ip, floatingip_status)
def _disassociate_floating_ips(self):
floating_ip, server = self.floating_ip_tuple