1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

tests: Show that we 100% loop in cli_list_old_recv()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=15382

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2023-06-01 16:41:37 +02:00 committed by Jeremy Allison
parent 4804d6b89a
commit e86234f3d6
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1 @@
^samba3.blackbox.smbclient_old_dir.*

View File

@ -0,0 +1,28 @@
#!/bin/sh
# This tests listing directories using the SMBSearch call family
if [ $# -lt 2 ]; then
cat <<EOF
Usage: $0 TIMELIMIT SMBCLIENT
EOF
exit 1
fi
TIMELIMIT="$1"
shift
SMBCLIENT="$VALGRIND $1"
shift
incdir=$(dirname $0)/../../../testprogs/blackbox
. $incdir/subunit.sh
# Make sure we don't loop 100% CPU. A normal dir listing should return
# in less than 3 seconds. At the point of this commit smbclient -c dir
# | wc returns 43 lines, so checking for 100 lines should be well
# enough.
count=$($TIMELIMIT 3 $SMBCLIENT //"$SERVER_IP"/tmpguest -m LANMAN1 -U% \
-c dir | wc -l)
testit "listing shares with LANMAN1" test ${count} -le 100 ||
failed=$((failed + 1))

View File

@ -34,6 +34,7 @@ from selftesthelpers import valgrindify, smbtorture4_testsuites
from selftesthelpers import smbtorture4_options
from selftesthelpers import smbcontrol
from selftesthelpers import smbstatus
from selftesthelpers import timelimit
smbtorture4_options.extend([
'--option=torture:sharedelay=100000',
'--option=torture:writetimeupdatedelay=500000',
@ -829,6 +830,11 @@ for env in ["fileserver"]:
'$SERVER', 'fruit_resource_stream', '$USERNAME', '$PASSWORD',
'$LOCAL_PATH/fruit_resource_stream', smbclient3])
plantestsuite("samba3.blackbox.smbclient_old_dir", "fileserver_smb1",
[os.path.join(samba3srcdir,
"script/tests/test_old_dirlisting.sh"),
timelimit, smbclient3])
for env in ["fileserver:local"]:
plantestsuite("samba3.blackbox.net_usershare", env, [os.path.join(samba3srcdir, "script/tests/test_net_usershare.sh"), '$SERVER', '$SERVER_IP', '$USERNAME', '$PASSWORD', smbclient3])