]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add ts_is_in_docker as a helper function
authorMasatake YAMATO <yamato@redhat.com>
Tue, 11 Mar 2025 16:32:34 +0000 (01:32 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Fri, 14 Mar 2025 14:26:23 +0000 (23:26 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
tests/functions.sh

index d6bc84cbb80e6d6814ff65201598c26a46c4d2fc..4e163692789dfb9d891fcedc415ea395b698dd18 100644 (file)
@@ -1218,8 +1218,12 @@ function ts_check_enosys_syscalls {
        [ $? -ne 0 ] && ts_skip "test_enosys does not work: $*"
 }
 
+function ts_is_in_docker {
+       test -e /.dockerenv
+}
+
 function ts_skip_docker {
-       test -e /.dockerenv && ts_skip "unsupported in docker environment"
+       ts_is_in_docker && ts_skip "unsupported in docker environment"
 }
 
 function ts_check_ipv6 {