Improve logging of vm's console output
specifically for test_subport_connectivity().
Change-Id: I35d4825a8296f5f86d109c6eba11de7d628bdcfe
Partial-Bug: #1897796
Related-Change: https://review.opendev.org/755122
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 78b766b..949a1a2 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -258,10 +258,12 @@
'server']['id'])['ports'][0]
self.fip = self.create_floatingip(port=self.port)
- def check_connectivity(self, host, ssh_user, ssh_key,
- servers=None, ssh_timeout=None):
- ssh_client = ssh.Client(host, ssh_user,
- pkey=ssh_key, timeout=ssh_timeout)
+ def check_connectivity(self, host, ssh_user=None, ssh_key=None,
+ servers=None, ssh_timeout=None, ssh_client=None):
+ # Either ssh_client or ssh_user+ssh_key is mandatory.
+ if ssh_client is None:
+ ssh_client = ssh.Client(host, ssh_user,
+ pkey=ssh_key, timeout=ssh_timeout)
try:
ssh_client.test_connection_auth()
except lib_exc.SSHTimeout as ssh_e:
diff --git a/neutron_tempest_plugin/scenario/test_trunk.py b/neutron_tempest_plugin/scenario/test_trunk.py
index 585af06..e4e6ca4 100644
--- a/neutron_tempest_plugin/scenario/test_trunk.py
+++ b/neutron_tempest_plugin/scenario/test_trunk.py
@@ -267,6 +267,9 @@
use_advanced_image=use_advanced_image)
for vm in [vm1, vm2]:
+ self.check_connectivity(
+ host=vm.floating_ip['floating_ip_address'],
+ ssh_client=vm.ssh_client)
self._configure_vlan_subport(vm=vm,
vlan_tag=vlan_tag,
vlan_subnet=vlan_subnet)