diff options
author | Andrew Bartlett <abartlet@samba.org> | 2014-05-16 14:30:43 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-05-16 12:50:44 +0200 |
commit | c664859a128ea7bbc05ac59a6b8384638e8cea4a (patch) | |
tree | 4f6d385264a96d3ca3f10f80b0878ad68e19d575 /testprogs | |
parent | 6c37cd65445f3acf4f41f375017ae7f5f1e34bde (diff) | |
download | samba-c664859a128ea7bbc05ac59a6b8384638e8cea4a.tar.gz samba-c664859a128ea7bbc05ac59a6b8384638e8cea4a.tar.xz samba-c664859a128ea7bbc05ac59a6b8384638e8cea4a.zip |
selftest: Test auth_wbc, the auth4 winbind and winbind_wbclient modules using pdbtest
This ensures these authentication modules continue to operate correctly, and that the results are consistent.
Andrew Bartlett
Change-Id: I7f63cd93e55c6f73ceeafb14f1dc265291791803
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri May 16 12:50:44 CEST 2014 on sn-devel-104
Diffstat (limited to 'testprogs')
-rwxr-xr-x | testprogs/blackbox/test_pdbtest.sh | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/testprogs/blackbox/test_pdbtest.sh b/testprogs/blackbox/test_pdbtest.sh index 77865a09ec5..05314dd2f55 100755 --- a/testprogs/blackbox/test_pdbtest.sh +++ b/testprogs/blackbox/test_pdbtest.sh @@ -5,16 +5,17 @@ if [ $# -lt 2 ]; then cat <<EOF -Usage: test_pdbtest.sh SERVER PREFIX SMBCLIENT SMB_CONF +Usage: test_pdbtest.sh SERVER PREFIX USER SMBCLIENT SMB_CONF EOF exit 1; fi SERVER=$1 PREFIX=$2 -smbclient=$3 -SMB_CONF=$4 -shift 4 +USER=$3 +smbclient=$4 +SMB_CONF=$5 +shift 5 failed=0 samba4bindir="$BINDIR" @@ -45,7 +46,7 @@ test_smbclient() { UID_WRAPPER_ROOT=1 export UID_WRAPPER_ROOT -testit "pdbtest" $VALGRIND $BINDIR/pdbtest -u pdbtest || failed=`expr $failed + 1` +testit "pdbtest" $VALGRIND $BINDIR/pdbtest -u $USER $@ || failed=`expr $failed + 1` NEWUSERPASS=testPaSS@01% @@ -57,14 +58,14 @@ expect retype new password: send ${NEWUSERPASS}\n EOF -testit "create user with pdbedit" $rkpty ./tmpsmbpasswdscript $VALGRIND $pdbedit -a pdbtest --account-desc="pdbedit-test-user" $@ || failed=`expr $failed + 1` +testit "create user with pdbedit" $rkpty ./tmpsmbpasswdscript $VALGRIND $pdbedit -a $USER --account-desc="pdbedit-test-user" $@ || failed=`expr $failed + 1` USERPASS=$NEWUSERPASS -test_smbclient "Test login with user (ntlm)" 'ls' -k no -Updbtest%$NEWUSERPASS $@ || failed=`expr $failed + 1` +test_smbclient "Test login with user (ntlm)" 'ls' -k no -U$USER%$NEWUSERPASS $@ || failed=`expr $failed + 1` -testit "modify user" $VALGRIND $pdbedit --modify pdbtest --drive="D:" $@ || failed=`expr $failed + 1` +testit "modify user" $VALGRIND $pdbedit --modify $USER --drive="D:" $@ || failed=`expr $failed + 1` -test_smbclient "Test login with user (ntlm)" 'ls' -k no -Updbtest%$NEWUSERPASS $@|| failed=`expr $failed + 1` +test_smbclient "Test login with user (ntlm)" 'ls' -k no -U$USER%$NEWUSERPASS $@|| failed=`expr $failed + 1` NEWUSERPASS=testPaSS@02% @@ -76,28 +77,28 @@ expect Retype new SMB password: send ${NEWUSERPASS}\n EOF -testit "set user password with smbpasswd" $rkpty ./tmpsmbpasswdscript $smbpasswd -L pdbtest -c $SMB_CONF || failed=`expr $failed + 1` +testit "set user password with smbpasswd" $rkpty ./tmpsmbpasswdscript $smbpasswd -L $USER -c $SMB_CONF || failed=`expr $failed + 1` USERPASS=$NEWUSERPASS -test_smbclient "Test login with user (ntlm)" 'ls' -k no -Updbtest%$NEWUSERPASS $@|| failed=`expr $failed + 1` +test_smbclient "Test login with user (ntlm)" 'ls' -k no -U$USER%$NEWUSERPASS $@|| failed=`expr $failed + 1` -testit "modify user - disabled" $VALGRIND $net sam set disabled pdbtest yes $@ || failed=`expr $failed + 1` +testit "modify user - disabled" $VALGRIND $net sam set disabled $USER yes $@ || failed=`expr $failed + 1` -testit_expect_failure "Test login with disabled suer" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k no -Updbtest@%$USERPASS && failed=`expr $failed + 1` +testit_expect_failure "Test login with disabled suer" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k no -U$USER@%$USERPASS && failed=`expr $failed + 1` -testit "modify user - enabled" $VALGRIND $net sam set disabled pdbtest no $@ || failed=`expr $failed + 1` +testit "modify user - enabled" $VALGRIND $net sam set disabled $USER no $@ || failed=`expr $failed + 1` -test_smbclient "Test login with re-enabled user (ntlm)" 'ls' -k no -Updbtest%$NEWUSERPASS || failed=`expr $failed + 1` +test_smbclient "Test login with re-enabled user (ntlm)" 'ls' -k no -U$USER%$NEWUSERPASS || failed=`expr $failed + 1` -testit "modify user - must change password now" $VALGRIND $net sam set pwdmustchangenow pdbtest yes $@ || failed=`expr $failed + 1` +testit "modify user - must change password now" $VALGRIND $net sam set pwdmustchangenow $USER yes $@ || failed=`expr $failed + 1` -testit_expect_failure "Test login with expired password" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k no -Updbtest@%$USERPASS && failed=`expr $failed + 1` +testit_expect_failure "Test login with expired password" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k no -U$USER@%$USERPASS && failed=`expr $failed + 1` -testit "modify user - disable password expiry" $VALGRIND $net sam set pwnoexp pdbtest yes $@ || failed=`expr $failed + 1` +testit "modify user - disable password expiry" $VALGRIND $net sam set pwnoexp $USER yes $@ || failed=`expr $failed + 1` -test_smbclient "Test login with no expiry (ntlm)" 'ls' -k no -Updbtest%$NEWUSERPASS || failed=`expr $failed + 1` +test_smbclient "Test login with no expiry (ntlm)" 'ls' -k no -U$USER%$NEWUSERPASS || failed=`expr $failed + 1` -testit "del user" $VALGRIND $pdbedit -x pdbtest $@ || failed=`expr $failed + 1` +testit "del user" $VALGRIND $pdbedit -x $USER $@ || failed=`expr $failed + 1` rm ./tmpsmbpasswdscript |