From cc11107fd26768fbe3b1cddbd9fa3ef239420045 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 27 May 2023 12:21:19 +0200 Subject: [PATCH] test-udev: Skip running in container Containers generally don't have permission to mknod() which is required by test-udev so let's skip the test as well if we detect we're running in a container. --- test/test-udev.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/test-udev.py b/test/test-udev.py index 7e9afc4fc8..710aaed3a9 100755 --- a/test/test-udev.py +++ b/test/test-udev.py @@ -2346,6 +2346,12 @@ def environment_issue(): check=False) if c.returncode == 0: return 'Running in a chroot, skipping the test' + + c = subprocess.run(['systemd-detect-virt', '-c', '-q'], + check=False) + if c.returncode == 0: + return 'Running in a container, skipping the test' + return None