#!/bin/sh # Blackbox tests for kinit and kerberos integration with smbclient etc # Copyright (C) 2006-2007 Jelmer Vernooij # Copyright (C) 2006-2008 Andrew Bartlett if [ $# -lt 5 ]; then cat < $PREFIX/tmpuserpassfile testit "kinit with user password" $samba4kinit --password-file=$PREFIX/tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1` test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` NEWUSERPASS=testPaSS@01% testit "change user password with 'samba-tool user password' (unforced)" $VALGRIND $samba_tool user password -W$DOMAIN -U$DOMAIN/nettestuser%$USERPASS -k no --newpassword=$NEWUSERPASS $@ || failed=`expr $failed + 1` echo $NEWUSERPASS > ./tmpuserpassfile testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile --request-pac nettestuser@$REALM || failed=`expr $failed + 1` test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1` # # These tests demonstrate that a credential cache in the environment does not # override a username/password, even an incorrect one, on the command line # testit_expect_failure "Test login with user kerberos ccache, but wrong password specified" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k yes -Unettestuser@$REALM%wrongpass && failed=`expr $failed + 1` testit_expect_failure "Test login with user kerberos ccache, but old password specified" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k yes -Unettestuser@$REALM%$USERPASS && failed=`expr $failed + 1` USERPASS=$NEWUSERPASS WEAKPASS=testpass1 NEWUSERPASS=testPaSS@02% # password mismatch check doesn't work yet (kpasswd bug, reported to Love) #echo "check that password mismatch gives the right error" #cat > ./tmpkpasswdscript < ./tmpkpasswdscript < ./tmpkpasswdscript < ./tmpkpasswdscript < ./tmpsmbpasswdscript < ./tmpkpasswdscript < ./tmpsmbpasswdscript <