summaryrefslogtreecommitdiff
path: root/python/samba/tests/dckeytab.py
AgeCommit message (Collapse)AuthorFilesLines
2024-07-17python:tests: make test_export_keytab_nochange_update() more reliableStefan Metzmacher1-6/+36
net.export_keytab() includes the current timestamp into the resulting keytab. So we need to make sure the two compared exports actually run within the same second. And klist may also print the keytab filename... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jul 17 14:21:30 UTC 2024 on atb-devel-224
2024-07-16python:tests: pass bytes.decode() instead of str(bytes) to ↵Stefan Metzmacher1-1/+2
assertMultiLineEqual() to get better failure output When not equal a diff of the two strings highlighting the differences will be included this way. This is a flapping test. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Jul 16 07:40:41 UTC 2024 on atb-devel-224
2024-07-15python:tests: Use assertMultiLineEqual() to get better failure outputAndreas Schneider1-1/+2
When not equal a diff of the two strings highlighting the differences will be included this way. This is a flapping test. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Jul 15 13:51:03 UTC 2024 on atb-devel-224
2024-05-22python:tests: Extract keytab_as_set() function to be usable by other testsJo Sutton1-41/+42
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22python:tests: Manually raise AssertionErrorJo Sutton1-1/+2
This removes the last dependency on ‘self’ in this method. Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22python:tests: Rename ‘keytab_as_set’ variable to be distinct from ↵Jo Sutton1-19/+19
keytab_as_set() method Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22samba.tests.dckeytab: add test_export_keytab_change3_update_only_current_keep()Stefan Metzmacher1-0/+49
This tests that only_current_keys=True works. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22s4:libnet_export_keytab: add only_current_keys optionStefan Metzmacher1-2/+2
By default we also export on the old and older passwords... In order to do a kinit with a keytab it might we useful to include only the current keys. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-24python:tests: Store keys as bytes rather than as lists of intsJo Sutton1-2/+2
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 24 06:20:58 UTC 2024 on atb-devel-224
2024-04-24python:tests: Rewrite condition of while loopJo Sutton1-3/+1
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-24python:tests: Store keys as bytes rather than as tuplesJo Sutton1-1/+1
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-16python:tests: Fix set declarationJo Sutton1-2/+2
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-08python:tests: Improve keytab comparison of dckeytabAndreas Schneider1-3/+20
This will give better output on failure as it compares strings instead of bytes. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-21python:tests: Simplify expressionJo Sutton1-2/+2
‘not keytab_bytes’ is shorter and equivalent. Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-21python:tests: Use Managed Service Accounts well‐known GUIDJo Sutton1-2/+5
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-03-14selftest: Add tests of samba-tool domain export-keytab --keep-stale-entries ↵Andrew Bartlett1-0/+201
behaviour Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2024-03-14selftest: Add tests for "samba-tool domain exportkeytab" with existing files"Andrew Bartlett1-8/+75
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2024-03-14python/tests: Add test that gMSA keytab export works and matches direct ↵Andrew Bartlett1-4/+123
keytab export Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2024-02-27python/tests: Use TestCaseInTempDir rather than "private dir" for exported ↵Andrew Bartlett1-3/+5
keytab Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2024-02-27python/tests: Convert dckeytab test to use new NDR keytab parserAndrew Bartlett1-18/+17
This is much nicer than reading strings out of the binary file. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
2023-11-30python: tests: update all super calls to python 3 style in testsRob van der Linde1-2/+2
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> [abartlet@samba.org Some python2 style super() calls remain due to being an actual, even if reasonable, behaviour change]
2020-07-17python: wrap 'import dckeytab' in an explanatory functionDouglas Bagnall1-1/+5
The samba.dckeytab module has magic effects on samba.net, but never appears to be used. That can be confusing, both to people and to linters. Here we wrap that confusion up into a well-commented function, so we never again have to wonder why the unused import is there. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
2018-09-06PEP8: fix E122: continuation line missing indentation or outdentedJoe Guo1-2/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24PEP8: fix E401: multiple imports on one lineJoe Guo1-1/+3
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E302: expected 2 blank lines, found 1Joe Guo1-0/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-24PEP8: fix E127: continuation line over-indented for visual indentJoe Guo1-2/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-03-23Add tests for dckeytab python moduleDavid Mulder1-0/+56
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>