python:tests: Fix type error in raw_testcase.py
commit18dbdf6aace6e37f294781fe7e379da87558992a
authorAndreas Schneider <asn@samba.org>
Mon, 7 Mar 2022 10:22:29 +0000 (7 11:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 17 Mar 2022 00:41:33 +0000 (17 00:41 +0000)
treee903ccd2e0422f5651cd53bbefdce385aa525115
parent5294dc80090482d5669126802672eb2c89e269cf
python:tests: Fix type error in raw_testcase.py

This fixes a lot of tests with Python 3.8. Stacktrace example:

File "python/samba/tests/krb5/as_req_tests.py", line 249, in test_as_req_enc_timestamp_rc4_dummy
  self._run_as_req_enc_timestamp(
File "python/samba/tests/krb5/as_req_tests.py", line 129, in _run_as_req_enc_timestamp
  as_rep, kdc_exchange_dict = self._test_as_exchange(
File "python/samba/tests/krb5/raw_testcase.py", line 3982, in _test_as_exchange
  rep = self._generic_kdc_exchange(kdc_exchange_dict,
File "python/samba/tests/krb5/raw_testcase.py", line 2029, in _generic_kdc_exchange
  return check_rep_fn(kdc_exchange_dict, callback_dict, rep)
File "python/samba/tests/krb5/raw_testcase.py", line 2328, in generic_check_kdc_rep
  self.check_reply_padata(kdc_exchange_dict,
File "python/samba/tests/krb5/raw_testcase.py", line 2998, in check_reply_padata
  got_patypes = tuple(pa['padata-type'] for pa in rep_padata)
TypeError: 'NoneType' object is not iterable

This adds additional checks for rep_padata.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
python/samba/tests/krb5/raw_testcase.py