aboutsummaryrefslogtreecommitdiffstats
path: root/docker/tempest/Create-new-server-test_reboot_server_hard.patch
blob: f0b1d0f6a41cdee733433c687d5f408044b428bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From ef7c7d80cb8f28743dbb4c10fbb4b0679f84426a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Ollivier?= <cedric.ollivier@orange.com>
Date: Tue, 21 Jul 2020 13:28:50 +0200
Subject: [PATCH] Create new server test_reboot_server_hard
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

It sometimes fail in all gates [1]
This hack could highlight if it's a timeout issue or race conditions
between all tempest tests.

[1] http://artifacts.opnfv.org/functest/E5AZMH89OOK6/functest-opnfv-functest-smoke-cntt-hunter-tempest_full_cntt-run-142/tempest_full_cntt/tempest-report.html

Change-Id: I203562f686b004094e5e18858004b7a2d26567a6
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
---
 tempest/api/compute/servers/test_server_actions.py | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index d477be0eb..c80c0ab05 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -46,6 +46,7 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
             # The server was deleted by previous test, create a new one
             # Use class level validation resources to avoid them being
             # deleted once a test is over
+            LOG.info("OPNFV The server was deleted by previous test")
             validation_resources = self.get_class_validation_resources(
                 self.os_primary)
             server = self.create_test_server(
@@ -55,6 +56,7 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
             self.__class__.server_id = server['id']
         except Exception:
             # Rebuild server if something happened to it during a test
+            LOG.info("OPNFV Rebuild server if something happened to it")
             self.__class__.server_id = self.recreate_server(
                 self.server_id, validatable=True)
 
@@ -115,6 +117,8 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
                 self.os_primary)
             # Get the time the server was last rebooted,
             server = self.client.show_server(self.server_id)['server']
+            LOG.info("OPNFV %s", self.client.get_console_output(
+                self.server_id)['output'])
             linux_client = remote_client.RemoteClient(
                 self.get_server_ip(server, validation_resources),
                 self.ssh_user,
@@ -122,7 +126,14 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
                 validation_resources['keypair']['private_key'],
                 server=server,
                 servers_client=self.client)
-            boot_time = linux_client.get_boot_time()
+            try:
+                boot_time = linux_client.get_boot_time()
+                LOG.info("OPNFV %s", self.client.get_console_output(
+                    self.server_id)['output'])
+            except Exception as e:
+                LOG.info("OPNFV %s", self.client.get_console_output(
+                    self.server_id)['output'])
+                raise e
 
             # NOTE: This sync is for avoiding the loss of pub key data
             # in a server
-- 
2.27.0