Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/testprogs/blackbox/test_kinit.sh

    r414 r745  
    1717DOMAIN=$5
    1818PREFIX=$6
    19 shift 6
     19ENCTYPE=$7
     20shift 7
    2021failed=0
    2122
    2223samba4bindir="$BUILDDIR/bin"
     24samba4srcdir="$SRCDIR/source4"
    2325smbclient="$samba4bindir/smbclient$EXEEXT"
    2426samba4kinit="$samba4bindir/samba4kinit$EXEEXT"
    25 net="$samba4bindir/net$EXEEXT"
     27samba_tool="$samba4bindir/samba-tool$EXEEXT"
     28ldbmodify="$samba4bindir/ldbmodify$EXEEXT"
     29ldbsearch="$samba4bindir/ldbsearch$EXEEXT"
    2630rkpty="$samba4bindir/rkpty$EXEEXT"
    2731samba4kpasswd="$samba4bindir/samba4kpasswd$EXEEXT"
    28 enableaccount="$PYTHON `dirname $0`/../../source4/setup/enableaccount"
     32enableaccount="$samba_tool enableaccount"
     33machineaccountccache="$samba4srcdir/scripting/bin/machineaccountccache"
    2934
    3035. `dirname $0`/subunit.sh
     
    4651}
    4752
     53enctype="-e $ENCTYPE"
     54
     55PWSETCONFIG="-H ldap://$SERVER -U$USERNAME%$PASSWORD"
     56export PWSETCONFIG
     57
    4858KRB5CCNAME="$PREFIX/tmpccache"
    4959export KRB5CCNAME
    5060
    51 echo $PASSWORD > ./tmppassfile
    52 #testit "kinit with keytab" $samba4kinit --keytab=$PREFIX/dc/private/secrets.keytab $SERVER\$@$REALM   || failed=`expr $failed + 1`
    53 testit "kinit with password" $samba4kinit --password-file=./tmppassfile --request-pac $USERNAME@$REALM   || failed=`expr $failed + 1`
    54 testit "kinit with password (enterprise style)" $samba4kinit --enterprise --password-file=./tmppassfile --request-pac $USERNAME@$REALM   || failed=`expr $failed + 1`
    55 testit "kinit with password (windows style)" $samba4kinit --windows --password-file=./tmppassfile --request-pac $USERNAME@$REALM   || failed=`expr $failed + 1`
    56 testit "kinit with pkinit (name specified)" $samba4kinit --request-pac --renewable --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem $USERNAME@$REALM || failed=`expr $failed + 1`
    57 testit "kinit with pkinit (enterprise name specified)" $samba4kinit --request-pac --renewable --pk-user=FILE:$PREFIX/dc/private/tls/admincert.pem,$PREFIX/dc/private/tls/adminkey.pem --enterprise $USERNAME@$REALM || failed=`expr $failed + 1`
    58 testit "kinit with pkinit (enterprise name in cert)" $samba4kinit --request-pac --renewable --pk-user=FILE:$PREFIX/dc/private/tls/admincertupn.pem,$PREFIX/dc/private/tls/adminkey.pem --pk-enterprise || failed=`expr $failed + 1`
    59 testit "kinit renew ticket" $samba4kinit --request-pac -R
     61testit "reset password policies beside of minimum password age of 0 days" $VALGRIND $samba_tool pwsettings $PWSETCONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=0 --max-pwd-age=default || failed=`expr $failed + 1`
     62
     63echo $PASSWORD > $PREFIX/tmppassfile
     64#testit "kinit with keytab" $samba4kinit $enctype --keytab=$PREFIX/dc/private/secrets.keytab $SERVER\$@$REALM   || failed=`expr $failed + 1`
     65testit "kinit with password" $samba4kinit $enctype --password-file=$PREFIX/tmppassfile --request-pac $USERNAME@$REALM   || failed=`expr $failed + 1`
     66testit "kinit with password (enterprise style)" $samba4kinit $enctype --enterprise --password-file=$PREFIX/tmppassfile --request-pac $USERNAME@$REALM   || failed=`expr $failed + 1`
     67testit "kinit with password (windows style)" $samba4kinit $enctype  --renewable --windows --password-file=$PREFIX/tmppassfile --request-pac $USERNAME@$REALM   || failed=`expr $failed + 1`
     68testit "kinit renew ticket" $samba4kinit $enctype --request-pac -R
    6069
    6170test_smbclient "Test login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
    6271
    63 testit "domain join with kerberos ccache" $VALGRIND $net join $DOMAIN $CONFIGURATION  -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1`
    64 testit "check time with kerberos ccache" $VALGRIND $net time $SERVER $CONFIGURATION  -W "$DOMAIN" -k yes $@ || failed=`expr $failed + 1`
     72testit "check time with kerberos ccache" $VALGRIND $samba_tool $CONFIGURATION -k yes $@ time $SERVER || failed=`expr $failed + 1`
    6573
    66 testit "add user with kerberos ccache" $VALGRIND $net user add nettestuser $CONFIGURATION  -k yes $@ || failed=`expr $failed + 1`
    6774USERPASS=testPass@12%
    68 echo $USERPASS > ./tmpuserpassfile
     75echo $USERPASS > $PREFIX/tmpuserpassfile
     76testit "add user with kerberos ccache" $VALGRIND $samba_tool user add nettestuser $USERPASS $CONFIGURATION  -k yes $@ || failed=`expr $failed + 1`
    6977
    70 testit "set user password with kerberos ccache" $VALGRIND $net password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION  -k yes $@ || failed=`expr $failed + 1`
     78echo "Getting defaultNamingContext"
     79BASEDN=`$ldbsearch $options --basedn='' -H ldap://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'`
     80
     81cat > $PREFIX/tmpldbmodify <<EOF
     82dn: cn=nettestuser,cn=users,$BASEDN
     83changetype: modify
     84add: servicePrincipalName
     85servicePrincipalName: host/nettestuser
     86EOF
     87
     88testit "modify servicePrincipalName" $VALGRIND $ldbmodify -H ldap://$SERVER $PREFIX/tmpldbmodify -k yes $@ || failed=`expr $failed + 1`
     89
     90testit "set user password with kerberos ccache" $VALGRIND $samba_tool password set $DOMAIN\\nettestuser $USERPASS $CONFIGURATION  -k yes $@ || failed=`expr $failed + 1`
    7191
    7292testit "enable user with kerberos cache" $VALGRIND $enableaccount nettestuser -H ldap://$SERVER -k yes $@ || failed=`expr $failed + 1`
     
    7595export KRB5CCNAME
    7696
    77 testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
     97testit "kinit with user password" $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
    7898
    7999test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
    80100
    81101NEWUSERPASS=testPaSS@34%
    82 testit "change user password with 'net password change' (rpc)" $VALGRIND $net password change -W$DOMAIN -U$DOMAIN\\nettestuser%$USERPASS $CONFIGURATION  -k no $NEWUSERPASS $@ || failed=`expr $failed + 1`
     102testit "change user password with 'samba-tool password change' (rpc)" $VALGRIND $samba_tool password change -W$DOMAIN -U$DOMAIN\\nettestuser%$USERPASS $CONFIGURATION  -k no $NEWUSERPASS $@ || failed=`expr $failed + 1`
    83103
    84 echo $NEWUSERPASS > ./tmpuserpassfile
    85 testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
     104echo $NEWUSERPASS > $PREFIX/tmpuserpassfile
     105testit "kinit with user password" $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
    86106
    87107test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
     
    90110USERPASS=$NEWUSERPASS
    91111NEWUSERPASS=testPaSS@56%
    92 echo $NEWUSERPASS > ./tmpuserpassfile
     112echo $NEWUSERPASS > $PREFIX/tmpuserpassfile
    93113
    94 cat > ./tmpkpasswdscript <<EOF
     114cat > $PREFIX/tmpkpasswdscript <<EOF
    95115expect Password
    96116password ${USERPASS}\n
    97117expect New password
    98118send ${NEWUSERPASS}\n
    99 expect New password
     119expect Verify password
    100120send ${NEWUSERPASS}\n
    101121expect Success
    102122EOF
    103123
    104 testit "change user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
     124testit "change user password with kpasswd" $rkpty $PREFIX/tmpkpasswdscript $samba4kpasswd nettestuser@$REALM || failed=`expr $failed + 1`
    105125
    106 testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
     126testit "kinit with user password" $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
    107127
    108128NEWUSERPASS=testPaSS@78%
    109 echo $NEWUSERPASS > ./tmpuserpassfile
     129echo $NEWUSERPASS > $PREFIX/tmpuserpassfile
    110130
    111131test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
    112132
    113 cat > ./tmpkpasswdscript <<EOF
     133cat > $PREFIX/tmpkpasswdscript <<EOF
    114134expect New password
    115135send ${NEWUSERPASS}\n
    116 expect New password
     136expect Verify password
    117137send ${NEWUSERPASS}\n
    118138expect Success
    119139EOF
    120140
    121 testit "set user password with kpasswd" $rkpty ./tmpkpasswdscript $samba4kpasswd --cache=$PREFIX/tmpccache nettestuser@$REALM || failed=`expr $failed + 1`
     141testit "set user password with kpasswd" $rkpty $PREFIX/tmpkpasswdscript $samba4kpasswd --cache=$PREFIX/tmpccache nettestuser@$REALM || failed=`expr $failed + 1`
    122142
    123 testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
     143testit "kinit with user password" $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
     144
     145test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
     146
     147NEWUSERPASS=testPaSS@910%
     148echo $NEWUSERPASS > $PREFIX/tmpuserpassfile
     149
     150cat > $PREFIX/tmpkpasswdscript <<EOF
     151expect New password
     152send ${NEWUSERPASS}\n
     153expect Verify password
     154send ${NEWUSERPASS}\n
     155expect Success
     156EOF
     157
     158testit "set user password with kpasswd and servicePrincipalName" $rkpty $PREFIX/tmpkpasswdscript $samba4kpasswd --cache=$PREFIX/tmpccache host/nettestuser@$REALM || failed=`expr $failed + 1`
     159
     160testit "kinit with user password" $samba4kinit $enctype --password-file=$PREFIX/tmpuserpassfile --request-pac nettestuser@$REALM   || failed=`expr $failed + 1`
    124161
    125162test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
     
    128165export KRB5CCNAME
    129166
    130 testit "del user with kerberos ccache" $VALGRIND $net user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1`
     167lowerrealm=$(echo $REALM | tr '[A-Z]' '[a-z]')
     168test_smbclient "Test login with user kerberos lowercase realm" 'ls' -k yes -Unettestuser@$lowerrealm%$NEWUSERPASS || failed=`expr $failed + 1`
     169test_smbclient "Test login with user kerberos lowercase realm 2" 'ls' -k yes -Unettestuser@$REALM%$NEWUSERPASS --realm=$lowerrealm || failed=`expr $failed + 1`
    131170
    132 rm -f tmpccfile tmppassfile tmpuserpassfile tmpuserccache tmpkpasswdscript
     171testit "del user with kerberos ccache" $VALGRIND $samba_tool user delete nettestuser $CONFIGURATION -k yes $@ || failed=`expr $failed + 1`
     172
     173rm -f $KRB5CCNAME
     174testit "kinit with machineaccountccache script" $machineaccountccache $CONFIGURATION $KRB5CCNAME || failed=`expr $failed + 1`
     175test_smbclient "Test machine account login with kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
     176
     177testit "reset password policies" $VALGRIND $samba_tool pwsettings $PWSETCONFIG set --complexity=default --history-length=default --min-pwd-length=default --min-pwd-age=default --max-pwd-age=default || failed=`expr $failed + 1`
     178
     179rm -f $PREFIX/tmpccache tmpccfile tmppassfile tmpuserpassfile tmpuserccache tmpkpasswdscript
    133180exit $failed
Note: See TracChangeset for help on using the changeset viewer.