tests: AP with Probe Response frame sending from hostapd disabled
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
0447ef6cd5
commit
c0dd37f5f8
2 changed files with 22 additions and 3 deletions
|
@ -638,3 +638,17 @@ def test_ap_dtim_period(dev, apdev):
|
||||||
raise Exception("Unexpected DTIM period: %d" % period)
|
raise Exception("Unexpected DTIM period: %d" % period)
|
||||||
if count >= period:
|
if count >= period:
|
||||||
raise Exception("Unexpected DTIM count: %d" % count)
|
raise Exception("Unexpected DTIM count: %d" % count)
|
||||||
|
|
||||||
|
def test_ap_no_probe_resp(dev, apdev):
|
||||||
|
"""AP with Probe Response frame sending from hostapd disabled"""
|
||||||
|
ssid = "no-probe-resp"
|
||||||
|
params = { 'ssid': ssid, 'send_probe_response': "0" }
|
||||||
|
hapd = hostapd.add_ap(apdev[0], params)
|
||||||
|
bssid = hapd.own_addr()
|
||||||
|
dev[0].scan_for_bss(bssid, freq="2412", passive=True)
|
||||||
|
dev[0].scan_for_bss(bssid, freq="2412", force_scan=True)
|
||||||
|
dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412")
|
||||||
|
bss = dev[0].get_bss(bssid)
|
||||||
|
if 'ie' in bss and 'beacon_ie' in bss and \
|
||||||
|
len(bss['ie']) != len(bss['beacon_ie']):
|
||||||
|
raise Exception("Probe Response frames seen")
|
||||||
|
|
|
@ -1052,7 +1052,8 @@ class WpaSupplicant:
|
||||||
self.select_network(id)
|
self.select_network(id)
|
||||||
return id
|
return id
|
||||||
|
|
||||||
def scan(self, type=None, freq=None, no_wait=False, only_new=False):
|
def scan(self, type=None, freq=None, no_wait=False, only_new=False,
|
||||||
|
passive=False):
|
||||||
if type:
|
if type:
|
||||||
cmd = "SCAN TYPE=" + type
|
cmd = "SCAN TYPE=" + type
|
||||||
else:
|
else:
|
||||||
|
@ -1061,6 +1062,8 @@ class WpaSupplicant:
|
||||||
cmd = cmd + " freq=" + str(freq)
|
cmd = cmd + " freq=" + str(freq)
|
||||||
if only_new:
|
if only_new:
|
||||||
cmd += " only_new=1"
|
cmd += " only_new=1"
|
||||||
|
if passive:
|
||||||
|
cmd += " passive=1"
|
||||||
if not no_wait:
|
if not no_wait:
|
||||||
self.dump_monitor()
|
self.dump_monitor()
|
||||||
if not "OK" in self.request(cmd):
|
if not "OK" in self.request(cmd):
|
||||||
|
@ -1074,11 +1077,13 @@ class WpaSupplicant:
|
||||||
if "CTRL-EVENT-SCAN-FAILED" in ev:
|
if "CTRL-EVENT-SCAN-FAILED" in ev:
|
||||||
raise Exception("Scan failed: " + ev)
|
raise Exception("Scan failed: " + ev)
|
||||||
|
|
||||||
def scan_for_bss(self, bssid, freq=None, force_scan=False, only_new=False):
|
def scan_for_bss(self, bssid, freq=None, force_scan=False, only_new=False,
|
||||||
|
passive=False):
|
||||||
if not force_scan and self.get_bss(bssid) is not None:
|
if not force_scan and self.get_bss(bssid) is not None:
|
||||||
return
|
return
|
||||||
for i in range(0, 10):
|
for i in range(0, 10):
|
||||||
self.scan(freq=freq, type="ONLY", only_new=only_new)
|
self.scan(freq=freq, type="ONLY", only_new=only_new,
|
||||||
|
passive=passive)
|
||||||
if self.get_bss(bssid) is not None:
|
if self.get_bss(bssid) is not None:
|
||||||
return
|
return
|
||||||
raise Exception("Could not find BSS " + bssid + " in scan")
|
raise Exception("Could not find BSS " + bssid + " in scan")
|
||||||
|
|
Loading…
Reference in a new issue