diff options
author | Volker Lendecke <vl@samba.org> | 2010-04-17 21:31:57 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-04-19 14:27:24 +0200 |
commit | e0d7a8424264bb9a240409b67d4c363e154097dc (patch) | |
tree | 96de6a5cfe121cf370edaa18d8c5d2b8bfb950aa /source3/script/tests | |
parent | 5aa88782ce0615a3d171682fbb13a182e586ec69 (diff) | |
download | samba-e0d7a8424264bb9a240409b67d4c363e154097dc.tar.gz samba-e0d7a8424264bb9a240409b67d4c363e154097dc.tar.bz2 samba-e0d7a8424264bb9a240409b67d4c363e154097dc.zip |
s3: Test for wb ccache access by smbclient
Diffstat (limited to 'source3/script/tests')
-rwxr-xr-x | source3/script/tests/test_smbclient_s3.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 965e275a3b..2260903312 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -16,6 +16,7 @@ PASSWORD="$4" USERID="$5" LOCAL_PATH="$6" SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION" +WBINFO="$VALGRIND ${WBINFO:-$BINDIR/wbinfo}" shift 6 ADDARGS="$*" @@ -360,6 +361,34 @@ EOF fi } +# Test authenticating using the winbind ccache +test_ccache_access() +{ + $WBINFO --ccache-save="${USERNAME}%${PASSWORD}" + $SMBCLIENT $CONFIGURATION //$SERVER_IP/tmp -C -U "${USERNAME}%" \ + -c quit 2>&1 + ret=$? + + if [ $ret != 0 ] ; then + echo "smbclient failed to use cached credentials" + false + return + fi + + $WBINFO --ccache-save="${USERNAME}%GarBage" + $SMBCLIENT $CONFIGURATION //$SERVER_IP/tmp -C -U "${USERNAME}%" \ + -c quit 2>&1 + ret=$? + + if [ $ret == 0 ] ; then + echo "smbclient succeeded with wrong cached credentials" + false + return + fi + + $WBINFO --logoff +} + testit "smbclient -L $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1` testit "smbclient -L $SERVER -I $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER -I $SERVER_IP -N -p 139 || failed=`expr $failed + 1` @@ -400,4 +429,8 @@ testit "Accessing an MS-DFS link" \ test_msdfs_link || \ failed=`expr $failed + 1` +testit "ccache access works for smbclient" \ + test_ccache_access || \ + failed=`expr $failed + 1` + testok $0 $failed |