diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-04-15 16:25:50 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-16 14:12:44 +1000 |
commit | 48330c828e5058823c6df09736e8e8eaefdd6565 (patch) | |
tree | 02143de57dde454bcaee1399efae66936528526e | |
parent | a7f8c197adbc684dd9de6356ea1a5a9b59a5c322 (diff) | |
download | samba-48330c828e5058823c6df09736e8e8eaefdd6565.tar.gz samba-48330c828e5058823c6df09736e8e8eaefdd6565.tar.bz2 samba-48330c828e5058823c6df09736e8e8eaefdd6565.zip |
s4-test: check that a weak password is rejected by kpasswd
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rwxr-xr-x | testprogs/blackbox/test_passwords.sh | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/testprogs/blackbox/test_passwords.sh b/testprogs/blackbox/test_passwords.sh index 9a4c1915f6..167c1b244f 100755 --- a/testprogs/blackbox/test_passwords.sh +++ b/testprogs/blackbox/test_passwords.sh @@ -71,8 +71,52 @@ test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`exp USERPASS=$NEWUSERPASS +WEAKPASS=testpass1 NEWUSERPASS=testPaSS@03% +# password mismatch check doesn't work yet (kpasswd bug, reported to Love) +#echo "check that password mismatch gives the right error" +#cat > ./tmpkpasswdscript <<EOF +#expect Password +#password ${USERPASS}\n +#expect New password +#send ${WEAKPASS}\n +#expect New password +#send ${NEWUSERPASS}\n +#expect password mismatch +#EOF +# +#testit "change user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1` + + +echo "check that a weak password is rejected" +cat > ./tmpkpasswdscript <<EOF +expect Password +password ${USERPASS}\n +expect New password +send ${WEAKPASS}\n +expect New password +send ${WEAKPASS}\n +expect Password does not meet complexity requirements +EOF + +testit "change to weak user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1` + +echo "check that a short password is rejected" +cat > ./tmpkpasswdscript <<EOF +expect Password +password ${USERPASS}\n +expect New password +send xx1\n +expect New password +send xx1\n +expect Password too short +EOF + +testit "change to short user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1` + + +echo "check that a strong new password is accepted" cat > ./tmpkpasswdscript <<EOF expect Password password ${USERPASS}\n |