aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2016-04-07 05:38:01 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-24 08:58:55 (GMT)
commit29444a0863086533905a54b1711fd74dfc85c218 (patch)
treea372f512524e796796867a6074c9563d25076303 /tests
parent369f712a401ce117dd7f1d5324a68608f851b387 (diff)
downloadhostap-29444a0863086533905a54b1711fd74dfc85c218.zip
hostap-29444a0863086533905a54b1711fd74dfc85c218.tar.gz
hostap-29444a0863086533905a54b1711fd74dfc85c218.tar.bz2
tests: Pass apdev to hostapd.add_iface()
Pass apdev param to hostapd.add_iface() to support operation with a remote test host. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/hostapd.py12
-rw-r--r--tests/hwsim/test_ap_acs.py2
-rw-r--r--tests/hwsim/test_ap_dynamic.py4
-rw-r--r--tests/hwsim/test_ap_vlan.py2
4 files changed, 14 insertions, 6 deletions
diff --git a/tests/hwsim/hostapd.py b/tests/hwsim/hostapd.py
index 931c666..e9eb822 100644
--- a/tests/hwsim/hostapd.py
+++ b/tests/hwsim/hostapd.py
@@ -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)
diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py
index 71feb76..8f1f492 100644
--- a/tests/hwsim/test_ap_acs.py
+++ b/tests/hwsim/test_ap_acs.py
@@ -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)
diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py
index 0ba0bae..4d11222 100644
--- a/tests/hwsim/test_ap_dynamic.py
+++ b/tests/hwsim/test_ap_dynamic.py
@@ -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)
diff --git a/tests/hwsim/test_ap_vlan.py b/tests/hwsim/test_ap_vlan.py
index 030f3cb..79c4166 100644
--- a/tests/hwsim/test_ap_vlan.py
+++ b/tests/hwsim/test_ap_vlan.py
@@ -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()