aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2016-04-07 05:38:07 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-24 17:16:30 (GMT)
commit5148b392ab2e71a0fe9d0ddfea13d4bd3ca79bac (patch)
treec07ff602f3b44ec1bdd9f715232dd9d6b2972140
parent6f334bf7a0474c8a7ef9faa8875023741d408f30 (diff)
downloadhostap-5148b392ab2e71a0fe9d0ddfea13d4bd3ca79bac.zip
hostap-5148b392ab2e71a0fe9d0ddfea13d4bd3ca79bac.tar.gz
hostap-5148b392ab2e71a0fe9d0ddfea13d4bd3ca79bac.tar.bz2
tests: Use hapd from hostapd.add_bss()
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
-rw-r--r--tests/hwsim/test_ap_dynamic.py10
-rw-r--r--tests/hwsim/test_ap_wps.py3
2 files changed, 4 insertions, 9 deletions
diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py
index 0062d80..85ab35c 100644
--- a/tests/hwsim/test_ap_dynamic.py
+++ b/tests/hwsim/test_ap_dynamic.py
@@ -317,9 +317,8 @@ def test_ap_enable_disable_reenable(dev, apdev):
def test_ap_double_disable(dev, apdev):
"""Double DISABLE regression test"""
- hostapd.add_bss(apdev[0], apdev[0]['ifname'], 'bss-1.conf')
+ hapd = hostapd.add_bss(apdev[0], apdev[0]['ifname'], 'bss-1.conf')
hostapd.add_bss(apdev[0], apdev[0]['ifname'] + '-2', 'bss-2.conf')
- hapd = hostapd.Hostapd(apdev[0]['ifname'])
hapd.disable()
if "FAIL" not in hapd.request("DISABLE"):
raise Exception("Second DISABLE accepted unexpectedly")
@@ -421,14 +420,11 @@ def test_ap_multi_bss(dev, apdev):
"""Multiple BSSes with hostapd"""
ifname1 = apdev[0]['ifname']
ifname2 = apdev[0]['ifname'] + '-2'
- hostapd.add_bss(apdev[0], ifname1, 'bss-1.conf')
- hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf')
+ hapd1 = hostapd.add_bss(apdev[0], ifname1, 'bss-1.conf')
+ hapd2 = hostapd.add_bss(apdev[0], ifname2, 'bss-2.conf')
dev[0].connect("bss-1", key_mgmt="NONE", scan_freq="2412")
dev[1].connect("bss-2", key_mgmt="NONE", scan_freq="2412")
- hapd1 = hostapd.Hostapd(ifname1)
- hapd2 = hostapd.Hostapd(ifname2)
-
hwsim_utils.test_connectivity(dev[0], hapd1)
hwsim_utils.test_connectivity(dev[1], hapd2)
diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py
index e193faf..4f178a4 100644
--- a/tests/hwsim/test_ap_wps.py
+++ b/tests/hwsim/test_ap_wps.py
@@ -2255,8 +2255,7 @@ def test_ap_wps_auto_setup_with_config_file(dev, apdev):
f.write("ssid=wps\n")
f.write("eap_server=1\n")
f.write("wps_state=1\n")
- hostapd.add_bss(apdev[0], ifname, conffile)
- hapd = hostapd.Hostapd(ifname)
+ hapd = hostapd.add_bss(apdev[0], ifname, conffile)
hapd.request("WPS_PBC")
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
dev[0].request("WPS_PBC " + apdev[0]['bssid'])