From: Martin Schwenke Date: Wed, 4 Mar 2020 03:05:02 +0000 (+1100) Subject: ctdb-tests: Add function ctdb_test_check_supported_OS X-Git-Tag: ldb-2.2.0~1467 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5dd476715640d532c37ad5b5a9065b70eadeea8;p=thirdparty%2Fsamba.git ctdb-tests: Add function ctdb_test_check_supported_OS Skips test if not on one of the supported OSes. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh index 326f136d638..5bc5869802c 100644 --- a/ctdb/tests/scripts/common.sh +++ b/ctdb/tests/scripts/common.sh @@ -47,6 +47,19 @@ ctdb_test_skip () exit 77 } +# "$@" is supported OSes +ctdb_test_check_supported_OS () +{ + _os=$(uname -s) + for _i ; do + if [ "$_os" = "$_i" ] ; then + return + fi + done + + ctdb_test_skip "This test is not supported on ${_os}" +} + # Wait until either timeout expires or command succeeds. The command # will be tried once per second, unless timeout has format T/I, where # I is the recheck interval.