1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

tests/krb5: Improve mock RODC creation

Use a unique name for the mock RODC. Don't assign to _rodc_ctx until the
RODC has been created, so we don't try to use a mock RODC that failed to
create.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Joseph Sutton 2022-03-07 17:01:40 +13:00 committed by Joseph Sutton
parent e729606631
commit a9025b68b2

View File

@ -198,17 +198,19 @@ class KDCBaseTest(RawKerberosTest):
admin_creds = self.get_admin_creds()
lp = self.get_lp()
rodc_name = 'KRB5RODC'
rodc_name = self.get_new_username()
site_name = 'Default-First-Site-Name'
type(self)._rodc_ctx = DCJoinContext(server=self.dc_host,
creds=admin_creds,
lp=lp,
site=site_name,
netbios_name=rodc_name,
targetdir=None,
domain=None)
self.create_rodc(self._rodc_ctx)
rodc_ctx = DCJoinContext(server=self.dc_host,
creds=admin_creds,
lp=lp,
site=site_name,
netbios_name=rodc_name,
targetdir=None,
domain=None)
self.create_rodc(rodc_ctx)
type(self)._rodc_ctx = rodc_ctx
return self._rodc_ctx