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<svyas@redhat.com>

Change-Id: I78076ebb0fc955662b5ee3f67938f9fc939882d3
This commit is contained in:
Soniya Vyas 2021-01-29 17:28:19 +05:30
parent ccf56b5ca2
commit 1b0cddc90d
4 changed files with 15 additions and 7 deletions

View File

@ -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.

View File

@ -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,

View File

@ -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' %

View File

@ -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):