1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

tests: New run_tests -C (cleanup) option

Sets TEST_CLEANUP=true and causes $TEST_VAR_DIR to be removed... and
potentially other cleanup actions in testcases.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3219f221a858e499f084b8beb44610537312602b)
This commit is contained in:
Martin Schwenke 2012-04-24 14:39:24 +10:00
parent e0f4f2c501
commit 70270b6815

View File

@ -9,6 +9,7 @@ Options:
-l Use local daemons for integration tests
-e Exit on the first test failure
-V <dir> Use <dir> as $TEST_VAR_DIR
-C Clean up - kill daemons and remove $TEST_VAR_DIR when done
-v Verbose - print test output for non-failures (only some tests)
-A Use "cat -A" to print test output (only some tests)
-D Show diff between failed/expected test output (some tests only)
@ -41,8 +42,9 @@ export TEST_CAT_RESULTS_OPTS=""
export TEST_DIFF_RESULTS=false
export TEST_LOCAL_DAEMONS # No default, developer can "override"!
export TEST_VAR_DIR=""
export TEST_CLEANUP=false
temp=$(getopt -n "$prog" -o "xdehlqsvV:XADH" -l help -- "$@")
temp=$(getopt -n "$prog" -o "xdehlqsvV:XACDH" -l help -- "$@")
[ $? != 0 ] && usage
@ -60,6 +62,7 @@ while true ; do
-V) TEST_VAR_DIR="$2" ; shift 2 ;;
-X) TEST_COMMAND_TRACE=true ; shift ;;
-A) TEST_CAT_RESULTS_OPTS="-A" ; shift ;;
-C) TEST_CLEANUP=true ; shift ;;
-D) TEST_DIFF_RESULTS=true ; shift ;;
-H) no_header=true ; shift ;;
--) shift ; break ;;
@ -207,6 +210,14 @@ fi
rm -f "$sf"
echo
if $TEST_CLEANUP ; then
echo "Removing TEST_VAR_DIR=$TEST_VAR_DIR"
rm -rf "$TEST_VAR_DIR"
else
echo "Not cleaning up TEST_VAR_DIR=$TEST_VAR_DIR"
fi
if [ $tests_failed -gt 0 ] ; then
if $no_header ; then
exit $status