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])