aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2018-10-11 13:38:26 (GMT)
committerJouni Malinen <j@w1.fi>2018-12-23 15:25:11 (GMT)
commit7afbbcd2edf791dc19dc208e4af7e1f91c11e01c (patch)
tree7ddfa1c018ae3a952a90d161737309f5c6776ff8 /tests
parent95cd50a1ede52b9759f65e203512166232ceebe5 (diff)
downloadhostap-7afbbcd2edf791dc19dc208e4af7e1f91c11e01c.zip
hostap-7afbbcd2edf791dc19dc208e4af7e1f91c11e01c.tar.gz
hostap-7afbbcd2edf791dc19dc208e4af7e1f91c11e01c.tar.bz2
tests: Validate that AP doesn't reflect station frames
Add a new test to check that the AP won't send frames to the client if it tries to talk to itself. Note that this fails until the relevant mac80211 patch is merged. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_ap_open.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/hwsim/test_ap_open.py b/tests/hwsim/test_ap_open.py
index 45fb792..7e4a8c1 100644
--- a/tests/hwsim/test_ap_open.py
+++ b/tests/hwsim/test_ap_open.py
@@ -814,3 +814,30 @@ def test_ap_open_reassoc_same(dev, apdev):
hwsim_utils.test_connectivity(dev[0], hapd)
finally:
dev[0].request("SET reassoc_same_bss_optim 0")
+
+def test_ap_open_no_reflection(dev, apdev):
+ """AP with open mode, STA sending packets to itself"""
+ hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
+ dev[0].connect("open", key_mgmt="NONE", scan_freq="2412")
+
+ ev = hapd.wait_event([ "AP-STA-CONNECTED" ], timeout=5)
+ if ev is None:
+ raise Exception("No connection event received from hostapd")
+ # test normal connectivity is OK
+ hwsim_utils.test_connectivity(dev[0], hapd)
+
+ # test that we can't talk to ourselves
+ addr = dev[0].own_addr()
+ res = dev[0].request('DATA_TEST_CONFIG 1')
+ try:
+ assert 'OK' in res
+
+ cmd = "DATA_TEST_TX {} {} {}".format(addr, addr, 0)
+ dev[0].request(cmd)
+
+ ev = dev[0].wait_event(["DATA-TEST-RX"], timeout=1)
+
+ if ev is not None and "DATA-TEST-RX {} {}".format(addr, addr) in ev:
+ raise Exception("STA can unexpectedly talk to itself")
+ finally:
+ dev[0].request('DATA_TEST_CONFIG 0')