]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: fix lsns test on kernels without USER namespaces
authorAnatoly Pugachev <matorola@gmail.com>
Fri, 18 Jun 2021 12:45:31 +0000 (14:45 +0200)
committerKarel Zak <kzak@redhat.com>
Fri, 18 Jun 2021 12:45:31 +0000 (14:45 +0200)
Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/lsns/ioctl_ns

index e91f6743f50966e3252e61b602d8385203bab5ee..ef636060770315e46daf077ceb7d8a4f7fa8a7d3 100755 (executable)
@@ -24,6 +24,9 @@ ts_init "$*"
 # ts_skip_nonroot
 grep -q '#define HAVE_LINUX_NSFS_H' ${top_builddir}/config.h || ts_skip "no ioctl_ns support"
 
+[ -r /proc/self/ns/user ] || ts_skip "no USER namespace kernel support"
+[ -r /proc/self/ns/pid ] || ts_skip "no PID namespace kernel support"
+
 ts_check_test_command "$TS_CMD_LSNS"
 ts_check_test_command "$TS_CMD_UNSHARE"
 ts_check_prog "stat"