From: Masatake YAMATO Date: Tue, 11 Mar 2025 16:32:34 +0000 (+0900) Subject: tests: add ts_is_in_docker as a helper function X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6240c763fbff861330e08a43105ddb57879d9bb0;p=thirdparty%2Futil-linux.git tests: add ts_is_in_docker as a helper function Signed-off-by: Masatake YAMATO --- diff --git a/tests/functions.sh b/tests/functions.sh index d6bc84cbb..4e1636927 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -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 {