]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: INTERFACE_ADD create testing coverage
authorJouni Malinen <j@w1.fi>
Sun, 22 Nov 2015 15:59:54 +0000 (17:59 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 22 Nov 2015 15:59:54 +0000 (17:59 +0200)
This covers an invalid interface type and interface type 'sta'.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wpas_ctrl.py

index b4a75c728adbc6dee6b30d10f75ee47f6c139984..c97a81dc4b89ecb6fd79c80e8310d14b8a016d82 100644 (file)
@@ -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):