[ACT][PATCH] UBUNTU: SAUCE: ubuntu_lxc: destroy leftover container before tests

Kleber Sacilotto de Souza kleber.souza at canonical.com
Mon Jul 12 10:59:36 UTC 2021

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

Commits 1a50e77ca803 ("UBUNTU: SAUCE: ubuntu_lxc: remove the reboot
container after test") and 298cd01e ("UBUNTU: SAUCE: ubuntu_lxc: destroy
the leftover container before exit") fixed the issue with the leftover
"reboot" contained on the 'exercise' script. However, this script is run
only for series older than artful. For newer series, the testcase is run
from the source package via 'autopkgtest'. Fix it by destroying the
container before running any test.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza at canonical.com>
 ubuntu_lxc/ubuntu_lxc.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/ubuntu_lxc/ubuntu_lxc.py b/ubuntu_lxc/ubuntu_lxc.py
index e201b0d4..cc8466ba 100644
--- a/ubuntu_lxc/ubuntu_lxc.py
+++ b/ubuntu_lxc/ubuntu_lxc.py
@@ -44,6 +44,12 @@ class ubuntu_lxc(test.test):
     def run_once(self, test_name):
         if test_name == 'setup':
+        # Destroy the "reboot" container which might have been left
+        # behind (LP#1788574)
+        cmd = 'lxc-destroy reboot'
+        utils.system(cmd, ignore_status=True)
         if self.series in ['precise', 'trusty', 'xenial', 'artful']:
             cmd = '/bin/sh %s/exercise' % self.bindir

More information about the kernel-team mailing list