]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dsdb/tests: let all BasePasswordTestCase tests provide self.host_url[_ldaps]
authorStefan Metzmacher <metze@samba.org>
Fri, 4 Mar 2022 23:09:17 +0000 (00:09 +0100)
committerJule Anger <janger@samba.org>
Wed, 16 Mar 2022 14:27:11 +0000 (14:27 +0000)
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)

source4/dsdb/tests/python/login_basics.py
source4/dsdb/tests/python/password_lockout.py
source4/dsdb/tests/python/rodc_rwdc.py

index d265441826de5b05fd9ae6daf3b98bb8ad9ca8a8..6b1d04ad8ceede9f732222d07fc9b855b5ad6bb1 100755 (executable)
@@ -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)
index 445944862b8a6f253f2aae61209a012d3a7690f2..e162f4e037d07459760798a610b3d646e647432d 100755 (executable)
@@ -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)
index 0340042e19d675fb4887e0d685b6c2b12130b602..1495a3d7f2a2f7d4336050143d58bd8f52206f60 100644 (file)
@@ -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)