From: Karel Zak Date: Tue, 4 Mar 2025 18:07:43 +0000 (+0100) Subject: tests: check for ns-get*-ok X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f6135531ceb808e721f36937c0a11c865bb4bd8;p=thirdparty%2Futil-linux.git tests: check for ns-get*-ok Signed-off-by: Karel Zak --- diff --git a/tests/ts/lsns/filedesc b/tests/ts/lsns/filedesc index 1427dee0d..9a3642162 100755 --- a/tests/ts/lsns/filedesc +++ b/tests/ts/lsns/filedesc @@ -35,6 +35,10 @@ if [ "$($TS_HELPER_SYSINFO ns-gettype-ok)" == "0" ]; then ts_skip "NS_GET_NSTYPE ioctl cmd not available" fi +if [ "$($TS_HELPER_SYSINFO ns-getuserns-ok)" == "0" ]; then + ts_skip "NS_GET_USERNS ioctl cmd not available" +fi + FD=4 NS=LSNS-TEST-FILEDESC-NS FILE=/run/netns/$NS diff --git a/tests/ts/lsns/netns-from-sock b/tests/ts/lsns/netns-from-sock index c83841044..f4249a8a6 100755 --- a/tests/ts/lsns/netns-from-sock +++ b/tests/ts/lsns/netns-from-sock @@ -30,6 +30,9 @@ ts_check_test_command "$TS_HELPER_SYSINFO" ts_skip_nonroot +if [ "$($TS_HELPER_SYSINFO ns-gettype-ok)" == "0" ]; then + ts_skip "NS_GET_NSTYPE ioctl cmd not available" +fi if [ "$($TS_HELPER_SYSINFO ns-getuserns-ok)" == "0" ]; then ts_skip "NS_GET_USERNS ioctl cmd not available" fi diff --git a/tests/ts/lsns/nsfs b/tests/ts/lsns/nsfs index caa81dc10..e9c1910d7 100755 --- a/tests/ts/lsns/nsfs +++ b/tests/ts/lsns/nsfs @@ -35,6 +35,13 @@ ts_check_prog "sed" grep -q '#define HAVE_LINUX_NET_NAMESPACE_H' ${top_builddir}/config.h || ts_skip "no netns support" +if [ "$($TS_HELPER_SYSINFO ns-gettype-ok)" == "0" ]; then + ts_skip "NS_GET_NSTYPE ioctl cmd not available" +fi +if [ "$($TS_HELPER_SYSINFO ns-getuserns-ok)" == "0" ]; then + ts_skip "NS_GET_USERNS ioctl cmd not available" +fi + ts_cd "$TS_OUTDIR" NAME1=ABC