[ACT][PATCH] UBUNTU: SAUCE: ubuntu_sysdig_smoke_test/ubuntu_lttng_smoke_test: always try to install DKMS when test starts

Po-Hsu Lin po-hsu.lin at canonical.com
Wed Jun 9 08:29:53 UTC 2021


BugLink: https://bugs.launchpad.net/bugs/1931338

The DKMS package for these 2 tests will be removed with cleanup() in
the end of the test. This is for our manually provisioned system (bug
1798295), and it's also a good practice to keep the system clean after
the test.

However, since we only run setup() once if the test version is not
bumped, when you try to restart these tests on the same system without
removing autotest/client/tmp/<test suite> directory, they will fail
due to the lack of corresponding modules.

Solution for this is to move code in setup() into initialize(), which
is guaranteed to be executed on every run.

This is the workflow for a test:
1. initialize()
2. setup()
3. run_once()
4. cleanup()

With a second run immediately after the first one:
5. initialize()
6. run_once()
7. cleanup()

Code tested on an Azure instance and a bare-metal node.

Signed-off-by: Po-Hsu Lin <po-hsu.lin at canonical.com>
---
 ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py   | 3 ---
 ubuntu_sysdig_smoke_test/ubuntu_sysdig_smoke_test.py | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py b/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py
index 434a5ac2..2779dcbf 100755
--- a/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py
+++ b/ubuntu_lttng_smoke_test/ubuntu_lttng_smoke_test.py
@@ -30,9 +30,6 @@ class ubuntu_lttng_smoke_test(test.test):
         self.results = utils.system_output(cmd, retain_output=True, ignore_status=True)
 
     def initialize(self):
-        pass
-
-    def setup(self):
         # Special case for Azure nodes lp: 1791032
         # Some nodes with small ram will need the swap to build lttng dkms
         if platform.uname()[2].split('-')[-1] == 'azure':
diff --git a/ubuntu_sysdig_smoke_test/ubuntu_sysdig_smoke_test.py b/ubuntu_sysdig_smoke_test/ubuntu_sysdig_smoke_test.py
index c844b852..d2dc3751 100755
--- a/ubuntu_sysdig_smoke_test/ubuntu_sysdig_smoke_test.py
+++ b/ubuntu_sysdig_smoke_test/ubuntu_sysdig_smoke_test.py
@@ -15,9 +15,6 @@ class ubuntu_sysdig_smoke_test(test.test):
         self.results = utils.system_output(cmd, retain_output=True, ignore_status=True)
 
     def initialize(self):
-        pass
-
-    def setup(self):
         self.install_required_pkgs()
         cmd = 'dkms status -m sysdig | grep installed'
         try:
-- 
2.25.1




More information about the kernel-team mailing list