From: Jouni Malinen Date: Sun, 20 Dec 2015 19:06:21 +0000 (+0200) Subject: tests: Modify gas_malformed_comeback_resp to allow GAS retries X-Git-Tag: hostap_2_6~1134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9a9304479ac951fc3fdb7801168b5f5391eb391;p=thirdparty%2Fhostap.git tests: Modify gas_malformed_comeback_resp to allow GAS retries This is in preparation of a wpa_supplicant change to allow GAS retries which can result in the previous test case design showing failures due to "unexpected" management frames (GAS Initial Request from the retry). Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index 3279582e7..e8eac9fe0 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -612,6 +612,13 @@ def init_gas(hapd, bssid, dev): raise Exception("Unexpected dialog token change") return query, dialog_token +def allow_gas_initial_req(hapd, dialog_token): + msg = hapd.mgmt_rx(timeout=1) + if msg is not None: + gas = parse_gas(msg['payload']) + if gas['action'] != GAS_INITIAL_REQUEST or dialog_token == gas['dialog_token']: + raise Exception("Unexpected management frame") + def test_gas_malformed_comeback_resp(dev, apdev): """GAS malformed comeback response frames""" hapd = start_ap(apdev[0]) @@ -671,9 +678,7 @@ def test_gas_malformed_comeback_resp(dev, apdev): resp = action_response(query) resp['payload'] = anqp_initial_resp(dialog_token, 0) + struct.pack('