diff options
| author | Andreas Schneider <asn@samba.org> | 2026-03-25 11:37:09 +0100 |
|---|---|---|
| committer | Andreas Schneider <asn@cryptomilk.org> | 2026-03-30 09:37:33 +0000 |
| commit | fed52c9b95cf4f7628749b78843ac4189afa0950 (patch) | |
| tree | c9d4729f9616e57a5a34e6350767680e8b55d020 /python/samba/tests | |
| parent | c28a86c45d9d9673de18f9c29ea80dff12c9e7dd (diff) | |
| download | samba-fed52c9b95cf4f7628749b78843ac4189afa0950.tar.gz samba-fed52c9b95cf4f7628749b78843ac4189afa0950.tar.bz2 samba-fed52c9b95cf4f7628749b78843ac4189afa0950.zip | |
python:tests: Fix assertEqual placement in test_device_group_restrictions
The assertEqual calls checking the exception attributes were incorrectly
indented inside the 'with self.assertRaises()' block. When the expected
NTSTATUSError is raised by verify_access(), execution exits the block
immediately, so those lines were never reached.
When the exception is not raised (e.g. with MIT KRB5 1.22 where a spurious FAST
error was fixed), execution falls through to the assertEqual inside the block,
causing AttributeError because error.exception is only available after the
'with' block exits.
The exception returned is NT_STATUS_UNSUCCESSFUL with Heimdal.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Diffstat (limited to 'python/samba/tests')
| -rwxr-xr-x | python/samba/tests/blackbox/claims.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/python/samba/tests/blackbox/claims.py b/python/samba/tests/blackbox/claims.py index da616e3b726..2e53ae80241 100755 --- a/python/samba/tests/blackbox/claims.py +++ b/python/samba/tests/blackbox/claims.py @@ -92,11 +92,10 @@ class ClaimsSupportTests(BlackboxTestCase): device_password=device_password, ) - self.assertEqual(error.exception.args[0], NT_STATUS_LOGON_FAILURE) - self.assertEqual( - error.exception.args[1], - "The attempted logon is invalid. This is either due to a " - "bad username or authentication information.") + self.assertEqual(error.exception.args[0], NT_STATUS_UNSUCCESSFUL) + self.assertIn( + "The requested operation was unsuccessful.", + error.exception.args[1]) self.check_run("group addmembers allowed-devices claims-device") |
