diff options
Diffstat (limited to 'source3/script/tests/test_old_dirlisting.sh')
-rwxr-xr-x | source3/script/tests/test_old_dirlisting.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/script/tests/test_old_dirlisting.sh b/source3/script/tests/test_old_dirlisting.sh new file mode 100755 index 0000000..f50a474 --- /dev/null +++ b/source3/script/tests/test_old_dirlisting.sh @@ -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)) |