aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-08-13 17:57:23 (GMT)
committerJouni Malinen <j@w1.fi>2015-08-13 18:06:23 (GMT)
commit76de2b6708e050caf1f84c9ddc2c435c9f2e114a (patch)
treee34f6cfd8aad62880ca4d158ce19eae32832179f
parent75055a538b344425c91f0b70e99121f1e758fef5 (diff)
downloadhostap-76de2b6708e050caf1f84c9ddc2c435c9f2e114a.zip
hostap-76de2b6708e050caf1f84c9ddc2c435c9f2e114a.tar.gz
hostap-76de2b6708e050caf1f84c9ddc2c435c9f2e114a.tar.bz2
tests: Scan and TSF updates from Beacon/Probe Response frames
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
-rw-r--r--tests/hwsim/test_scan.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py
index d0e94f9..ad2abbd 100644
--- a/tests/hwsim/test_scan.py
+++ b/tests/hwsim/test_scan.py
@@ -86,6 +86,30 @@ def test_scan(dev, apdev):
logger.info("Active single-channel scan on AP's operating channel")
check_scan_retry(dev[0], "freq=2412 passive=0 use_id=1", bssid)
+def test_scan_tsf(dev, apdev):
+ """Scan and TSF updates from Beacon/Probe Response frames"""
+ hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan",
+ 'beacon_int': "100" })
+ bssid = apdev[0]['bssid']
+
+ tsf = []
+ for passive in [ 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1 ]:
+ check_scan(dev[0], "freq=2412 passive=%d use_id=1" % passive)
+ bss = dev[0].get_bss(bssid)
+ if bss:
+ tsf.append(int(bss['tsf']))
+ logger.info("TSF: " + bss['tsf'])
+ if tsf[-3] <= tsf[-4]:
+ # For now, only write this in the log without failing the test case
+ # since mac80211_hwsim does not yet update the Timestamp field in
+ # Probe Response frames.
+ logger.info("Probe Response did not update TSF")
+ #raise Exception("Probe Response did not update TSF")
+ if tsf[-1] <= tsf[-3]:
+ raise Exception("Beacon did not update TSF")
+ if 0 in tsf:
+ raise Exception("0 TSF reported")
+
def test_scan_only(dev, apdev):
"""Control interface behavior on scan parameters with type=only"""
hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan" })