]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-selftest: fix test_wbinfo_lookuprids_cache.sh
authorGünther Deschner <gd@samba.org>
Thu, 31 Jul 2025 13:35:04 +0000 (15:35 +0200)
committerDouglas Bagnall <dbagnall@samba.org>
Sat, 2 Aug 2025 07:20:38 +0000 (07:20 +0000)
This script is using tdbtool for deleting keys of a particular
winbind NDR operation for regression testing. There are two issues here:

The opnum for this winbind NDR operation has changed (as new calls have
been added to the interface), it is no longer 16 but now 17. Better try
to lookup the current opnum from the IDL.

As tdbtool always returns with success error code regardless of the
success of its command - in this case a delete key operation - the test
is simply not able to fail at all (patch following to fix tdbtool
itself).

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/script/tests/test_wbinfo_lookuprids_cache.sh

index abb078bf7ef55e187c7bca849fabe4c6f6b1877e..fef4e04b36958fe16efca4c3cc43996cfbcafe00 100755 (executable)
@@ -23,7 +23,8 @@ incdir=$(dirname $0)/../../../testprogs/blackbox
 testit "flush" "$NET" "cache" "flush" || failed=$(expr $failed + 1)
 testit "lookuprids1" "$WBINFO" "-R" "512,12345" || failed=$(expr $failed + 1)
 
-key=$("$TDBDUMP" "$cache" | grep ^key.*NDR.*/16/ | cut -d\" -f2)
+opnum=$($PYTHON -c'from samba.dcerpc.winbind import wbint_LookupRids; print(wbint_LookupRids.opnum())')
+key=$("$TDBDUMP" "$cache" | grep ^key.*NDR.*/"$opnum"/ | cut -d\" -f2)
 
 testit "delete" "$TDBTOOL" "$cache" delete "$key"
 testit "lookuprids2" "$WBINFO" "-R" "512,12345" || failed=$(expr $failed + 1)