Fallback to SSH if ping fails
While trying to work out a test case and using the tempest
plugin to exercise a centos VM, I noticed it didn't ping,
when I had previously done other work to the VM. It has
SSH'ed, it might have failed, but try to SSH in case ping
fails.
Change-Id: I4e125529de4ff96c42194f91b18281a642a30018
diff --git a/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py b/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py
index 010c220..2a36c6a 100644
--- a/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py
+++ b/ironic_tempest_plugin/tests/scenario/test_baremetal_basic_ops.py
@@ -240,8 +240,16 @@
# Reboot node
self.reboot_node(self.instance)
- # ensure we can ping the node again
- self.assertTrue(self.ping_ip_address(ip_address))
+ # Ensure we have some sort of connectivity
+ # Attempt to ping, if all else fails fall back to an ssh connection
+ # which worked previously.
+ pinging = self.ping_ip_address(ip_address)
+ if not pinging:
+ self.get_remote_client(ip_address, server=self.instance)
+ else:
+ # If we're here, this is successful. If ssh fails above,
+ # the job will ultimately fail.
+ self.assertTrue(pinging)
self.terminate_instance(self.instance)