From 1e6fb7d7306ee64ac649afe235e452ac116de394 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 18 Jun 2009 12:38:04 +1000 Subject: s4: Add tests and 'must change password' flags in setpassword and newuser In particular, ensure that we can acutally change the password under these circumstances. Andrew Bartlett --- testprogs/blackbox/test_passwords.sh | 121 +++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100755 testprogs/blackbox/test_passwords.sh (limited to 'testprogs') diff --git a/testprogs/blackbox/test_passwords.sh b/testprogs/blackbox/test_passwords.sh new file mode 100755 index 0000000000..c42969f4a5 --- /dev/null +++ b/testprogs/blackbox/test_passwords.sh @@ -0,0 +1,121 @@ +#!/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@02% +testit "change user password with 'net password change' (unforced)" $VALGRIND $net password change -W$DOMAIN -U$DOMAIN\\nettestuser%$USERPASS -k no $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` + + +USERPASS=$NEWUSERPASS +NEWUSERPASS=testPaSS@03% + +cat > ./tmpkpasswdscript < ./tmpkpasswdscript <