mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
testprogs: use texpect in passwords test file instead of rkpty.
Guenther Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andrew Bartlet <abartlet@samba.org>
This commit is contained in:
parent
3ba74c83dc
commit
fa39e025ff
@ -28,7 +28,7 @@ fi
|
|||||||
|
|
||||||
samba_tool="$samba4bindir/samba-tool"
|
samba_tool="$samba4bindir/samba-tool"
|
||||||
smbpasswd="$samba4bindir/smbpasswd"
|
smbpasswd="$samba4bindir/smbpasswd"
|
||||||
rkpty="$samba4bindir/rkpty"
|
texpect="$samba4bindir/texpect"
|
||||||
samba4kpasswd=kpasswd
|
samba4kpasswd=kpasswd
|
||||||
if test -x $BINDIR/samba4kpasswd; then
|
if test -x $BINDIR/samba4kpasswd; then
|
||||||
samba4kpasswd=$BINDIR/samba4kpasswd
|
samba4kpasswd=$BINDIR/samba4kpasswd
|
||||||
@ -120,7 +120,7 @@ NEWUSERPASS=testPaSS@02%
|
|||||||
#expect password mismatch
|
#expect password mismatch
|
||||||
#EOF
|
#EOF
|
||||||
#
|
#
|
||||||
#testit "change user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
#testit "change user password with kpasswd" $texpect ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
||||||
|
|
||||||
|
|
||||||
echo "check that a weak password is rejected"
|
echo "check that a weak password is rejected"
|
||||||
@ -134,7 +134,7 @@ send ${WEAKPASS}\n
|
|||||||
expect Password does not meet complexity requirements
|
expect Password does not meet complexity requirements
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "change to weak user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
testit "change to weak user password with kpasswd" $texpect ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
||||||
|
|
||||||
echo "check that a short password is rejected"
|
echo "check that a short password is rejected"
|
||||||
cat > ./tmpkpasswdscript <<EOF
|
cat > ./tmpkpasswdscript <<EOF
|
||||||
@ -147,7 +147,7 @@ send xx1\n
|
|||||||
expect Password too short
|
expect Password too short
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "change to short user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
testit "change to short user password with kpasswd" $texpect ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
||||||
|
|
||||||
|
|
||||||
echo "check that a strong new password is accepted"
|
echo "check that a strong new password is accepted"
|
||||||
@ -161,7 +161,7 @@ send ${NEWUSERPASS}\n
|
|||||||
expect Success
|
expect Success
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "change user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
testit "change user password with kpasswd" $texpect ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
||||||
|
|
||||||
test_smbclient "Test login with user kerberos (unforced)" 'ls' -k yes -Unettestuser@$REALM%$NEWUSERPASS || failed=`expr $failed + 1`
|
test_smbclient "Test login with user kerberos (unforced)" 'ls' -k yes -Unettestuser@$REALM%$NEWUSERPASS || failed=`expr $failed + 1`
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ expect Retype new SMB password:
|
|||||||
send ${NEWUSERPASS}\n
|
send ${NEWUSERPASS}\n
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "set user password with smbpasswd" $rkpty ./tmpsmbpasswdscript $smbpasswd -L -c $PREFIX/dc/etc/smb.conf nettestuser || failed=`expr $failed + 1`
|
testit "set user password with smbpasswd" $texpect ./tmpsmbpasswdscript $smbpasswd -L -c $PREFIX/dc/etc/smb.conf nettestuser || failed=`expr $failed + 1`
|
||||||
USERPASS=$NEWUSERPASS
|
USERPASS=$NEWUSERPASS
|
||||||
|
|
||||||
test_smbclient "Test login with user (ntlm)" 'ls' -k no -Unettestuser@$REALM%$NEWUSERPASS || failed=`expr $failed + 1`
|
test_smbclient "Test login with user (ntlm)" 'ls' -k no -Unettestuser@$REALM%$NEWUSERPASS || failed=`expr $failed + 1`
|
||||||
@ -205,7 +205,7 @@ send ${NEWUSERPASS}\n
|
|||||||
expect Success
|
expect Success
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "change user password with kpasswd (after must change flag set)" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
testit "change user password with kpasswd (after must change flag set)" $texpect ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
|
||||||
USERPASS=$NEWUSERPASS
|
USERPASS=$NEWUSERPASS
|
||||||
|
|
||||||
test_smbclient "Test login with user kerberos" 'ls' -k yes -Unettestuser@$REALM%$NEWUSERPASS || failed=`expr $failed + 1`
|
test_smbclient "Test login with user kerberos" 'ls' -k yes -Unettestuser@$REALM%$NEWUSERPASS || failed=`expr $failed + 1`
|
||||||
@ -225,7 +225,7 @@ expect Retype new SMB password:
|
|||||||
send ${NEWUSERPASS}\n
|
send ${NEWUSERPASS}\n
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
testit "change user password with smbpasswd (after must change flag set)" $rkpty ./tmpsmbpasswdscript $smbpasswd -r $SERVER -c $PREFIX/dc/etc/smb.conf -U nettestuser || failed=`expr $failed + 1`
|
testit "change user password with smbpasswd (after must change flag set)" $texpect ./tmpsmbpasswdscript $smbpasswd -r $SERVER -c $PREFIX/dc/etc/smb.conf -U nettestuser || failed=`expr $failed + 1`
|
||||||
|
|
||||||
USERPASS=$NEWUSERPASS
|
USERPASS=$NEWUSERPASS
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user