aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2019-04-22 18:03:07 (GMT)
committerJouni Malinen <j@w1.fi>2019-04-22 19:08:07 (GMT)
commit64c20a831f23ae601aecbd6cb2e3537a432699c6 (patch)
treeb90aaa327efe01cabee4f7474747f257b8e7631f
parentfa335929b7c9469160661f92e55d860e7175e5f7 (diff)
downloadhostap-64c20a831f23ae601aecbd6cb2e3537a432699c6.zip
hostap-64c20a831f23ae601aecbd6cb2e3537a432699c6.tar.gz
hostap-64c20a831f23ae601aecbd6cb2e3537a432699c6.tar.bz2
tests: Channel switch started/completed events
Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_ap_csa.py19
-rw-r--r--tests/hwsim/test_ap_vht.py10
2 files changed, 29 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_csa.py b/tests/hwsim/test_ap_csa.py
index 662fc22..688055e 100644
--- a/tests/hwsim/test_ap_csa.py
+++ b/tests/hwsim/test_ap_csa.py
@@ -23,6 +23,19 @@ def connect(dev, apdev, **kwargs):
def switch_channel(ap, count, freq):
ap.request("CHAN_SWITCH " + str(count) + " " + str(freq))
+
+ ev = ap.wait_event(["CTRL-EVENT-STARTED-CHANNEL-SWITCH"], timeout=10)
+ if ev is None:
+ raise Exception("Channel switch start event not seen")
+ if "freq=" + str(freq) not in ev:
+ raise Exception("Unexpected channel in CS started event")
+
+ ev = ap.wait_event(["CTRL-EVENT-CHANNEL-SWITCH"], timeout=10)
+ if ev is None:
+ raise Exception("Channel switch completed event not seen")
+ if "freq=" + str(freq) not in ev:
+ raise Exception("Unexpected channel in CS completed event")
+
ev = ap.wait_event(["AP-CSA-FINISHED"], timeout=10)
if ev is None:
raise Exception("CSA finished event timed out")
@@ -30,6 +43,12 @@ def switch_channel(ap, count, freq):
raise Exception("Unexpected channel in CSA finished event")
def wait_channel_switch(dev, freq):
+ ev = dev.wait_event(["CTRL-EVENT-STARTED-CHANNEL-SWITCH"], timeout=5)
+ if ev is None:
+ raise Exception("Channel switch start not reported")
+ if "freq=%d" % freq not in ev:
+ raise Exception("Unexpected frequency in channel switch started: " + ev)
+
ev = dev.wait_event(["CTRL-EVENT-CHANNEL-SWITCH"], timeout=5)
if ev is None:
raise Exception("Channel switch not reported")
diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py
index cd98539..3fb7672 100644
--- a/tests/hwsim/test_ap_vht.py
+++ b/tests/hwsim/test_ap_vht.py
@@ -742,6 +742,16 @@ def test_ap_vht80_csa(dev, apdev):
hwsim_utils.test_connectivity(dev[0], hapd)
hapd.request("CHAN_SWITCH 5 5180 ht vht blocktx center_freq1=5210 sec_channel_offset=1 bandwidth=80")
+ ev = hapd.wait_event(["CTRL-EVENT-STARTED-CHANNEL-SWITCH"], timeout=10)
+ if ev is None:
+ raise Exception("Channel switch start event not seen")
+ if "freq=5180" not in ev:
+ raise Exception("Unexpected channel in CS started")
+ ev = hapd.wait_event(["CTRL-EVENT-CHANNEL-SWITCH"], timeout=10)
+ if ev is None:
+ raise Exception("Channel switch completion event not seen")
+ if "freq=5180" not in ev:
+ raise Exception("Unexpected channel in CS completed")
ev = hapd.wait_event(["AP-CSA-FINISHED"], timeout=10)
if ev is None:
raise Exception("CSA finished event timed out")