From: Andreas Schneider Date: Thu, 16 Dec 2021 06:24:58 +0000 (+0100) Subject: python:tests: Don't require an emtpy 'authorization-data' to be present X-Git-Tag: tdb-1.4.6~252 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2da538a4585bc8ead5fc4e4c4422b8fe638cb621;p=thirdparty%2Fsamba.git python:tests: Don't require an emtpy 'authorization-data' to be present Signed-off-by: Andreas Schneider Reviewed-by: Joseph Sutton Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Mon Dec 20 17:01:11 UTC 2021 on sn-devel-184 --- diff --git a/python/samba/tests/krb5/raw_testcase.py b/python/samba/tests/krb5/raw_testcase.py index d11f628d7b6..1496ff961cd 100644 --- a/python/samba/tests/krb5/raw_testcase.py +++ b/python/samba/tests/krb5/raw_testcase.py @@ -2490,8 +2490,21 @@ class RawKerberosTest(TestCaseInTempDir): if self.strict_checking: self.assertElementEqual(ticket_private, 'caddr', []) if expect_pac is not None: - self.assertElementPresent(ticket_private, 'authorization-data', - expect_empty=not expect_pac) + if expect_pac: + self.assertElementPresent(ticket_private, + 'authorization-data', + expect_empty=not expect_pac) + else: + # It is more correct to not have an authorization-data + # present than an empty one. + # + # https://github.com/krb5/krb5/pull/1225#issuecomment-995104193 + v = self.getElementValue(ticket_private, + 'authorization-data') + if v is not None: + self.assertElementPresent(ticket_private, + 'authorization-data', + expect_empty=True) encpart_session_key = None if encpart_private is not None: