Ejemplo n.º 1
0
def test_offchannel_tx_roc_gas(dev, apdev):
    """GAS using cfg80211 remain-on-channel for offchannel TX"""
    start_ap(apdev[0])
    bssid = apdev[0]['bssid']

    wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
    wpas.interface_add("wlan5", drv_params="no_offchannel_tx=1")
    wpas.scan(freq="2412")
    anqp_get(wpas, bssid, 263)
    ev = wpas.wait_event(["GAS-QUERY-DONE"], timeout=10)
    if ev is None:
        raise Exception("GAS query timed out")
    if "result=SUCCESS" not in ev:
        raise Exception("Unexpected GAS query result")
Ejemplo n.º 2
0
def test_offchannel_tx_roc_gas(dev, apdev):
    """GAS using cfg80211 remain-on-channel for offchannel TX"""
    start_ap(apdev[0])
    bssid = apdev[0]['bssid']

    wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
    wpas.interface_add("wlan5", drv_params="no_offchannel_tx=1")
    wpas.scan(freq="2412")
    anqp_get(wpas, bssid, 263)
    ev = wpas.wait_event(["GAS-QUERY-DONE"], timeout=10)
    if ev is None:
        raise Exception("GAS query timed out")
    if "result=SUCCESS" not in ev:
        raise Exception("Unexpected GAS query result")
Ejemplo n.º 3
0
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")
Ejemplo n.º 4
0
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")