From 1b0cddc90df0d0736e1d7ae63feef3b801ffdbe1 Mon Sep 17 00:00:00 2001 From: Soniya Vyas Date: Fri, 29 Jan 2021 17:28:19 +0530 Subject: [PATCH] Make _log_console_output non-private _log_console_output is made public by this commit as the tempest.scenario.manager interface is meant to be consumed by tempest plugins. Implements: blueprint tempest-scenario-manager-stable Signed-off by: Soniya Vyas Change-Id: I78076ebb0fc955662b5ee3f67938f9fc939882d3 --- .../notes/log_console_output-dae6b8740b5a5821.yaml | 8 ++++++++ tempest/scenario/manager.py | 8 ++++---- tempest/scenario/test_network_v6.py | 2 +- tempest/scenario/test_security_groups_basic_ops.py | 4 ++-- 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/log_console_output-dae6b8740b5a5821.yaml diff --git a/releasenotes/notes/log_console_output-dae6b8740b5a5821.yaml b/releasenotes/notes/log_console_output-dae6b8740b5a5821.yaml new file mode 100644 index 0000000000..2779b266d8 --- /dev/null +++ b/releasenotes/notes/log_console_output-dae6b8740b5a5821.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Added public interface log_console_output(). + It used to be a private method with name _log_console_output(). + Since this interface is meant to be used by tempest plugins, + It doesn't neccessarily require to be private api. + diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index acc563acb7..8866a22903 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -660,7 +660,7 @@ class ScenarioTest(tempest.test.BaseTestCase): LOG.debug("image:%s", image['id']) return image['id'] - def _log_console_output(self, servers=None, client=None, **kwargs): + def log_console_output(self, servers=None, client=None, **kwargs): """Console log output""" if not CONF.compute_feature_enabled.console_output: LOG.debug('Console output not supported, cannot log') @@ -796,7 +796,7 @@ class ScenarioTest(tempest.test.BaseTestCase): 'result': 'expected' if result else 'unexpected' }) if server: - self._log_console_output([server]) + self.log_console_output([server]) return result def check_vm_connectivity(self, ip_address, @@ -1285,7 +1285,7 @@ class NetworkScenarioTest(ScenarioTest): should_connect=should_connect) except Exception as e: LOG.exception('Tenant network connectivity check failed') - self._log_console_output(servers_for_debug) + self.log_console_output(servers_for_debug) self._log_net_info(e) raise @@ -1328,7 +1328,7 @@ class NetworkScenarioTest(ScenarioTest): % (dest, source_host) else: msg = "%s is reachable from %s" % (dest, source_host) - self._log_console_output() + self.log_console_output() self.fail(msg) def _create_security_group(self, security_group_rules_client=None, diff --git a/tempest/scenario/test_network_v6.py b/tempest/scenario/test_network_v6.py index 14f24c79e1..9be28c4faa 100644 --- a/tempest/scenario/test_network_v6.py +++ b/tempest/scenario/test_network_v6.py @@ -218,7 +218,7 @@ class TestGettingAddress(manager.NetworkScenarioTest): guest_has_address, CONF.validation.ping_timeout, 1, ssh, ip) if not result: - self._log_console_output(servers=[srv]) + self.log_console_output(servers=[srv]) self.fail( 'Address %s not configured for instance %s, ' 'ip address output is\n%s' % diff --git a/tempest/scenario/test_security_groups_basic_ops.py b/tempest/scenario/test_security_groups_basic_ops.py index 3fc93e4aa4..03a4a397ec 100644 --- a/tempest/scenario/test_security_groups_basic_ops.py +++ b/tempest/scenario/test_security_groups_basic_ops.py @@ -464,9 +464,9 @@ class TestSecurityGroupsBasicOps(manager.NetworkScenarioTest): def _log_console_output_for_all_tenants(self): for tenant in self.tenants.values(): client = tenant.manager.servers_client - self._log_console_output(servers=tenant.servers, client=client) + self.log_console_output(servers=tenant.servers, client=client) if tenant.access_point is not None: - self._log_console_output( + self.log_console_output( servers=[tenant.access_point], client=client) def _create_protocol_ruleset(self, protocol, port=80):