From 05bc2b44c1f0b22014cf07e119c3641340ab5e79 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 22 Nov 2015 17:59:54 +0200 Subject: [PATCH] tests: INTERFACE_ADD create testing coverage This covers an invalid interface type and interface type 'sta'. Signed-off-by: Jouni Malinen --- tests/hwsim/test_wpas_ctrl.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/hwsim/test_wpas_ctrl.py b/tests/hwsim/test_wpas_ctrl.py index b4a75c728..c97a81dc4 100644 --- a/tests/hwsim/test_wpas_ctrl.py +++ b/tests/hwsim/test_wpas_ctrl.py @@ -1236,6 +1236,8 @@ def test_wpas_ctrl_global(dev): raise Exception("INTERFACE_ADD succeeded unexpectedly") if "FAIL" not in wpas.global_request("INTERFACE_ADD FOO "): raise Exception("INTERFACE_ADD succeeded unexpectedly") + if "FAIL" not in wpas.global_request("INTERFACE_ADD FOO conf driver ctrliface driverparam bridge create abcd"): + raise Exception("INTERFACE_ADD succeeded unexpectedly") def test_wpas_ctrl_roam(dev, apdev): """wpa_supplicant ctrl_iface ROAM error cases""" @@ -1491,6 +1493,17 @@ def test_wpas_ctrl_interface_add(dev, apdev): dev[0].global_request("INTERFACE_REMOVE " + ifname) hwsim_utils.test_connectivity(dev[0], hapd) +def test_wpas_ctrl_interface_add_sta(dev, apdev): + """wpa_supplicant INTERFACE_ADD/REMOVE with STA vif creation/removal""" + hapd = hostapd.add_ap(apdev[0]['ifname'], { "ssid": "open" }) + ifname = "test-" + dev[0].ifname + dev[0].interface_add(ifname, create=True, if_type='sta') + wpas = WpaSupplicant(ifname=ifname) + wpas.connect("open", key_mgmt="NONE", scan_freq="2412") + wpas.request("DISCONNECT") + wpas.wait_disconnected() + dev[0].global_request("INTERFACE_REMOVE " + ifname) + def test_wpas_ctrl_interface_add_ap(dev, apdev): """wpa_supplicant INTERFACE_ADD/REMOVE AP interface""" with HWSimRadio() as (radio, iface):