1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-12 08:58:20 +03:00

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.
This commit is contained in:
Daan De Meyer 2023-05-27 12:21:19 +02:00
parent 5dcb40a1b0
commit cc11107fd2

View File

@ -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