s3:tests: Fix wbinfo_lookuprids_cache test with system tdb-tools
authorAndreas Schneider <asn@samba.org>
Mon, 14 Jun 2021 09:38:44 +0000 (11:38 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 7 Jul 2021 14:10:28 +0000 (14:10 +0000)
If libtdb is used from the system, we should use those tools by default.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/script/tests/test_wbinfo_lookuprids_cache.sh

index 0b21ffcd7c9c74cf3e207b1a1b40165c469a0f6c..34ba50fe2d7393c92ff2a70ee956b7fc23f81b3c 100755 (executable)
@@ -1,8 +1,18 @@
 #!/bin/sh
 
 WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}"
-TDBTOOL="${TDBTOOL:-$BINDIR/tdbtool}"
-TDBDUMP="${TDBDUMP:-$BINDIR/tdbdump}"
+samba_tdbtool=tdbtool
+if test -x $BINDIR/tdbtool; then
+    samba_tdbtool=$BINDIR/tdbtool
+fi
+TDBTOOL="${TDBTOOL:-$samba_tdbtool}"
+
+samba_tdbdump=tdbdump
+if test -x $BINDIR/tdbdump; then
+    samba_tdbdump=$BINDIR/tdbdump
+fi
+TDBDUMP="${TDBDUMP:-$samba_tdbdump}"
+
 NET="$VALGRIND ${NET:-$BINDIR/net}"
 
 cache="$LOCK_DIR"/winbindd_cache.tdb