From 8916857da69bc28de8c6b5405dfb718d82d12d02 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 20 Dec 2014 18:29:57 +0200 Subject: [PATCH] tests: TDLS with VHT This adds some more coverage, but the TDLS setup is not for VHT due to missing support in mac80211. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_tdls.py | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/tests/hwsim/test_ap_tdls.py b/tests/hwsim/test_ap_tdls.py index 2670aaf17..f4ba292d1 100644 --- a/tests/hwsim/test_ap_tdls.py +++ b/tests/hwsim/test_ap_tdls.py @@ -49,9 +49,9 @@ def connect_2sta_wep(dev, hapd): scan_freq="2412") connectivity(dev, hapd) -def connect_2sta_open(dev, hapd): - dev[0].connect("test-open", key_mgmt="NONE", scan_freq="2412") - dev[1].connect("test-open", key_mgmt="NONE", scan_freq="2412") +def connect_2sta_open(dev, hapd, scan_freq="2412"): + dev[0].connect("test-open", key_mgmt="NONE", scan_freq=scan_freq) + dev[1].connect("test-open", key_mgmt="NONE", scan_freq=scan_freq) connectivity(dev, hapd) def wlantest_setup(): @@ -329,3 +329,32 @@ def test_ap_wpa2_tdls_responder_teardown(dev, apdev): connect_2sta_wpa2_psk(dev, hapd) setup_tdls(dev[0], dev[1], apdev[0]) teardown_tdls(dev[0], dev[1], apdev[0], responder=True) + +def test_ap_open_tdls_vht(dev, apdev): + """Open AP and two stations using TDLS""" + params = { "ssid": "test-open", + "country_code": "DE", + "hw_mode": "a", + "channel": "36", + "ieee80211n": "1", + "ieee80211ac": "1", + "ht_capab": "", + "vht_capab": "", + "vht_oper_chwidth": "0", + "vht_oper_centr_freq_seg0_idx": "0" } + try: + hapd = hostapd.add_ap(apdev[0]['ifname'], params) + wlantest_setup() + connect_2sta_open(dev, hapd, scan_freq="5180") + setup_tdls(dev[0], dev[1], apdev[0]) + teardown_tdls(dev[0], dev[1], apdev[0]) + setup_tdls(dev[1], dev[0], apdev[0]) + teardown_tdls(dev[1], dev[0], apdev[0], wildcard=True) + finally: + dev[0].request("DISCONNECT") + dev[1].request("DISCONNECT") + if hapd: + hapd.request("DISABLE") + subprocess.call(['sudo', 'iw', 'reg', 'set', '00']) + dev[0].flush_scan_cache() + dev[1].flush_scan_cache()