testprogs: Use system_or_builddir_binary() for upgradeprovision-oldrelease
authorAndreas Schneider <asn@samba.org>
Thu, 22 Dec 2022 13:43:45 +0000 (14:43 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 23 Dec 2022 14:35:31 +0000 (14:35 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
testprogs/blackbox/upgradeprovision-oldrelease.sh

index 34d932f7e7b7954bbe7d5cc7f41bca0cc24d49af..820b8a4c389a68f170be167a93e0fb46ef6e7471 100755 (executable)
@@ -18,15 +18,8 @@ failed=0
 
 release_dir="$SRCDIR_ABS/source4/selftest/provisions/${RELEASE}"
 
-LDBDEL_BIN=ldbdel
-if [ -x "$BINDIR/ldbdel" ]; then
-       LDBDEL_BIN=$BINDIR/ldbdel
-fi
-
-samba_tdbrestore="tdbrestore"
-if [ -x "$BINDIR/tdbrestore" ]; then
-       samba_tdbrestore="$BINDIR/tdbrestore"
-fi
+ldbdel=$(system_or_builddir_binary ldbdel "${BINDIR}")
+samba_tdbrestore=$(system_or_builddir_binary tdbrestore "${BINDIR}")
 
 samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
 if [ ! -x $samba_undump ] || [ ! -d $release_dir ]; then
@@ -125,7 +118,7 @@ remove_dns_user()
 {
        if [ x$RELEASE != x"release-4-0-0" ]; then
                # This is done, because otherwise the upgrdeprovision will not run without --full
-               ${LDBDEL_BIN} -H tdb://$PREFIX_ABS/${RELEASE}_upgrade/private/sam.ldb cn=dns,cn=users,dc=${RELEASE},dc=samba,dc=corp
+               ${ldbdel} -H tdb://$PREFIX_ABS/${RELEASE}_upgrade/private/sam.ldb cn=dns,cn=users,dc=${RELEASE},dc=samba,dc=corp
        fi
 }