From: Martin Schwenke Date: Tue, 10 Dec 2019 01:03:10 +0000 (+1100) Subject: ctdb-tests: Fix getdbmap test so that it actually works sanely X-Git-Tag: ldb-2.1.1~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd279d3f98df58a3a8bdc84c34c2b14a650aa755;p=thirdparty%2Fsamba.git ctdb-tests: Fix getdbmap test so that it actually works sanely * Typo in variable name db_map_pattern * Variable num_db_init used before set * dbmap_pattern does not cover database flags Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Wed Feb 12 04:38:47 UTC 2020 on sn-devel-184 --- diff --git a/ctdb/tests/INTEGRATION/database/basics.001.attach.sh b/ctdb/tests/INTEGRATION/database/basics.001.attach.sh index 32d6d26a4ff..bcec20afc5e 100755 --- a/ctdb/tests/INTEGRATION/database/basics.001.attach.sh +++ b/ctdb/tests/INTEGRATION/database/basics.001.attach.sh @@ -40,12 +40,17 @@ make_temp_db_filename () try_command_on_node -v 0 "$CTDB getdbmap" -db_map_pattern='^(Number of databases:[[:digit:]]+|dbid:0x[[:xdigit:]]+ name:[^[:space:]]+ path:[^[:space:]]+)$' - -sanity_check_output $(($num_db_init + 1)) "$dbmap_pattern" +dbid='dbid:0x[[:xdigit:]]+' +name='name:[^[:space:]]+' +path='path:[^[:space:]]+' +opts='( (PERSISTENT|STICKY|READONLY|REPLICATED|UNHEALTHY))*' +line="${dbid} ${name} ${path}${opts}" +dbmap_pattern="^(Number of databases:[[:digit:]]+|${line})\$" num_db_init=$(sed -n -e '1s/.*://p' "$outfile") +sanity_check_output $(($num_db_init + 1)) "$dbmap_pattern" + for i in $(seq 1 5) ; do f=$(make_temp_db_filename) echo "Creating test database: $f"