From 2d6635540794deff16d048aa8b1d9d1def674d58 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Mon, 26 Aug 2024 12:47:24 -0400 Subject: [PATCH] refactor: don't require host= for check_connectivity When ssh_client is passed, the argument is not used. Change-Id: Ibf73130fbf82c2ed85e16b3f69aacbc2930efb3d --- neutron_tempest_plugin/scenario/base.py | 2 +- neutron_tempest_plugin/scenario/test_metadata.py | 3 +-- neutron_tempest_plugin/scenario/test_trunk.py | 1 - neutron_tempest_plugin/scenario/test_vlan_transparency.py | 4 +--- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py index 6149b061..70cb2dc9 100644 --- a/neutron_tempest_plugin/scenario/base.py +++ b/neutron_tempest_plugin/scenario/base.py @@ -337,7 +337,7 @@ class BaseTempestTestCase(base_api.BaseNetworkTest): if create_fip: self.fip = self.create_floatingip(port=self.port) - def check_connectivity(self, host, ssh_user=None, ssh_key=None, + def check_connectivity(self, host=None, 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: diff --git a/neutron_tempest_plugin/scenario/test_metadata.py b/neutron_tempest_plugin/scenario/test_metadata.py index 239f6bc8..e80e73b3 100644 --- a/neutron_tempest_plugin/scenario/test_metadata.py +++ b/neutron_tempest_plugin/scenario/test_metadata.py @@ -169,8 +169,7 @@ class MetadataTest(base.BaseTempestTestCase): self.network, use_advanced_image=use_advanced_image) self.wait_for_server_active(server=vm.server) self.wait_for_guest_os_ready(vm.server) - self.check_connectivity(host=vm.floating_ip['floating_ip_address'], - ssh_client=vm.ssh_client) + self.check_connectivity(ssh_client=vm.ssh_client) interface = self._get_primary_interface(vm.ssh_client) try: diff --git a/neutron_tempest_plugin/scenario/test_trunk.py b/neutron_tempest_plugin/scenario/test_trunk.py index 2ba8f13e..47b84157 100644 --- a/neutron_tempest_plugin/scenario/test_trunk.py +++ b/neutron_tempest_plugin/scenario/test_trunk.py @@ -193,7 +193,6 @@ class TrunkTest(base.BaseTempestTestCase): self._wait_for_port(port=vm.port) self._wait_for_port(port=vm.subport) self.check_connectivity( - host=vm.floating_ip['floating_ip_address'], ssh_client=vm.ssh_client, servers=[vm.server]) diff --git a/neutron_tempest_plugin/scenario/test_vlan_transparency.py b/neutron_tempest_plugin/scenario/test_vlan_transparency.py index d9a529c2..11f12e9d 100644 --- a/neutron_tempest_plugin/scenario/test_vlan_transparency.py +++ b/neutron_tempest_plugin/scenario/test_vlan_transparency.py @@ -138,9 +138,7 @@ class VlanTransparencyTest(base.BaseTempestTestCase): ssh_clients.append( self._create_ssh_client(floating_ip=floating_ips[i])) - self.check_connectivity( - host=floating_ips[i]['floating_ip_address'], - ssh_client=ssh_clients[i]) + self.check_connectivity(ssh_client=ssh_clients[i]) self._configure_vlan_transparent(port=self.vm_ports[-1], ssh_client=ssh_clients[i], vlan_tag=vlan_tag,