From c580c2aecd2d1d7bd53b662ddd6aba76ac3c6a29 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 16 Jun 2022 20:26:11 +0300 Subject: [PATCH] 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 --- tests/hwsim/test_ocv.py | 3 +++ 1 file changed, 3 insertions(+) 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):