[autotest-client-tests][PATCH] UBUNTU: SAUCE: ubuntu_lxc: skip cgroupv2 incompatible tests

Po-Hsu Lin po-hsu.lin at canonical.com
Wed Feb 16 07:38:36 UTC 2022


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

The following tests should be skipped for Jammy because systemd is now
using a full cgroupv2 hierarchy on Jammy:
  * lxc-test-apparmor-mount
  * lxc-test-autostart
  * lxc-test-no-new-privs
  * lxc-test-unpriv

This has been fixed in the "exercise" test script of Jammy lxc package:
https://github.com/lxc/lxc-pkg-ubuntu/commit/a9b80060f910e133fe899bd89f

We need to take this back to our testing tool as we are not using
autopkgtest to run lxc tests since commit f914a916 "UBUNTU: SAUCE:
ubuntu_lxc: improve test granularity and idempotency"

Tested on a Jammy KVM instance and it works as expected.

Signed-off-by: Po-Hsu Lin <po-hsu.lin at canonical.com>
---
 ubuntu_lxc/control | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ubuntu_lxc/control b/ubuntu_lxc/control
index a7da40cc..44d924d9 100644
--- a/ubuntu_lxc/control
+++ b/ubuntu_lxc/control
@@ -51,6 +51,11 @@ if result == 'GOOD':
             elif test == 'lxc-test-state-server':
                 continue
 
+            # Skip some tests due to cgroup v2 incompatibility (lp:1960847)
+            if test in ['lxc-test-apparmor-mount', 'lxc-test-autostart', 'lxc-test-no-new-privs', 'lxc-test-unpriv']:
+                if os.path.isfile('/sys/fs/cgroup/system.slice/memory.current'):
+                    continue
+
             # Skip some tests on old kernels, this must be in another if statement as we have lxc-test-unpriv checked above
             if test in ['lxc-test-unpriv', 'lxc-test-usernic']:
                 if not os.path.isfile('/proc/self/uid_map') or not os.path.isfile('/etc/subuid') or not os.path.isfile('/etc/subgid'):
-- 
2.25.1




More information about the kernel-team mailing list