]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: Skip lsns/ioctl_ns test if unshare fails
authorChris Hofstaedtler <zeha@debian.org>
Fri, 20 Aug 2021 10:30:50 +0000 (10:30 +0000)
committerKarel Zak <kzak@redhat.com>
Tue, 31 Aug 2021 13:18:34 +0000 (15:18 +0200)
Some parts of the Debian build infrastructure uses unshare to run the
package build, and that appears to cause a "nested" unshare in the
lsns/ioctl_ns test to fail. Unfortunately the tests then hang at this
point.

Try running unshare before the actual test, and skip the test if unshare
already fails.

[kzak@redhat.com: - add --fork to the test
                  - don't write to stdout/err]

Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/ts/lsns/ioctl_ns

index ef636060770315e46daf077ceb7d8a4f7fa8a7d3..fa626bfda1de447849e0df0b31903231bacd8bbb 100755 (executable)
@@ -34,6 +34,8 @@ ts_check_prog "mkfifo"
 ts_check_prog "touch"
 ts_check_prog "uniq"
 
+$TS_CMD_UNSHARE --user --pid --mount-proc --fork true &> /dev/null || ts_skip "no namespace support"
+
 ts_cd "$TS_OUTDIR"
 
 # The parent process receives namespaces ids via FIFO_DATA from bash