testprogs/blackbox: Add test to set and use password with non-ascii
authorNoel Power <noel.power@suse.com>
Tue, 15 May 2018 17:27:23 +0000 (18:27 +0100)
committerNoel Power <npower@samba.org>
Thu, 17 May 2018 09:31:28 +0000 (11:31 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
testprogs/blackbox/test_password_settings.sh

index 49d5126..1edf2bf 100755 (executable)
@@ -64,6 +64,7 @@ testit "reset password policies beside of minimum password age of 0 days" \
 TEST_USERNAME="$(mktemp -u alice-XXXXXX)"
 TEST_PASSWORD="testPaSS@00%"
 TEST_PASSWORD_NEW="testPaSS@01%"
+TEST_PASSWORD_NON_ASCII="Täst123"
 TEST_PASSWORD_SHORT="secret"
 TEST_PASSWORD_WEAK="Supersecret"
 TEST_PRINCIPAL="$TEST_USERNAME@$REALM"
@@ -100,6 +101,22 @@ TEST_PASSWORD_OLD=$TEST_PASSWORD
 TEST_PASSWORD=$TEST_PASSWORD_NEW
 TEST_PASSWORD_NEW="testPaSS@02%"
 
+testit "kinit with user password" \
+       do_kinit $TEST_PRINCIPAL $TEST_PASSWORD || failed=`expr $failed + 1`
+
+test_smbclient "Test login with user kerberos ccache" \
+       "ls" "$SMB_UNC" -k yes || failed=`expr $failed + 1`
+
+###########################################################
+### Change the users password
+###########################################################
+
+testit "change user (non-ascii) password with 'samba-tool user password' (unforced)" \
+       $VALGRIND $samba_tool user password -W$DOMAIN -U$TEST_USERNAME%$TEST_PASSWORD -k no --newpassword=$TEST_PASSWORD_NON_ASCII || failed=`expr $failed + 1`
+
+TEST_PASSWORD_OLD=$TEST_PASSWORD_NEW
+TEST_PASSWORD=$TEST_PASSWORD_NON_ASCII
+
 testit "kinit with user password" \
        do_kinit $TEST_PRINCIPAL $TEST_PASSWORD || failed=`expr $failed + 1`