ctdb-tests: Add -l option to set number of local daemons
authorMartin Schwenke <martin@meltin.net>
Thu, 17 Oct 2019 05:42:36 +0000 (16:42 +1100)
committerRalph Boehme <slow@samba.org>
Tue, 22 Oct 2019 21:02:11 +0000 (21:02 +0000)
This is the only place where setting an environment variable by hand
is recommended, so remove the anomaly.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 22 21:02:11 UTC 2019 on sn-devel-184

ctdb/tests/README
ctdb/tests/run_tests.sh

index 4d977f761a463ea0a5cb499ef2a834979ac717a1..eaca954b758d570cceec07ea61a39e17de245eca 100644 (file)
@@ -23,8 +23,6 @@ By default:
 
 * INTEGRATION tests are run against 3 local daemons
 
-  Set CTDB_TEST_LOCAL_DAEMONS to a different number if desired
-
 * When testing is complete, a summary showing a list is printed
   showing the tests run and their results
 
index 5011a73d82cae17284f566f3d26ac644b73b0e0f..d7c33f1865adf0a7220f8f1bfe5294a57ce619f9 100755 (executable)
@@ -12,6 +12,7 @@ Options:
   -e           Exit on the first test failure
   -H           No headers - for running single test with other wrapper
   -I <count>    Iterate tests <count> times, exiting on failure (implies -e, -N)
+  -l <count>    Use <count> daemons for local daemon integration tests
   -L            Print daemon logs on test failure (only some tests)
   -N           Don't print summary of tests results after running all tests
   -q           Quiet - don't show tests being run (still displays summary)
@@ -46,11 +47,10 @@ export CTDB_TEST_COMMAND_TRACE=false
 export CTDB_TEST_CAT_RESULTS_OPTS=""
 export CTDB_TEST_DIFF_RESULTS=false
 export CTDB_TEST_PRINT_LOGS_ON_ERROR=false
-export CTDB_TEST_LOCAL_DAEMONS
-[ -n "$CTDB_TEST_LOCAL_DAEMONS" ] || CTDB_TEST_LOCAL_DAEMONS=3
+export CTDB_TEST_LOCAL_DAEMONS=3
 export CTDB_TEST_SWRAP_SO_PATH=""
 
-while getopts "AcCDehHI:LNqS:T:vV:xX?" opt ; do
+while getopts "AcCDehHI:l:LNqS:T:vV:xX?" opt ; do
        case "$opt" in
        A) CTDB_TEST_CAT_RESULTS_OPTS="-A" ;;
        c) CTDB_TEST_LOCAL_DAEMONS="" ;;
@@ -59,6 +59,7 @@ while getopts "AcCDehHI:LNqS:T:vV:xX?" opt ; do
        e) exit_on_fail=true ;;
        H) no_header=true ;;
        I) max_iterations="$OPTARG" ; exit_on_fail=true ; with_summary=false ;;
+       l) CTDB_TEST_LOCAL_DAEMONS="$OPTARG" ;;
        L) CTDB_TEST_PRINT_LOGS_ON_ERROR=true ;;
        N) with_summary=false ;;
        q) quiet=true ;;