From: Jouni Malinen Date: Sat, 27 Feb 2021 16:10:41 +0000 (+0200) Subject: tests: Work around exception handling issue in wpas_config_file X-Git-Tag: hostap_2_10~514 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=468efe79a764f1a5bf57d2f3d6f5fc5f7a92ada2;p=thirdparty%2Fhostap.git tests: Work around exception handling issue in wpas_config_file Raising an exception while the wlan5 interface was remove (i.e., between wpas.interface_remove() and .interface_add() calls) would result in the cleanup code failing and generating yet another exception while the first one was being processed. Work around this by re-adding the wlan5 interface back temporarily if the interface is not available for the cleanup operations. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_wpas_config.py b/tests/hwsim/test_wpas_config.py index 6bf62d0b7..d105fed0d 100644 --- a/tests/hwsim/test_wpas_config.py +++ b/tests/hwsim/test_wpas_config.py @@ -284,6 +284,8 @@ def test_wpas_config_file(dev, apdev, params): os.rmdir(config) except: pass + if not wpas.ifname: + wpas.interface_add("wlan5") wpas.dump_monitor() wpas.request("SET country 00") wpas.wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=1)