From: Jouni Malinen Date: Sun, 17 May 2020 10:04:26 +0000 (+0300) Subject: tests: Handle unexpected get_driver_status_field() error X-Git-Tag: hostap_2_10~1278 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78c823de4e63b5e1172908f5caef2c20ea4b97c3;p=thirdparty%2Fhostap.git tests: Handle unexpected get_driver_status_field() error If the current country code cannot be fetched, do not try to report the current value in the log since that will result in TypeError exception. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py index 7ed632b66..019533f54 100755 --- a/tests/hwsim/run-tests.py +++ b/tests/hwsim/run-tests.py @@ -537,7 +537,9 @@ def main(): if check_country_00: for d in dev: country = d.get_driver_status_field("country") - if country != "00": + if country is None: + logger.info(d.ifname + ": Could not fetch country code after the test case run") + elif country != "00": d.dump_monitor() logger.info(d.ifname + ": Country code not reset back to 00: is " + country) print(d.ifname + ": Country code not reset back to 00: is " + country)