mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-28 18:28:23 -05:00
tests: P2P device discovery after fragmented GAS/ANQP exchange
This verifies cfg80211/mac80211 offchannel TX cancellation steps. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
759a8a3a99
commit
3bba9c71c5
@ -6,11 +6,13 @@
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger()
|
||||
import os
|
||||
import time
|
||||
|
||||
import hwsim_utils
|
||||
from wpasupplicant import WpaSupplicant
|
||||
from p2p_utils import *
|
||||
from test_gas import start_ap
|
||||
|
||||
def test_discovery(dev):
|
||||
"""P2P device discovery and provision discovery"""
|
||||
@ -514,3 +516,28 @@ def test_p2p_config_methods(dev):
|
||||
raise Exception("Unexpected peer config methods(2): " + peer['config_methods'])
|
||||
|
||||
wpas.p2p_stop_find()
|
||||
|
||||
def test_discovery_after_gas(dev, apdev):
|
||||
"""P2P device discovery after GAS/ANQP exchange"""
|
||||
hapd = start_ap(apdev[0])
|
||||
hapd.set("gas_frag_limit", "50")
|
||||
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412", force_scan=True)
|
||||
dev[0].request("FETCH_ANQP")
|
||||
ev = dev[0].wait_event(["ANQP-QUERY-DONE"], timeout=10)
|
||||
if ev is None:
|
||||
raise Exception("No ANQP-QUERY-DONE event")
|
||||
dev[0].dump_monitor()
|
||||
|
||||
start = os.times()[4]
|
||||
dev[0].p2p_listen()
|
||||
dev[1].p2p_find(social=True)
|
||||
ev = dev[1].wait_global_event(["P2P-DEVICE-FOUND"], timeout=5)
|
||||
if ev is None:
|
||||
raise Exception("Peer not discovered")
|
||||
end = os.times()[4]
|
||||
dev[0].dump_monitor()
|
||||
dev[0].p2p_stop_find()
|
||||
dev[1].p2p_stop_find()
|
||||
logger.info("Device discovery after fragmented GAS took %f seconds" % (end - start))
|
||||
if end - start > 1.3:
|
||||
raise Exception("Device discovery took unexpectedly long time")
|
||||
|
Loading…
Reference in New Issue
Block a user