mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-23 15:32:33 +00:00
2e0f41e73a
Cherry-pick Multi-AP commits from uptream: 9c06f0f6a hostapd: Add Multi-AP protocol support 5abc7823b wpa_supplicant: Add Multi-AP backhaul STA support a1debd338 tests: Refactor test_multi_ap bfcdac1c8 Multi-AP: Don't reject backhaul STA on fronthaul BSS cb3c156e7 tests: Update multi_ap_fronthaul_on_ap to match implementation 56a2d788f WPS: Add multi_ap_subelem to wps_build_wfa_ext() 83ebf5586 wpa_supplicant: Support Multi-AP backhaul STA onboarding with WPS 66819b07b hostapd: Support Multi-AP backhaul STA onboarding with WPS 8682f384c hostapd: Add README-MULTI-AP b1daf498a tests: Multi-AP WPS provisioning Add support for Multi-AP to the UCI configuration. Every wifi-iface gets an option 'multi_ap'. For APs, its value can be 0 (multi-AP support disabled), 1 (backhaul AP), 2 (fronthaul AP), or 3 (fronthaul + backhaul AP). For STAs, it can be 0 (not a backhaul STA) or 1 (backhaul STA, can only associate with backhaul AP). Also add new optional parameter to wps_start ubus call of wpa_supplicant to indicate that a Multi-AP backhaul link is required. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
101 lines
4.2 KiB
Diff
101 lines
4.2 KiB
Diff
From 7488e0ade6dffb6df4c1fb6526a9f3ede0eb18ef Mon Sep 17 00:00:00 2001
|
|
From: Jouni Malinen <jouni@codeaurora.org>
|
|
Date: Thu, 20 Dec 2018 12:41:00 +0200
|
|
Subject: [PATCH] tests: Multi-AP association
|
|
|
|
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
|
|
---
|
|
tests/hwsim/test_multi_ap.py | 73 ++++++++++++++++++++++++++++++++++++
|
|
tests/hwsim/wpasupplicant.py | 3 +-
|
|
2 files changed, 75 insertions(+), 1 deletion(-)
|
|
create mode 100644 tests/hwsim/test_multi_ap.py
|
|
|
|
--- /dev/null
|
|
+++ b/tests/hwsim/test_multi_ap.py
|
|
@@ -0,0 +1,73 @@
|
|
+# Test cases for Multi-AP
|
|
+# Copyright (c) 2018, The Linux Foundation
|
|
+#
|
|
+# This software may be distributed under the terms of the BSD license.
|
|
+# See README for more details.
|
|
+
|
|
+import hostapd
|
|
+
|
|
+def test_multi_ap_association(dev, apdev):
|
|
+ """Multi-AP association in backhaul BSS"""
|
|
+ run_multi_ap_association(dev, apdev, 1)
|
|
+ dev[1].connect("multi-ap", psk="12345678", scan_freq="2412",
|
|
+ wait_connect=False)
|
|
+ ev = dev[1].wait_event([ "CTRL-EVENT-DISCONNECTED",
|
|
+ "CTRL-EVENT-CONNECTED",
|
|
+ "CTRL-EVENT-ASSOC-REJECT" ],
|
|
+ timeout=5)
|
|
+ dev[1].request("DISCONNECT")
|
|
+ if ev is None:
|
|
+ raise Exception("Connection result not reported")
|
|
+ if "CTRL-EVENT-ASSOC-REJECT" not in ev:
|
|
+ raise Exception("Association rejection not reported")
|
|
+ if "status_code=12" not in ev:
|
|
+ raise Exception("Unexpected association status code: " + ev)
|
|
+
|
|
+def test_multi_ap_association_shared_bss(dev, apdev):
|
|
+ """Multi-AP association in backhaul BSS (with fronthaul BSS enabled)"""
|
|
+ run_multi_ap_association(dev, apdev, 3)
|
|
+ dev[1].connect("multi-ap", psk="12345678", scan_freq="2412")
|
|
+
|
|
+def run_multi_ap_association(dev, apdev, multi_ap):
|
|
+ params = hostapd.wpa2_params(ssid="multi-ap", passphrase="12345678")
|
|
+ params["multi_ap"] = str(multi_ap)
|
|
+ hapd = hostapd.add_ap(apdev[0], params)
|
|
+
|
|
+ dev[0].connect("multi-ap", psk="12345678", multi_ap_backhaul_sta="1",
|
|
+ scan_freq="2412")
|
|
+
|
|
+def test_multi_ap_disabled_on_ap(dev, apdev):
|
|
+ """Multi-AP association attempt when disabled on AP"""
|
|
+ params = hostapd.wpa2_params(ssid="multi-ap", passphrase="12345678")
|
|
+ hapd = hostapd.add_ap(apdev[0], params)
|
|
+
|
|
+ dev[0].connect("multi-ap", psk="12345678", multi_ap_backhaul_sta="1",
|
|
+ scan_freq="2412", wait_connect=False)
|
|
+ ev = dev[0].wait_event([ "CTRL-EVENT-DISCONNECTED",
|
|
+ "CTRL-EVENT-CONNECTED" ],
|
|
+ timeout=5)
|
|
+ dev[0].request("DISCONNECT")
|
|
+ if ev is None:
|
|
+ raise Exception("Connection result not reported")
|
|
+ if "CTRL-EVENT-DISCONNECTED" not in ev:
|
|
+ raise Exception("Unexpected connection result")
|
|
+
|
|
+def test_multi_ap_fronthaul_on_ap(dev, apdev):
|
|
+ """Multi-AP association attempt when only fronthaul BSS on AP"""
|
|
+ params = hostapd.wpa2_params(ssid="multi-ap", passphrase="12345678")
|
|
+ params["multi_ap"] = "2"
|
|
+ hapd = hostapd.add_ap(apdev[0], params)
|
|
+
|
|
+ dev[0].connect("multi-ap", psk="12345678", multi_ap_backhaul_sta="1",
|
|
+ scan_freq="2412", wait_connect=False)
|
|
+ ev = dev[0].wait_event([ "CTRL-EVENT-DISCONNECTED",
|
|
+ "CTRL-EVENT-CONNECTED",
|
|
+ "CTRL-EVENT-ASSOC-REJECT" ],
|
|
+ timeout=5)
|
|
+ dev[0].request("DISCONNECT")
|
|
+ if ev is None:
|
|
+ raise Exception("Connection result not reported")
|
|
+ if "CTRL-EVENT-ASSOC-REJECT" not in ev:
|
|
+ raise Exception("Association rejection not reported")
|
|
+ if "status_code=12" not in ev:
|
|
+ raise Exception("Unexpected association status code: " + ev)
|
|
--- a/tests/hwsim/wpasupplicant.py
|
|
+++ b/tests/hwsim/wpasupplicant.py
|
|
@@ -1031,7 +1031,8 @@ class WpaSupplicant:
|
|
"dpp_csign", "dpp_csign_expiry",
|
|
"dpp_netaccesskey", "dpp_netaccesskey_expiry",
|
|
"group_mgmt", "owe_group",
|
|
- "roaming_consortium_selection" ]
|
|
+ "roaming_consortium_selection", "multi_ap_backhaul_sta" ]
|
|
+
|
|
for field in not_quoted:
|
|
if field in kwargs and kwargs[field]:
|
|
self.set_network(id, field, kwargs[field])
|