diff options
author | Martin Schwenke <martin@meltin.net> | 2012-05-10 16:17:44 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2012-05-11 10:33:27 +1000 |
commit | 99ed2d11e130a2fc644d16c4fcdfcc876d8c8b2a (patch) | |
tree | b12acea7d34aff5fba5b9ce5a773f401e5a6caf6 /ctdb/tests/run_cluster_tests.sh | |
parent | af2ab74beb5da03e84e760ac92d45c9453a5e75d (diff) | |
download | samba-99ed2d11e130a2fc644d16c4fcdfcc876d8c8b2a.tar.gz samba-99ed2d11e130a2fc644d16c4fcdfcc876d8c8b2a.tar.xz samba-99ed2d11e130a2fc644d16c4fcdfcc876d8c8b2a.zip |
tests: Allow run_cluster_tests.sh to take options
However, options must be followed by "--".
This also fixes:
* a bug where specifying tests caused local daemons to be used; and
* an incorrect comment.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit 6b8507d4d3062e709409b3790117d87311b3460d)
Diffstat (limited to 'ctdb/tests/run_cluster_tests.sh')
-rwxr-xr-x | ctdb/tests/run_cluster_tests.sh | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/ctdb/tests/run_cluster_tests.sh b/ctdb/tests/run_cluster_tests.sh index fa45534b0c..9cafd50b13 100755 --- a/ctdb/tests/run_cluster_tests.sh +++ b/ctdb/tests/run_cluster_tests.sh @@ -2,16 +2,29 @@ test_dir=$(dirname "$0") +# Allow options to be passed to this script. However, if any options +# are passed there must be a "--" between the options and the tests. +# This makes it easy to handle options that take arguments. +opts="" +case "$1" in + -*) + while [ -n "$1" ] ; do + case "$1" in + --) shift ; break ;; + *) opts="$opts $1" ; shift ;; + esac + done +esac + if [ -n "$1" ] ; then - "${test_dir}/scripts/run_tests" -l -s "$@" || exit 1 + "${test_dir}/scripts/run_tests" -s $opts "$@" || exit 1 else cd "$test_dir" - # By default, run all unit tests and the tests against local - # daemons + # By default, don't bother with unit tests dirs="simple complex" - ./scripts/run_tests -s $dirs || exit 1 + ./scripts/run_tests -s $opts $dirs || exit 1 fi echo "All OK" |