lxc fails autopkgtests on (pure) cgroups v2 enabled system
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
lxc fails 4 autopkgtests if ran on a cgroups v2 enabled systemd (248.3-1ubuntu7) using a pure unified hierarchy (in favor of the hybrid hierarchy used before).
https:/
FAIL: lxc-tests: lxc-test-
FAIL: lxc-tests: lxc-test-autostart (360s)
FAIL: lxc-tests: lxc-test-
FAIL: lxc-tests: lxc-test-unpriv (0s)
I needed to skip the "lxc-test-
diff --git a/debian/
index 4a22f33..70231ee 100755
--- a/debian/
+++ b/debian/
@@ -88,6 +88,10 @@ for testbin in lxc-test-*; do
echo "${testbin}" | grep -qv "\.in$" || continue
STRING=
+ # Skip some tests because for testing
+ [ "$testbin" = "lxc-test-
+ ignore "$STRING" && continue
+
# Some tests can't be run standalone
[ "$testbin" = "lxc-test-
Reproducer (while being connected to the Canonical VPN, or setup another squid proxy):
$ autopkgtest-
$ autopkgtest lxc -s -U --apt-pocket=
I used "../lxc_
Interestingly, the same set of tests fails if I run the test using the old (non cgroups v2) systemd (248.3-1ubuntu3), i.e. by leaving out the "--apt-
Logs (full logs attached):
FAIL: lxc-tests: lxc-test-
---
/usr/sbin/deluser: The user `lxcunpriv' does not exist.
./lxc-test-
lxc-destroy: tmp.6hX6BylHCU: tools/lxc_
umount: /sys/kernel/
sed: can't read /run/lxc/nics: No such file or directory
---
=> "./lxc-
=> fails in a different way with old (non cgroup v2) systemd, locally
FAIL: lxc-tests: lxc-test-autostart (21s)
---
Setting up the GPG keyring
Downloading the image index
ERROR: Failed to download http://
lxc-create: lxc-test-auto: lxccontainer.c: create_
lxc-create: lxc-test-auto: tools/lxc_create.c: main: 319 Failed to create container lxc-test-auto
FAIL
---
=> fails in the same way with old (non cgroup v2) systemd, locally.
FAIL: lxc-tests: lxc-test-
---
+ DONE=0
+ trap cleanup EXIT SIGHUP SIGINT SIGTERM
+ '[' '!' -d /etc/lxc ']'
+ ARCH=i386
+ type dpkg
++ dpkg --print-
+ ARCH=amd64
+ lxc-create -t download -n c1 -- -d ubuntu -r xenial -a amd64
Setting up the GPG keyring
Downloading the image index
ERROR: Failed to download http://
lxc-create: c1: lxccontainer.c: create_
lxc-create: c1: tools/lxc_create.c: main: 319 Failed to create container c1
+ cleanup
+ cd /
+ lxc-destroy -n c1 -f
lxc-destroy: c1: tools/lxc_
+ true
+ '[' 0 -eq 0 ']'
+ echo FAIL
FAIL
+ exit 1
---
=> fails in the same way with old (non cgroup v2) systemd, locally.
FAIL: lxc-tests: lxc-test-unpriv (0s)
---
./lxc-test-unpriv: line 163: /sys/fs/
cat: /tmp/tmp.
---
=> "./lxc-test-unpriv: line 163: /sys/fs/
=> fails in a different way with old (non cgroup v2) systemd, locally.
From a side-channel discussion:
<cbrauner> all the fully unprivileged tests need to be disabled on cgroup v2. You can't run fully unprivileged containers on pure cgroup2 layouts. The delegation model doesn't allow it. Not without systemd making a fully empty delegated cgroup hierarchy available.
<stgraber> I think I'd prefer if those tests could figure out they're running on a cgroup2 systemd system and then do the systemd-run wrapper around lxc-start (or whatever it is) as that's realistically what users of unpriv LXC would do. Something along those lines: `systemd-run --unit=myshell --user --scope -p "Delegate=yes" lxc-start`