From: Martin Schwenke Date: Tue, 7 Oct 2025 11:27:06 +0000 (+1100) Subject: ctdb-tests: Improve setup_ctdb_base() to fix local_daemons.sh bug X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=98cecce76d15308e321a3ce57ce389ad457ee858;p=thirdparty%2Fsamba.git ctdb-tests: Improve setup_ctdb_base() to fix local_daemons.sh bug $ ctdb/tests/local_daemons.sh foo onnode 0 ctdb event script list legacy Unable to find event script installation directory: foo/node.0/share/events/legacy This happens if the $CTDB_BASE/share/events/legacy/ directory does not exist. This directory is (theoretically) for installed but not necessarily enabled event scripts. ctdb/tests/etc-ctdb/ contains events/legacy/ but setup_ctdb_base() currently does not ensure creation of the corresponding directory under $CTDB_BASE/share/. Ensure that an event script component installation subdirectory exists for each corresponding configuration subdirectory. An alternative would be to continue to allow the existing failure, but create directory ctdb/tests/etc-ctdb/share/events/legacy/ specifically to make local_daemons.sh work. However, it took 5 years to find the current bug, so this may be too subtle for other users of local_daemons.sh. Anyone wanting to test the failure case can remove unwanted subdirectories after "local_daemons.sh setup". Signed-off-by: Martin Schwenke Reviewed-by: Ralph Boehme --- diff --git a/ctdb/tests/scripts/common.sh b/ctdb/tests/scripts/common.sh index ba3d0f4c8bb..eb2c4c0a8a5 100644 --- a/ctdb/tests/scripts/common.sh +++ b/ctdb/tests/scripts/common.sh @@ -148,5 +148,18 @@ setup_ctdb_base() [ -e "$_i" ] || break cp -pr "$_i" "${CTDB_BASE}/" + + done + + # Ensure existence of an event script component installation + # subdirectory corresponding to each event script component + # configuration subdirectory. + # + # This helps: + # local_daemons.sh onnode ctdb event script list + # to work. + for _d in "${CTDB_BASE}/events/"*; do + _b=$(basename "$_d") + mkdir -p "${CTDB_BASE}/share/events/${_b}" done }