This allows standard exit codes for failed and skipped tests, and test
errors.
Skipped tests currently just succeed and a test error is the same as a
failure. These can be easily changed later when run_tests.sh is ready
to handle them.
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
PATH="${CTDB_SCRIPTS_TESTS_LIBEXEC_DIR}:${PATH}"
fi
+ctdb_test_error ()
+{
+ if [ $# -gt 0 ] ; then
+ echo "$*"
+ fi
+ exit 1
+}
+
+ctdb_test_fail ()
+{
+ if [ $# -gt 0 ] ; then
+ echo "$*"
+ fi
+ exit 1
+}
+
+ctdb_test_skip ()
+{
+ if [ $# -gt 0 ] ; then
+ echo "$*"
+ fi
+ exit 0
+}
+
# 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.