]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Handle unexpected get_driver_status_field() error
authorJouni Malinen <j@w1.fi>
Sun, 17 May 2020 10:04:26 +0000 (13:04 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 17 May 2020 10:04:26 +0000 (13:04 +0300)
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 <j@w1.fi>
tests/hwsim/run-tests.py

index 7ed632b669dd28a6cf4d82d3b59a3582a1ebfb08..019533f544235605f1983d2f1ecd0b9c4b2e4585 100755 (executable)
@@ -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)