Merge "Copy cluster nodes logs always whether tests pass or fail"
This commit is contained in:
commit
ffee7964e7
@ -107,7 +107,7 @@ class BayTest(base.BaseTempestTest):
|
|||||||
self.bays.append(model.uuid)
|
self.bays.append(model.uuid)
|
||||||
self.bay_uuid = model.uuid
|
self.bay_uuid = model.uuid
|
||||||
if config.Config.copy_logs:
|
if config.Config.copy_logs:
|
||||||
self.addOnException(self.copy_logs_handler(
|
self.addCleanup(self.copy_logs_handler(
|
||||||
lambda: list(
|
lambda: list(
|
||||||
[self._get_bay_by_id(self.bay_uuid)[1].master_addresses,
|
[self._get_bay_by_id(self.bay_uuid)[1].master_addresses,
|
||||||
self._get_bay_by_id(self.bay_uuid)[1].node_addresses]),
|
self._get_bay_by_id(self.bay_uuid)[1].node_addresses]),
|
||||||
|
@ -107,7 +107,7 @@ class ClusterTest(base.BaseTempestTest):
|
|||||||
self.clusters.append(model.uuid)
|
self.clusters.append(model.uuid)
|
||||||
self.cluster_uuid = model.uuid
|
self.cluster_uuid = model.uuid
|
||||||
if config.Config.copy_logs:
|
if config.Config.copy_logs:
|
||||||
self.addOnException(self.copy_logs_handler(
|
self.addCleanup(self.copy_logs_handler(
|
||||||
lambda: list(
|
lambda: list(
|
||||||
[self._get_cluster_by_id(model.uuid)[1].master_addresses,
|
[self._get_cluster_by_id(model.uuid)[1].master_addresses,
|
||||||
self._get_cluster_by_id(model.uuid)[1].node_addresses]),
|
self._get_cluster_by_id(model.uuid)[1].node_addresses]),
|
||||||
|
@ -42,11 +42,10 @@ class BaseMagnumTest(base.BaseTestCase):
|
|||||||
[[master_nodes], [slave_nodes]].
|
[[master_nodes], [slave_nodes]].
|
||||||
:param coe: the COE type of the nodes
|
:param coe: the COE type of the nodes
|
||||||
"""
|
"""
|
||||||
def int_copy_logs(exec_info):
|
def int_copy_logs():
|
||||||
try:
|
try:
|
||||||
cls.LOG.info("Copying logs...")
|
cls.LOG.info("Copying logs...")
|
||||||
fn = exec_info[2].tb_frame.f_locals['fn']
|
func_name = "test"
|
||||||
func_name = fn.im_self._get_test_method().__name__
|
|
||||||
msg = ("Failed to copy logs for cluster")
|
msg = ("Failed to copy logs for cluster")
|
||||||
nodes_addresses = get_nodes_fn()
|
nodes_addresses = get_nodes_fn()
|
||||||
|
|
||||||
|
@ -265,12 +265,22 @@ extendedKeyUsage = clientAuth
|
|||||||
if not cls.cluster_template_kwargs.get('tls_disabled', False):
|
if not cls.cluster_template_kwargs.get('tls_disabled', False):
|
||||||
# NOTE (wangbo) with multiple mangum-conductor processes, client
|
# NOTE (wangbo) with multiple mangum-conductor processes, client
|
||||||
# ca files should be created after completion of cluster ca_cert
|
# ca files should be created after completion of cluster ca_cert
|
||||||
cls._wait_on_status(
|
try:
|
||||||
cls.cluster,
|
cls._wait_on_status(
|
||||||
[None, "CREATE_IN_PROGRESS"],
|
cls.cluster,
|
||||||
["CREATE_FAILED", "CREATE_COMPLETE"],
|
[None, "CREATE_IN_PROGRESS"],
|
||||||
timeout=cls.cluster_complete_timeout
|
["CREATE_FAILED", "CREATE_COMPLETE"],
|
||||||
)
|
timeout=cls.cluster_complete_timeout
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
# copy logs if setUpClass fails, may be this will not work
|
||||||
|
# as master_address, node_address would not be available, if
|
||||||
|
# not we can get that from nova
|
||||||
|
if cls.copy_logs:
|
||||||
|
cls.copy_logs_handler(
|
||||||
|
cls._get_nodes,
|
||||||
|
cls.cluster_template.coe,
|
||||||
|
'default')
|
||||||
cls._create_tls_ca_files(cls.config_contents)
|
cls._create_tls_ca_files(cls.config_contents)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -297,8 +307,9 @@ extendedKeyUsage = clientAuth
|
|||||||
|
|
||||||
self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
|
self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
|
||||||
|
|
||||||
|
# Copy cluster nodes logs
|
||||||
if self.copy_logs:
|
if self.copy_logs:
|
||||||
self.addOnException(
|
self.addCleanup(
|
||||||
self.copy_logs_handler(
|
self.copy_logs_handler(
|
||||||
self._get_nodes,
|
self._get_nodes,
|
||||||
self.cluster_template.coe,
|
self.cluster_template.coe,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user