1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-23 00:23:53 +03:00

python:tests/krb5: add remove_pac_buffers()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Stefan Metzmacher
2025-02-06 16:47:30 +01:00
committed by Ralph Boehme
parent bcd1157983
commit fabf0d1565

View File

@@ -2362,6 +2362,19 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest):
return pac
def remove_pac_buffers(self, pac, *, pac_buffer_type=None):
old_buffers = pac.buffers
new_buffers = []
for pac_buffer in old_buffers:
if pac_buffer.type != pac_buffer_type:
new_buffers.append(pac_buffer)
pac.buffers = new_buffers
pac.num_buffers = len(new_buffers)
return pac
def get_cached_creds(self, *,
account_type: AccountType,
opts: Optional[dict]=None,