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 <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2021-03-01 12:34:05 +02:00 committed by Jouni Malinen
parent e9d598d8a8
commit 8d80aa3fca

View file

@ -7273,6 +7273,13 @@ def run_openssl_systemwide_policy(iface, apdev, test_params):
logger.info("Start wpa_supplicant: " + str(arg)) logger.info("Start wpa_supplicant: " + str(arg))
subprocess.call(arg, env={'OPENSSL_CONF': openssl_cnf}) subprocess.call(arg, env={'OPENSSL_CONF': openssl_cnf})
wpas = WpaSupplicant(ifname=iface) 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"): if "PONG" not in wpas.request("PING"):
raise Exception("Could not PING wpa_supplicant") raise Exception("Could not PING wpa_supplicant")
tls = wpas.request("GET tls_library") 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.select_network(id, freq="2412")
wpas.wait_connected() wpas.wait_connected()
wpas.request("TERMINATE")
def test_ap_wpa2_eap_tls_tod(dev, apdev): def test_ap_wpa2_eap_tls_tod(dev, apdev):
"""EAP-TLS server certificate validation and TOD-STRICT""" """EAP-TLS server certificate validation and TOD-STRICT"""
check_tls_tod(dev[0]) check_tls_tod(dev[0])