aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>2016-04-07 05:38:05 (GMT)
committerJouni Malinen <j@w1.fi>2016-04-24 16:24:44 (GMT)
commita3d35254426bbddc78413455698e6133c859b297 (patch)
tree08ae5c9b4204c4bff3f5822898de04af48e350a5 /tests
parent4193b8975089c878b8331588b18ff931730c8b44 (diff)
downloadhostap-a3d35254426bbddc78413455698e6133c859b297.zip
hostap-a3d35254426bbddc78413455698e6133c859b297.tar.gz
hostap-a3d35254426bbddc78413455698e6133c859b297.tar.bz2
tests: Remove HostapdGlobal() use from invalid_ap()
Pass apdev to instead of HostapdGlobal() to invalid_ap() to make the dynamic AP test cases more useful for testing with remove hosts. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_ap_dynamic.py21
1 files changed, 6 insertions, 15 deletions
diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py
index d8f6e27..993b5a7 100644
--- a/tests/hwsim/test_ap_dynamic.py
+++ b/tests/hwsim/test_ap_dynamic.py
@@ -199,14 +199,9 @@ def test_ap_multi_bss_config(dev, apdev):
hostapd.remove_bss(apdev[0], ifname1)
multi_check(dev, [ False, False, False ])
-def invalid_ap(hapd_global, ifname):
- logger.info("Trying to start AP " + ifname + " with invalid configuration")
- hapd_global.remove(ifname)
- hapd_global.add(ifname)
- hapd = hostapd.Hostapd(ifname)
- if not hapd.ping():
- raise Exception("Could not ping hostapd")
- hapd.set_defaults()
+def invalid_ap(ap):
+ logger.info("Trying to start AP " + ap['ifname'] + " with invalid configuration")
+ hapd = hostapd.add_ap(ap, {}, no_enable=True)
hapd.set("ssid", "invalid-config")
hapd.set("channel", "12345")
try:
@@ -220,9 +215,7 @@ def invalid_ap(hapd_global, ifname):
def test_ap_invalid_config(dev, apdev):
"""Try to start AP with invalid configuration and fix configuration"""
- hapd_global = hostapd.HostapdGlobal()
- ifname = apdev[0]['ifname']
- hapd = invalid_ap(hapd_global, ifname)
+ hapd = invalid_ap(apdev[0])
logger.info("Fix configuration and start AP again")
hapd.set("channel", "1")
@@ -231,11 +224,9 @@ def test_ap_invalid_config(dev, apdev):
def test_ap_invalid_config2(dev, apdev):
"""Try to start AP with invalid configuration and remove interface"""
- hapd_global = hostapd.HostapdGlobal()
- ifname = apdev[0]['ifname']
- hapd = invalid_ap(hapd_global, ifname)
+ hapd = invalid_ap(apdev[0])
logger.info("Remove interface with failed configuration")
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
def test_ap_remove_during_acs(dev, apdev):
"""Remove interface during ACS"""