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 <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2022-06-16 20:26:11 +03:00 committed by Jouni Malinen
parent 3c2ba98add
commit c580c2aecd

View file

@ -359,6 +359,7 @@ class APConnection:
self.bssid = None self.bssid = None
self.anonce = None self.anonce = None
self.snonce = None self.snonce = None
self.dev = None
def __init__(self, apdev, dev, params): def __init__(self, apdev, dev, params):
self.init_params() self.init_params()
@ -380,6 +381,7 @@ class APConnection:
raise HwsimSkip("OCV not supported") raise HwsimSkip("OCV not supported")
raise raise
self.hapd.request("SET ext_eapol_frame_io 1") self.hapd.request("SET ext_eapol_frame_io 1")
self.dev = dev
dev.request("SET ext_eapol_frame_io 1") dev.request("SET ext_eapol_frame_io 1")
self.bssid = apdev['bssid'] self.bssid = apdev['bssid']
@ -415,6 +417,7 @@ class APConnection:
self.rsne + ocikde, self.kck) self.rsne + ocikde, self.kck)
self.msg = recv_eapol(self.hapd) self.msg = recv_eapol(self.hapd)
if self.anonce != self.msg['rsn_key_nonce'] or self.msg["rsn_key_info"] != 138: 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") raise Exception("Didn't receive retransmitted 1/4")
def confirm_valid_oci(self, op_class, channel, seg1_idx): def confirm_valid_oci(self, op_class, channel, seg1_idx):