tests: disable_sgi with VHT

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2019-01-06 20:51:32 +02:00
parent fd83a80815
commit 2e71d0415b
2 changed files with 18 additions and 12 deletions

View file

@ -12,7 +12,7 @@ import subprocess, time
import hwsim_utils
import hostapd
from utils import HwsimSkip
from utils import *
from test_dfs import wait_dfs_event
from test_ap_csa import csa_supported
from test_ap_ht import clear_scan_cache
@ -148,6 +148,8 @@ def test_ap_vht80_params(dev, apdev):
dev[1].connect("vht", key_mgmt="NONE", scan_freq="5180",
disable_vht="1", wait_connect=False)
dev[0].connect("vht", key_mgmt="NONE", scan_freq="5180")
dev[2].connect("vht", key_mgmt="NONE", scan_freq="5180",
disable_sgi="1")
ev = dev[1].wait_event(["CTRL-EVENT-ASSOC-REJECT"])
if ev is None:
raise Exception("Association rejection timed out")
@ -155,19 +157,21 @@ def test_ap_vht80_params(dev, apdev):
raise Exception("Unexpected rejection status code")
dev[1].request("DISCONNECT")
hwsim_utils.test_connectivity(dev[0], hapd)
sta0 = hapd.get_sta(dev[0].own_addr())
sta2 = hapd.get_sta(dev[2].own_addr())
capab0 = int(sta0['vht_caps_info'], base=16)
capab2 = int(sta2['vht_caps_info'], base=16)
if capab0 & 0x60 == 0:
raise Exception("dev[0] did not support SGI")
if capab2 & 0x60 != 0:
raise Exception("dev[2] claimed support for SGI")
except Exception, e:
if isinstance(e, Exception) and str(e) == "AP startup failed":
if not vht_supported():
raise HwsimSkip("80 MHz channel not supported in regulatory information")
raise
finally:
dev[0].request("DISCONNECT")
dev[1].request("DISCONNECT")
if hapd:
hapd.request("DISABLE")
subprocess.call(['iw', 'reg', 'set', '00'])
dev[0].flush_scan_cache()
dev[1].flush_scan_cache()
clear_regdom(hapd, dev, count=3)
def test_ap_vht80_invalid(dev, apdev):
"""VHT with invalid 80 MHz channel configuration (seg1)"""

View file

@ -146,12 +146,13 @@ def clear_country(dev):
dev[0].dump_monitor()
dev[1].dump_monitor()
def clear_regdom(hapd, dev):
def clear_regdom(hapd, dev, count=1):
if hapd:
hapd.request("DISABLE")
time.sleep(0.1)
dev[0].request("DISCONNECT")
dev[0].request("ABORT_SCAN")
for i in range(count):
dev[i].request("DISCONNECT")
dev[i].request("ABORT_SCAN")
dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=0.5)
subprocess.call(['iw', 'reg', 'set', '00'])
wait_regdom_changes(dev[0])
@ -159,4 +160,5 @@ def clear_regdom(hapd, dev):
logger.info("Country code at the end: " + country)
if country != "00":
clear_country(dev)
dev[0].flush_scan_cache()
for i in range(count):
dev[i].flush_scan_cache()