From: Martin Schwenke Date: Mon, 12 Feb 2018 04:41:27 +0000 (+1100) Subject: ctdb-tests: Clean up fake share handling X-Git-Tag: talloc-2.1.13~187 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1d7d4874df634e664a2331adabd4e437c8b3d95a;p=thirdparty%2Fsamba.git ctdb-tests: Clean up fake share handling Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/eventscripts/50.samba.monitor.105.sh b/ctdb/tests/eventscripts/50.samba.monitor.105.sh index 9936eff8064..c6e7dcc8d28 100755 --- a/ctdb/tests/eventscripts/50.samba.monitor.105.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.105.sh @@ -5,8 +5,8 @@ define_test "non-existent share path" setup_samba -shares_missing "ERROR: samba directory \"%s\" not available" 2 -required_result 1 "$MISSING_SHARES_TEXT" +out=$(shares_missing "ERROR: samba directory \"%s\" not available" 2) +required_result 1 "$out" simple_test diff --git a/ctdb/tests/eventscripts/50.samba.monitor.106.sh b/ctdb/tests/eventscripts/50.samba.monitor.106.sh index 8fabfb33b6d..6090961e556 100755 --- a/ctdb/tests/eventscripts/50.samba.monitor.106.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.106.sh @@ -5,7 +5,6 @@ define_test "non-existent share - not checked" setup_samba -shares_missing "ERROR: samba directory \"%s\" not available" 2 export CTDB_SAMBA_SKIP_SHARE_CHECK="yes" diff --git a/ctdb/tests/eventscripts/50.samba.monitor.110.sh b/ctdb/tests/eventscripts/50.samba.monitor.110.sh index 83a2271f268..3c2081af0e9 100755 --- a/ctdb/tests/eventscripts/50.samba.monitor.110.sh +++ b/ctdb/tests/eventscripts/50.samba.monitor.110.sh @@ -11,9 +11,9 @@ required_result 1 </dev/null || true - MISSING_SHARES_TEXT="${MISSING_SHARES_TEXT}${MISSING_SHARES_TEXT:+${_nl}}"$(printf "$_fmt" "${_i}") - fi - _t="${_t}${_t:+ }${_i}" - _n=$(($_n + 1)) - done - FAKE_SHARES="$_t" + + _n=1 + for _i in $FAKE_SHARES ; do + for _j ; do + if [ $_n -ne "$_j" ] ; then + continue + fi + + debug "Mark share $_n as missing share \"$_i\"" + rmdir "$_i" + _t=$(printf "$_fmt" "${_i}") + _out="${_out}${_out:+${_nl}}${_t}" + done + _n=$(($_n + 1)) + done + + echo "$_out" } # Setup some fake /proc/net/bonding files with just enough info for