]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Pass apdev to hostapd.add_iface()
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Thu, 7 Apr 2016 05:38:01 +0000 (07:38 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 24 Apr 2016 08:58:55 +0000 (11:58 +0300)
Pass apdev param to hostapd.add_iface() to support operation with a
remote test host.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
tests/hwsim/hostapd.py
tests/hwsim/test_ap_acs.py
tests/hwsim/test_ap_dynamic.py
tests/hwsim/test_ap_vlan.py

index 931c66640c8504c2cb3ffd9b65cd7f5677c94e9d..e9eb8227567c5a1345fda449442ec398e8038e94 100644 (file)
@@ -399,8 +399,16 @@ def add_bss(phy, ifname, confname, ignore_error=False, hostname=None,
     if not hapd.ping():
         raise Exception("Could not ping hostapd")
 
-def add_iface(ifname, confname, hostname=None, port=8878):
-    logger.info("Starting interface " + ifname)
+def add_iface(apdev, confname):
+    ifname = apdev['ifname']
+    try:
+        hostname = apdev['hostname']
+        port = apdev['port']
+        logger.info("Starting interface " + hostname + "/" + port + " " + ifname)
+    except:
+        logger.info("Starting interface " + ifname)
+        hostname = None
+        port = 8878
     hapd_global = HostapdGlobal(hostname=hostname, port=port)
     hapd_global.add_iface(ifname, confname)
     port = hapd_global.get_ctrl_iface_port(ifname)
index 71feb765b7ba4e2339f078eb9a59d365b6a5c607..8f1f4925a147b3c42523ba9464ca7735b06e650c 100644 (file)
@@ -95,7 +95,7 @@ def test_ap_multi_bss_acs(dev, apdev):
     force_prev_ap_on_24g(apdev[0])
 
     # start the actual test
-    hostapd.add_iface(ifname, 'multi-bss-acs.conf')
+    hostapd.add_iface(apdev[0], 'multi-bss-acs.conf')
     hapd = hostapd.Hostapd(ifname)
     hapd.enable()
     wait_acs(hapd)
index 0ba0bae61405ec942a870a815c064721579063e4..4d112229a0dfb5f0ff3f35026d37b6e5dd624887 100644 (file)
@@ -182,7 +182,7 @@ def test_ap_multi_bss_config(dev, apdev):
     ifname2 = apdev[0]['ifname'] + '-2'
     ifname3 = apdev[0]['ifname'] + '-3'
     logger.info("Set up three BSSes with one configuration file")
-    hostapd.add_iface(ifname1, 'multi-bss.conf')
+    hostapd.add_iface(apdev[0], 'multi-bss.conf')
     hapd = hostapd.Hostapd(ifname1)
     hapd.enable()
     multi_check(dev, [ True, True, True ])
@@ -193,7 +193,7 @@ def test_ap_multi_bss_config(dev, apdev):
     hostapd.remove_bss(apdev[0], ifname1)
     multi_check(dev, [ False, False, False ])
 
-    hostapd.add_iface(ifname1, 'multi-bss.conf')
+    hostapd.add_iface(apdev[0], 'multi-bss.conf')
     hapd = hostapd.Hostapd(ifname1)
     hapd.enable()
     hostapd.remove_bss(apdev[0], ifname1)
index 030f3cb7a8b9070678e2de808095319edf9191bc..79c4166af25ccbefe82b0ab90aa2fa2882346190 100644 (file)
@@ -330,7 +330,7 @@ def ap_vlan_iface_cleanup_multibss(dev, apdev, cfgfile):
         ifname = apdev[0]['ifname']
 
         # start the actual test
-        hostapd.add_iface(ifname, cfgfile)
+        hostapd.add_iface(apdev[0], cfgfile)
         hapd = hostapd.Hostapd(ifname)
         hapd1 = hostapd.Hostapd("wlan3-2", 1)
         hapd1.enable()