From: Daan De Meyer Date: Tue, 23 Apr 2024 21:15:44 +0000 (+0200) Subject: TEST-50-DISSECT: Skip mountfsd test if the user namespace interface is not supported X-Git-Tag: v256-rc1~23^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a9184b90283f8d63bc50ed1100e11ad94bbc47d;p=thirdparty%2Fsystemd.git TEST-50-DISSECT: Skip mountfsd test if the user namespace interface is not supported --- diff --git a/test/units/testsuite-50.mountnfsd.sh b/test/units/testsuite-50.mountnfsd.sh index d6b5fafeabe..fea6b7d50b7 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