summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-23 23:15:44 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-24 15:51:35 +0200
commit2a9184b90283f8d63bc50ed1100e11ad94bbc47d (patch)
tree1e7cf8255e541b305c3fa2c8df2c0971e0509bc5 /test
parentMerge pull request #32449 from DaanDeMeyer/mkosi (diff)
downloadsystemd-2a9184b90283f8d63bc50ed1100e11ad94bbc47d.tar.xz
systemd-2a9184b90283f8d63bc50ed1100e11ad94bbc47d.zip
TEST-50-DISSECT: Skip mountfsd test if the user namespace interface is not supported
Diffstat (limited to 'test')
-rwxr-xr-xtest/units/testsuite-50.mountnfsd.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/units/testsuite-50.mountnfsd.sh b/test/units/testsuite-50.mountnfsd.sh
index d6b5fafeab..fea6b7d50b 100755
--- a/test/units/testsuite-50.mountnfsd.sh
+++ b/test/units/testsuite-50.mountnfsd.sh
@@ -49,6 +49,15 @@ systemd-dissect --image-policy='root=unprotected:=absent+unused' --mtree /var/tm
(! runas testuser systemd-dissect /var/tmp/unpriv.raw)
(! runas testuser systemd-dissect --mtree /var/tmp/unpriv.raw)
+if (SYSTEMD_LOG_TARGET=console varlinkctl call \
+ /run/systemd/userdb/io.systemd.NamespaceResource \
+ io.systemd.NamespaceResource.AllocateUserRange \
+ '{"name":"test-supported","size":65536,"userNamespaceFileDescriptor":0}' 2>&1 || true) |
+ grep -q "io.systemd.NamespaceResource.UserNamespaceInterfaceNotSupported"; then
+ echo "User namespace interface not supported, skipping mountnfsd/nsresourced tests"
+ exit 0
+fi
+
# Install key in keychain
cp /tmp/test-50-unpriv-cert.crt /run/verity.d