From: Joseph Sutton Date: Tue, 13 Jun 2023 23:13:00 +0000 (+1200) Subject: tests/krb5: Keep track of the type of each created account X-Git-Tag: talloc-2.4.1~386 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01643b35273ba77b927fa3f337acecde71bd5e62;p=thirdparty%2Fsamba.git tests/krb5: Keep track of the type of each created account This allows us to determine which parts of an authentication policy apply to a particular account, which will be necessary to test audit logging. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/krb5/kdc_base_test.py b/python/samba/tests/krb5/kdc_base_test.py index b8412cd57ff..26b2dfbe655 100644 --- a/python/samba/tests/krb5/kdc_base_test.py +++ b/python/samba/tests/krb5/kdc_base_test.py @@ -879,6 +879,7 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): creds.set_dn(ldb.Dn(samdb, dn)) creds.set_upn(upn) creds.set_spn(spn) + creds.set_type(account_type) self.creds_set_enctypes(creds) diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py index 889a29a38c8..193fea80adc 100644 --- a/python/samba/tests/krb5/raw_testcase.py +++ b/python/samba/tests/krb5/raw_testcase.py @@ -396,6 +396,7 @@ class KerberosCredentials(Credentials): self.dn = None self.upn = None self.spn = None + self.account_type = None def set_as_supported_enctypes(self, value): self.as_supported_enctypes = int(value) @@ -528,6 +529,12 @@ class KerberosCredentials(Credentials): def get_upn(self): return self.upn + def set_type(self, account_type): + self.account_type = account_type + + def get_type(self): + return self.account_type + def update_password(self, password): self.set_password(password) self.set_kvno(self.get_kvno() + 1)