summaryrefslogtreecommitdiffstats
path: root/test/test-udev.py
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-05-27 12:21:19 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2023-05-30 14:48:38 +0200
commitcc11107fd26768fbe3b1cddbd9fa3ef239420045 (patch)
treefd43d4181e266eeda3b9a43f9795689e24db8094 /test/test-udev.py
parentoom: Make sure temporary test file is in /tmp (diff)
downloadsystemd-cc11107fd26768fbe3b1cddbd9fa3ef239420045.tar.xz
systemd-cc11107fd26768fbe3b1cddbd9fa3ef239420045.zip
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.
Diffstat (limited to 'test/test-udev.py')
-rwxr-xr-xtest/test-udev.py6
1 files changed, 6 insertions, 0 deletions
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