From 2e230f728ec8026997183ad50ff6371961c9a9ea Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 21 Feb 2024 10:22:12 +1300 Subject: [PATCH] python/tests: Add test for new krb5 keytab parser Signed-off-by: Andrew Bartlett Reviewed-by: Jo Sutton --- python/samba/tests/blackbox/ndrdump.py | 18 +++++++ source4/librpc/tests/secrets.keytab | Bin 0 -> 827 bytes source4/librpc/tests/secrets.keytab.txt | 67 ++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 source4/librpc/tests/secrets.keytab create mode 100644 source4/librpc/tests/secrets.keytab.txt diff --git a/python/samba/tests/blackbox/ndrdump.py b/python/samba/tests/blackbox/ndrdump.py index 99aa7c181f2..47aedaa1e00 100644 --- a/python/samba/tests/blackbox/ndrdump.py +++ b/python/samba/tests/blackbox/ndrdump.py @@ -561,3 +561,21 @@ dump OK self.fail(e) self.assertEqual(actual, expected) + + def test_ndrdump_keyetab(self): + with open(self.data_path( + 'secrets.keytab.txt')) as f: + expected = f.read() + data_path = self.data_path( + 'secrets.keytab') + + # We don't do a validate on this as the parser deliberately + # ignores some extra data written by Heimdal, but not MIT. + try: + actual = self.check_output( + 'ndrdump krb5ccache KEYTAB struct ' + + data_path) + except BlackboxProcessError as e: + self.fail(e) + + self.assertEqual(actual, expected.encode('utf-8')) diff --git a/source4/librpc/tests/secrets.keytab b/source4/librpc/tests/secrets.keytab new file mode 100644 index 0000000000000000000000000000000000000000..f8fd5408b92dbd718f21da4b39210fd27eef5e51 GIT binary patch literal 827 zcmZQ&Vqjp1VPIkqcXV;__tgt_^mTI7bB%EH4e)W*bN2UTVDaz|4q;$POi4)wDrHQ) zd~yyWgAjwlnqT_s9JicgJj$hHd$~wg)W64qH)t{Ywf^3RyBZ6dZh;g7F$k0pHeUv0 zz8;Xs&($kV%uPzvORY%EEyzjLOU};)8bOx5;XoJQ^cO48!_F$?8tp^aOK3qR$RJR1 z)v$Lam(TWQu0Ll5y(7IVUSdq@fbJVpTkU5?