From: Joseph Sutton Date: Wed, 17 May 2023 04:43:12 +0000 (+1200) Subject: tests/krb5: Set expected_status even if expect_status is not true X-Git-Tag: talloc-2.4.1~623 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d211d700ab9cb9724d491d08bcf8be4c4f6ffbfd;p=thirdparty%2Fsamba.git tests/krb5: Set expected_status even if expect_status is not true We might get an NTSTATUS code even if we aren’t explicitly saying that we expect one. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/krb5/lockout_tests.py b/python/samba/tests/krb5/lockout_tests.py index 4140e4f8825..25be0ce36dc 100755 --- a/python/samba/tests/krb5/lockout_tests.py +++ b/python/samba/tests/krb5/lockout_tests.py @@ -147,12 +147,13 @@ def connect_kdc(pipe, error_code = rep.get('error-code') if error_code == KDC_ERR_CLIENT_REVOKED: # The account was locked out. + kdc_exchange_dict['expected_status'] = ( + ntstatus.NT_STATUS_ACCOUNT_LOCKED_OUT) + if expect_status: # Expect to get a LOCKED_OUT NTSTATUS code. kdc_exchange_dict['expect_edata'] = True kdc_exchange_dict['expect_status'] = True - kdc_exchange_dict['expected_status'] = ( - ntstatus.NT_STATUS_ACCOUNT_LOCKED_OUT) elif error_code == KDC_ERR_PREAUTH_FAILED: # Just a wrong password: the account wasn’t locked out. Don’t