From c3216529347d2e5e55189f9968f659d6b2a5ab1e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 22 Feb 2016 12:06:33 +0200 Subject: [PATCH] tests: MBO cellular data capability update Signed-off-by: Jouni Malinen --- tests/hwsim/test_mbo.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/hwsim/test_mbo.py b/tests/hwsim/test_mbo.py index 0ccbd6f01..7dcba3a4f 100644 --- a/tests/hwsim/test_mbo.py +++ b/tests/hwsim/test_mbo.py @@ -9,6 +9,7 @@ logger = logging.getLogger() import hostapd import os +import time from tshark import run_tshark @@ -57,3 +58,29 @@ def test_mbo_assoc_disallow(dev, apdev, params): filter, wait=False) if "Destination address: " + hapd2.own_addr() in out: raise Exception("Association request sent to disallowed AP 2") + +def test_mbo_cell_capa_update(dev, apdev): + """MBO cellular data capability update""" + ssid = "test-wnm-mbo" + params = { 'ssid': ssid, 'mbo': '1' } + hapd = hostapd.add_ap(apdev[0]['ifname'], params) + bssid = apdev[0]['bssid'] + if "OK" not in dev[0].request("SET mbo_cell_capa 1"): + raise Exception("Failed to set STA as cellular data capable") + + dev[0].connect(ssid, key_mgmt="NONE", scan_freq="2412") + + addr = dev[0].own_addr() + sta = hapd.get_sta(addr) + if 'mbo_cell_capa' not in sta or sta['mbo_cell_capa'] != '1': + raise Exception("mbo_cell_capa missing after association") + + if "OK" not in dev[0].request("SET mbo_cell_capa 3"): + raise Exception("Failed to set STA as cellular data not-capable") + + time.sleep(0.2) + sta = hapd.get_sta(addr) + if 'mbo_cell_capa' not in sta: + raise Exception("mbo_cell_capa missing after update") + if sta['mbo_cell_capa'] != '3': + raise Exception("mbo_cell_capa not updated properly")