Add tests for various s3 auth modes
[samba.git] / source3 / script / tests / test_smbclient_auth.sh
1 #!/bin/sh
2
3 # this runs the file serving tests that are expected to pass with samba3 against shares with various options
4
5 if [ $# -lt 5 ]; then
6 cat <<EOF
7 Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD USERID LOCAL_PATH
8 EOF
9 exit 1;
10 fi
11
12 SERVER="$1"
13 SERVER_IP="$2"
14 USERNAME="$3"
15 PASSWORD="$4"
16 USERID="$5"
17 SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
18 WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}"
19 shift 5
20 ADDARGS="$*"
21
22 test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
23 incdir=`dirname $0`/../../../testprogs/blackbox
24 . $incdir/subunit.sh
25 }
26
27 failed=0
28
29 testit "smbclient //$SERVER/guestonly" $SMBCLIENT //$SERVER/guestonly $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
30 testit "smbclient //$SERVER/guestonly as anon" $SMBCLIENT //$SERVER/guestonly $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
31 testit "smbclient //$SERVER/tmpguest" $SMBCLIENT //$SERVER/tmpguest $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
32 testit "smbclient //$SERVER/tmpguest as anon" $SMBCLIENT //$SERVER/tmpguest $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
33 testit "smbclient //$SERVER/forceuser" $SMBCLIENT //$SERVER/forceuser $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
34 testit "smbclient //$SERVER/forceuser as anon" $SMBCLIENT //$SERVER/forceuser $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
35 testit "smbclient //$SERVER/forcegroup" $SMBCLIENT //$SERVER/forcegroup $CONFIGURATION -U$USERNAME%$PASSWORD -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
36 testit "smbclient //$SERVER/forcegroup as anon" $SMBCLIENT //$SERVER/forcegroup $CONFIGURATION -U% -I $SERVER_IP -N -p 139 -c quit|| failed=`expr $failed + 1`
37
38 testok $0 $failed