pdb: add a blackbox test for setting password with hash
authorGarming Sam <garming@catalyst.net.nz>
Mon, 30 Nov 2015 01:24:06 +0000 (14:24 +1300)
committerGarming Sam <garming@samba.org>
Mon, 30 Nov 2015 02:49:25 +0000 (03:49 +0100)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
testprogs/blackbox/test_pdbtest.sh

index 017116c206e8489300d0b4ca9537321f3e2de25a..e29df7511cddde36d880ad70177fc74379682ff7 100755 (executable)
@@ -98,6 +98,13 @@ testit "modify user - disable password expiry"  $VALGRIND $net sam set pwnoexp $
 
 test_smbclient "Test login with no expiry (ntlm)" 'ls' -k no -U$USER%$NEWUSERPASS || failed=`expr $failed + 1`
 
+NEWUSERPASS=testPaSS@03%
+NEWUSERHASH=062519096c45739c1938800f80906731
+
+testit "Set user password with password hash" $VALGRIND $pdbedit -u $USER --set-nt-hash $NEWUSERHASH $@ || failed=`expr $failed + 1`
+
+test_smbclient "Test login with new password (from hash)" 'ls' -k no -U$USER%$NEWUSERPASS || failed=`expr $failed + 1`
+
 testit "del user"  $VALGRIND $pdbedit -x $USER $@ || failed=`expr $failed + 1`
 
 rm ./tmpsmbpasswdscript