X-Git-Url: http://www.project-moonshot.org/gitweb/?p=mech_eap.git;a=blobdiff_plain;f=libeap%2Ftests%2Fhwsim%2Ftest_offchannel_tx.py;fp=libeap%2Ftests%2Fhwsim%2Ftest_offchannel_tx.py;h=85308da268475d3643970d0057f8dbf8136a077b;hp=0000000000000000000000000000000000000000;hb=f3746d009c6d7f50025af1f58a85e5fee9680be6;hpb=244f18d04aaf29e68495b5ffeb40ef5cca50942f diff --git a/libeap/tests/hwsim/test_offchannel_tx.py b/libeap/tests/hwsim/test_offchannel_tx.py new file mode 100644 index 0000000..85308da --- /dev/null +++ b/libeap/tests/hwsim/test_offchannel_tx.py @@ -0,0 +1,50 @@ +# cfg80211 offchannel TX using remain-on-channel +# Copyright (c) 2014, Jouni Malinen +# +# This software may be distributed under the terms of the BSD license. +# See README for more details. + +import logging +logger = logging.getLogger() + +import hostapd +from wpasupplicant import WpaSupplicant +from test_gas import start_ap +from test_gas import anqp_get +from p2p_utils import * + +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.flush_scan_cache() + wpas.scan_for_bss(bssid, 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") + +def test_offchannel_tx_roc_grpform(dev, apdev): + """P2P group formation using cfg80211 remain-on-channel for offchannel TX""" + wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') + wpas.interface_add("wlan5", drv_params="no_offchannel_tx=1") + + [i_res, r_res] = go_neg_pin_authorized(i_dev=dev[0], i_freq=2412, + r_dev=wpas, r_freq=2412) + check_grpform_results(i_res, r_res) + remove_group(dev[0], wpas) + +def test_offchannel_tx_roc_grpform2(dev, apdev): + """P2P group formation(2) using cfg80211 remain-on-channel for offchannel TX""" + wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') + wpas.interface_add("wlan5", drv_params="no_offchannel_tx=1") + + [i_res, r_res] = go_neg_pin_authorized(i_dev=wpas, i_freq=2412, + r_dev=dev[0], r_freq=2412) + check_grpform_results(i_res, r_res) + remove_group(dev[0], wpas)