testprogs: Use better KRB5CCNAME in test_password_settings.sh
authorAndreas Schneider <asn@samba.org>
Tue, 20 Sep 2016 07:46:34 +0000 (09:46 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 21 Dec 2016 17:35:12 +0000 (18:35 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
testprogs/blackbox/test_password_settings.sh

index 9436e3039b9cb7f8a1d1458cbb690c388f1c57fe..97adb3c9db294015dfff9ca2be060f2ff033e266 100755 (executable)
@@ -87,6 +87,8 @@ testit "kinit with user password" \
 test_smbclient "Test login with user kerberos ccache" \
        "ls" "$SMB_UNC" -k yes || failed=`expr $failed + 1`
 
+rm -f $KRB5CCNAME_PATH
+
 ###########################################################
 ### Change the users password
 ###########################################################
@@ -114,6 +116,8 @@ testit_expect_failure "Test login with user kerberos ccache, but wrong password
 testit_expect_failure "Test login with user kerberos ccache, but old password specified" \
        $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k yes -U$TEST_PRINCIPAL%$TEST_PASSWORD_OLD && failed=`expr $failed + 1`
 
+rm -f $KRB5CCNAME_PATH
+
 ###########################################################
 ### Set the password with smbpasswd
 ###########################################################
@@ -150,6 +154,8 @@ TEST_PASSWORD_NEW="testPaSS@05%"
 
 test_smbclient "Test login with user kerberos" 'ls' "$SMB_UNC" -k yes -U$TEST_PRINCIPAL%$TEST_PASSWORD || failed=`expr $failed + 1`
 
+rm -f $KRB5CCNAME_PATH
+
 cat > $PREFIX/tmpsmbpasswdscript <<EOF
 expect Old SMB password:
 password ${TEST_PASSWORD}\n
@@ -168,6 +174,8 @@ TEST_PASSWORD_NEW="testPaSS@06%"
 test_smbclient "Test login with user kerberos" \
        "ls" "$SMB_UNC" -k yes -U$TEST_PRINCIPAL%$TEST_PASSWORD || failed=`expr $failed + 1`
 
+rm -f $KRB5CCNAME_PATH
+
 testit_expect_failure "try to set a non-complex password (command should not succeed)" \
        $VALGRIND $samba_tool user password -W$DOMAIN "-U$DOMAIN/$TEST_USERNAME%$TEST_PASSWORD" -k no --newpassword="$TEST_PASSWORD_WEAK" && failed=`expr $failed + 1`