From: Jouni Malinen Date: Mon, 1 Mar 2021 10:34:05 +0000 (+0200) Subject: tests: Fix openssl_systemwide_policy cleanup X-Git-Tag: hostap_2_10~485 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d80aa3fca8ef88d6721d3bef158b095fab45d5f;p=thirdparty%2Fhostap.git tests: Fix openssl_systemwide_policy cleanup Need to close the WpaSupplicant instance on the extra radio before returning from this test case since that interface is going to be removed and WpaSupplicant.__del__() can time out on trying to detach the monitor connection after that. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 88e03dfe6..6092b54c9 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -7273,6 +7273,13 @@ def run_openssl_systemwide_policy(iface, apdev, test_params): logger.info("Start wpa_supplicant: " + str(arg)) subprocess.call(arg, env={'OPENSSL_CONF': openssl_cnf}) wpas = WpaSupplicant(ifname=iface) + try: + finish_openssl_systemwide_policy(wpas) + finally: + wpas.close_monitor() + wpas.request("TERMINATE") + +def finish_openssl_systemwide_policy(wpas): if "PONG" not in wpas.request("PING"): raise Exception("Could not PING wpa_supplicant") tls = wpas.request("GET tls_library") @@ -7305,8 +7312,6 @@ def run_openssl_systemwide_policy(iface, apdev, test_params): wpas.select_network(id, freq="2412") wpas.wait_connected() - wpas.request("TERMINATE") - def test_ap_wpa2_eap_tls_tod(dev, apdev): """EAP-TLS server certificate validation and TOD-STRICT""" check_tls_tod(dev[0])