diff options
author | Stefan Metzmacher <metze@samba.org> | 2022-03-05 00:09:17 +0100 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-03-16 14:27:11 +0000 |
commit | 6e43d4ca919698c2153262294961fef944312dd8 (patch) | |
tree | 3e311fa0b529fb1ae8c1cb9e4dac058d5e704f81 | |
parent | 657c7c9a34bd8a848ac2d41cb2541c51e5716563 (diff) | |
download | samba-6e43d4ca919698c2153262294961fef944312dd8.tar.gz |
dsdb/tests: let all BasePasswordTestCase tests provide self.host_url[_ldaps]
This will make further changes easier.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13879
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit 5a3214c99048a88b0a9f509e3b5b38326529b02c)
-rwxr-xr-x | source4/dsdb/tests/python/login_basics.py | 5 | ||||
-rwxr-xr-x | source4/dsdb/tests/python/password_lockout.py | 7 | ||||
-rw-r--r-- | source4/dsdb/tests/python/rodc_rwdc.py | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/source4/dsdb/tests/python/login_basics.py b/source4/dsdb/tests/python/login_basics.py index d265441826d..6b1d04ad8ce 100755 --- a/source4/dsdb/tests/python/login_basics.py +++ b/source4/dsdb/tests/python/login_basics.py @@ -48,7 +48,8 @@ class BasicUserAuthTests(BasePasswordTestCase): def setUp(self): self.host = host - self.host_url = host_url + self.host_url = "ldap://%s" % host + self.host_url_ldaps = "ldaps://%s" % host self.lp = lp self.global_creds = global_creds self.ldb = SamDB(url=self.host_url, credentials=self.global_creds, @@ -180,6 +181,4 @@ userPassword: %s self._test_login_basics(self.lockout1ntlm_creds) -host_url = "ldap://%s" % host - TestProgram(module=__name__, opts=subunitopts) diff --git a/source4/dsdb/tests/python/password_lockout.py b/source4/dsdb/tests/python/password_lockout.py index 445944862b8..e162f4e037d 100755 --- a/source4/dsdb/tests/python/password_lockout.py +++ b/source4/dsdb/tests/python/password_lockout.py @@ -69,7 +69,8 @@ import password_lockout_base class PasswordTests(password_lockout_base.BasePasswordTestCase): def setUp(self): self.host = host - self.host_url = host_url + self.host_url = "ldap://%s" % host + self.host_url_ldaps = "ldaps://%s" % host self.lp = lp self.global_creds = global_creds self.ldb = SamDB(url=self.host_url, session_info=system_session(self.lp), @@ -140,7 +141,7 @@ lockoutTime: 0 cmd = cmd_sambatool.subcommands['user'].subcommands['unlock'] result = cmd._run("samba-tool user unlock", username, - "-H%s" % host_url, + "-H%s" % self.host_url, "-U%s%%%s" % (global_creds.get_username(), global_creds.get_password())) self.assertEqual(result, None) @@ -1422,6 +1423,4 @@ class PasswordTestsWithDefaults(PasswordTests): self._test_login_lockout(self.lockout1ntlm_creds, wait_lockout_duration=False) -host_url = "ldap://%s" % host - TestProgram(module=__name__, opts=subunitopts) diff --git a/source4/dsdb/tests/python/rodc_rwdc.py b/source4/dsdb/tests/python/rodc_rwdc.py index 0340042e19d..1495a3d7f2a 100644 --- a/source4/dsdb/tests/python/rodc_rwdc.py +++ b/source4/dsdb/tests/python/rodc_rwdc.py @@ -205,11 +205,13 @@ class RodcRwdcCachedTests(password_lockout_base.BasePasswordTestCase): self.global_creds = CREDS self.host = RWDC self.host_url = 'ldap://%s' % RWDC + self.host_url_ldaps = 'ldaps://%s' % RWDC self.ldb = SamDB(url='ldap://%s' % RWDC, session_info=system_session(self.lp), credentials=self.global_creds, lp=self.lp) super(RodcRwdcCachedTests, self).setUp() self.host_url = 'ldap://%s' % RODC + self.host_url_ldaps = 'ldaps://%s' % RODC self.samr = samr.samr("ncacn_ip_tcp:%s[seal]" % self.host, self.lp, self.global_creds) self.samr_handle = self.samr.Connect2(None, security.SEC_FLAG_MAXIMUM_ALLOWED) @@ -744,12 +746,14 @@ class RodcRwdcTests(password_lockout_base.BasePasswordTestCase): self.global_creds = CREDS self.host = RWDC self.host_url = 'ldap://%s' % RWDC + self.host_url_ldaps = 'ldaps://%s' % RWDC self.ldb = SamDB(url='ldap://%s' % RWDC, session_info=system_session(self.lp), credentials=self.global_creds, lp=self.lp) super(RodcRwdcTests, self).setUp() self.host = RODC self.host_url = 'ldap://%s' % RODC + self.host_url_ldaps = 'ldaps://%s' % RODC self.ldb = SamDB(url='ldap://%s' % RODC, session_info=system_session(self.lp), credentials=self.global_creds, lp=self.lp) |