summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2021-06-21 15:26:38 +1000
committerAmitay Isaacs <amitay@samba.org>2021-06-25 09:16:31 +0000
commitfc0da6b0f878d70ff19a568cbb2e47972b45c0b1 (patch)
treea7fa07e2ba8742b22d2978b554c78e184a2ed4e0 /ctdb
parent23b2fab2c886a5cdc72a87aa0d2e14c9e6b96b1c (diff)
downloadsamba-fc0da6b0f878d70ff19a568cbb2e47972b45c0b1.tar.gz
ctdb-tests: Force stub version of service in eventscript tests
Fedora 34 now has a shell function for the which command, which causes these uses of which to return the enclosing function definition rather than the executable file as expected. The event script unit tests always expect the stub service command to be used, so the conditional in these functions is unnecessary. $CTDB_HELPER_BINDIR already conveniently points to the stub directory, so use it here. Signed-off-by: Martin Schwenke <martin@meltin.net> Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local16
1 files changed, 3 insertions, 13 deletions
diff --git a/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local b/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local
index e9a7f99829a..2f506e907a2 100755
--- a/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local
+++ b/ctdb/tests/UNIT/eventscripts/etc-ctdb/rc.local
@@ -1,24 +1,14 @@
# Hey Emacs, this is a -*- shell-script -*- !!! :-)
-# Use a "service" command in $PATH if one exists.
+# Always use stub version of service command
service ()
{
- if _t=$(which "service" 2>/dev/null) ; then
- "$_t" "$@"
- else
- _nice=""
- _service "$@"
- fi
+ "${CTDB_HELPER_BINDIR}/service" "$@"
}
nice_service ()
{
- if _t=$(which "service" 2>/dev/null) ; then
- nice "$_t" "$@"
- else
- _nice="nice"
- _service "$@"
- fi
+ nice "${CTDB_HELPER_BINDIR}/service" "$@"
}
# Always succeeds