]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make OCV negative test error cases more robust
authorJouni Malinen <quic_jouni@quicinc.com>
Thu, 16 Jun 2022 17:26:11 +0000 (20:26 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 16 Jun 2022 17:26:11 +0000 (20:26 +0300)
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 <quic_jouni@quicinc.com>
tests/hwsim/test_ocv.py

index f22d227177d2a098d2530908b08c7f149d87a2d5..a885be2ad4a3dc180ab7fcd2f4262c896f0e716c 100644 (file)
@@ -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):