From: Jouni Malinen Date: Thu, 16 Jun 2022 17:26:11 +0000 (+0300) Subject: tests: Make OCV negative test error cases more robust X-Git-Tag: hostap_2_11~1857 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c580c2aecd2d1d7bd53b662ddd6aba76ac3c6a29;p=thirdparty%2Fhostap.git tests: Make OCV negative test error cases more robust Try to avoid an exception while processing an exception that indicates the test case failed. Explicit DISCONNECT command here can avoid the undesired FAIL-BUSY from cleanup SCAN. Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ocv.py b/tests/hwsim/test_ocv.py index f22d22717..a885be2ad 100644 --- a/tests/hwsim/test_ocv.py +++ b/tests/hwsim/test_ocv.py @@ -359,6 +359,7 @@ class APConnection: self.bssid = None self.anonce = None self.snonce = None + self.dev = None def __init__(self, apdev, dev, params): self.init_params() @@ -380,6 +381,7 @@ class APConnection: raise HwsimSkip("OCV not supported") raise self.hapd.request("SET ext_eapol_frame_io 1") + self.dev = dev dev.request("SET ext_eapol_frame_io 1") self.bssid = apdev['bssid'] @@ -415,6 +417,7 @@ class APConnection: self.rsne + ocikde, self.kck) self.msg = recv_eapol(self.hapd) if self.anonce != self.msg['rsn_key_nonce'] or self.msg["rsn_key_info"] != 138: + self.dev.request("DISCONNECT") raise Exception("Didn't receive retransmitted 1/4") def confirm_valid_oci(self, op_class, channel, seg1_idx):