]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix openssl_systemwide_policy cleanup
authorJouni Malinen <jouni@codeaurora.org>
Mon, 1 Mar 2021 10:34:05 +0000 (12:34 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 1 Mar 2021 10:34:05 +0000 (12:34 +0200)
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 <jouni@codeaurora.org>
tests/hwsim/test_ap_eap.py

index 88e03dfe6ceede9391abd0d9f87566b05afc678e..6092b54c9c9c9f02d635f3c02c1cfa60c17e78b7 100644 (file)
@@ -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])