Create new server test_reboot_server_hard 67/70567/3
authorCédric Ollivier <cedric.ollivier@orange.com>
Mon, 20 Jul 2020 23:26:44 +0000 (01:26 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Tue, 21 Jul 2020 13:24:27 +0000 (15:24 +0200)
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: I8d03aa10c3d822dacb983e5ca019f79e1c582c9e
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/core/Create-new-server-test_reboot_server_hard.patch [new file with mode: 0644]
docker/core/Dockerfile

diff --git a/docker/core/Create-new-server-test_reboot_server_hard.patch b/docker/core/Create-new-server-test_reboot_server_hard.patch
new file mode 100644 (file)
index 0000000..b179a43
--- /dev/null
@@ -0,0 +1,53 @@
+From 6dd6d6e9428678724c6590bfa71d55898912dbe0 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 | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
+index d477be0eb..9b94a4ef1 100644
+--- a/tempest/api/compute/servers/test_server_actions.py
++++ b/tempest/api/compute/servers/test_server_actions.py
+@@ -113,8 +113,13 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
+         if CONF.validation.run_validation:
+             validation_resources = self.get_class_validation_resources(
+                 self.os_primary)
++            newserver = self.create_test_server(
++                validatable=True,
++                validation_resources=validation_resources,
++                wait_until='ACTIVE')
++            self.addCleanup(self.delete_server, newserver['id'])
+             # Get the time the server was last rebooted,
+-            server = self.client.show_server(self.server_id)['server']
++            server = self.client.show_server(newserver['id'])['server']
+             linux_client = remote_client.RemoteClient(
+                 self.get_server_ip(server, validation_resources),
+                 self.ssh_user,
+@@ -128,8 +133,8 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
+             # in a server
+             linux_client.exec_command("sync")
+-        self.client.reboot_server(self.server_id, type=reboot_type)
+-        waiters.wait_for_server_status(self.client, self.server_id, 'ACTIVE')
++        self.client.reboot_server(newserver['id'], type=reboot_type)
++        waiters.wait_for_server_status(self.client, newserver['id'], 'ACTIVE')
+         if CONF.validation.run_validation:
+             # Log in and verify the boot time has changed
+-- 
+2.27.0
+
index b42bbe2..2f94dfe 100644 (file)
@@ -4,6 +4,7 @@ ARG BRANCH=master
 ARG OPENSTACK_TAG=master
 
 COPY Switch-to-threading.Thread-for-Rally-tasks.patch /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch
+COPY Create-new-server-test_reboot_server_hard.patch /tmp/Create-new-server-test_reboot_server_hard.patch
 RUN apk --no-cache add --update \
         python3 py3-wheel libffi openssl libjpeg-turbo py3-pip bash \
         grep sed wget ca-certificates git openssh-client qemu-img iputils coreutils mailcap libstdc++ && \
@@ -29,8 +30,16 @@ RUN apk --no-cache add --update \
         -e /src/functest && \
     (cd /src/rally && patch -p1 < /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch) && \
     sed -i -E /#egg=rally/d /src/functest/upper-constraints.txt && \
+    sed -i -E /#egg=tempest/d /src/functest/upper-constraints.txt && \
+    (cd /src/tempest && \
+        git config --global user.email "opnfv-tech-discuss@lists.opnfv.org" && \
+        git config --global user.name "Functest" && \
+        patch -p1 < /tmp/Create-new-server-test_reboot_server_hard.patch && \
+        git commit -a -m "Backport critical bugfixes" && \
+        rm ~/.gitconfig) && \
     rm -r /src/requirements/.git /src/functest/.git \
-        /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch && \
+        /tmp/Switch-to-threading.Thread-for-Rally-tasks.patch \
+        /tmp/Create-new-server-test_reboot_server_hard.patch && \
     cp /src/functest/functest/ci/logging.ini /usr/lib/python3.8/site-packages/xtesting/ci/ && \
     cp /src/functest/functest/ci/logging.debug.ini /usr/lib/python3.8/site-packages/xtesting/ci/ && \
     bash -c "mkdir -p /var/lib/xtesting /home/opnfv" && \