From: Andreas Schneider Date: Mon, 21 Aug 2017 10:23:56 +0000 (+0200) Subject: s3:tests: Add test for changing the local user password with smbpasswd X-Git-Tag: tdb-1.3.15~20 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=531ef64bf87ac849c24ebf129faec4c4131fde40;p=thirdparty%2Fsamba.git s3:tests: Add test for changing the local user password with smbpasswd BUG: https://bugzilla.samba.org/show_bug.cgi?id=12975 Signed-off-by: Andreas Schneider Reviewed-by: Andrew Bartlet Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Wed Aug 23 17:05:48 CEST 2017 on sn-devel-144 --- diff --git a/source3/script/tests/test_smbpasswd.sh b/source3/script/tests/test_smbpasswd.sh new file mode 100755 index 00000000000..62b37a016a3 --- /dev/null +++ b/source3/script/tests/test_smbpasswd.sh @@ -0,0 +1,132 @@ +#!/bin/sh +# +# Blackbox tests for smbpasswd +# +# Copyright (c) 2015-2016 Andreas Schneider +# + +if [ $# -lt 4 ]; then +cat < $tmpfile < $tmpfile </dev/null 2>&1 + ret=$? + if [ $ret -ne 0 ]; then + echo "Failed to change password for user $user" + echo "$out" + return 1 + fi +} + +testit "Create user $samba_test_user" \ + create_local_smb_user $samba_test_user $samba_test_user_pwd \ + || failed=$(expr $failed + 1) + +testit "Change user password" \ + test_smbpasswd $samba_test_user $samba_test_user_pwd $samba_test_user_new_pwd \ + || failed=$(expr $failed + 1) + +testit "Delete user $samba_test_user" \ + delete_local_smb_user $samba_test_user \ + || failed=$(expr $failed + 1) + +exit $failed diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index a624f85b8f6..7e1f2135044 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -188,6 +188,9 @@ for options in ["--option=clientntlmv2auth=no", "--option=clientusespnego=no --o env="ad_dc" plantestsuite("samba3.blackbox.smbspool", env, [os.path.join(samba3srcdir, "script/tests/test_smbspool.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', env]) +for env in ["ad_member:local", "nt4_dc:local"]: + plantestsuite("samba3.blackbox.smbpasswd", env, [os.path.join(samba3srcdir, "script/tests/test_smbpasswd.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD']) + env="nt4_dc" plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) ipv6" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IPV6', '$SERVER/$USERNAME', '$PASSWORD', smbclient3, configuration])