ctdb-tests: Log to stderr in statd-callout tests
authorMartin Schwenke <mschwenke@ddn.com>
Sun, 16 Jul 2023 10:55:57 +0000 (20:55 +1000)
committerAmitay Isaacs <amitay@samba.org>
Wed, 19 Jul 2023 09:57:37 +0000 (09:57 +0000)
Errors logged when testing statd-callout don't currently go anywhere.
This is because arguments to the hacked version of script_log() are
ignored.

Remove the hack and configure logging to stderr.

This could go in the local statd-callout.sh setup script.  However,
make it available for other script tests.

Signed-off-by: Martin Schwenke <mschwenke@ddn.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Wed Jul 19 09:57:37 UTC 2023 on atb-devel-224

ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local
ctdb/tests/UNIT/eventscripts/scripts/local.sh

index 2f506e907a20d7e769c4fb47ba194ad0f248f6f6..aa9b8b22fecd75fcebe3168491e600050e7a83b7 100755 (executable)
@@ -51,9 +51,4 @@ background_with_logging ()
     "$@" 2>&1 </dev/null | sed -e 's@^@\&@'
 }
 
-script_log ()
-{
-       cat
-}
-
 CTDB_INIT_STYLE="${EVENTSCRIPT_TESTS_INIT_STYLE:-redhat}"
index 39a2a087a2189e276a1e6954dc915c73f826e5e9..3c2818168155b675454fe3c5fa797bed6f7571c7 100644 (file)
@@ -23,9 +23,7 @@ export CTDB="ctdb"
 # Force this to be absolute - event scripts can change directory
 CTDB_TEST_TMP_DIR=$(cd "$CTDB_TEST_TMP_DIR" && echo "$PWD")
 
-export CTDB_LOGGING="file:${CTDB_TEST_TMP_DIR}/log.ctdb"
-touch "${CTDB_LOGGING#file:}" ||
-       die "Unable to setup logging for \"$CTDB_LOGGING\""
+export CTDB_LOGGING="file:"
 
 if [ -d "${CTDB_TEST_SUITE_DIR}/etc" ]; then
        cp -a "${CTDB_TEST_SUITE_DIR}/etc" "$CTDB_TEST_TMP_DIR"