]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdb-tests: Add function ctdb_test_check_supported_OS
authorMartin Schwenke <martin@meltin.net>
Wed, 4 Mar 2020 03:05:02 +0000 (14:05 +1100)
committerAmitay Isaacs <amitay@samba.org>
Tue, 10 Mar 2020 07:37:34 +0000 (07:37 +0000)
Skips test if not on one of the supported OSes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/tests/scripts/common.sh

index 326f136d638b4af706675f0bd2c93a4f0386d53d..5bc5869802c3b166bfa3e370bce6995f1890c58e 100644 (file)
@@ -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.