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:23:22 (GMT)
commit4193b8975089c878b8331588b18ff931730c8b44 (patch)
tree62f511224cd97ec71dd8a57a34451b7eb5b53910 /tests
parentfb1a7dccbf1a1d045515b8c8297328fb695998f3 (diff)
downloadhostap-4193b8975089c878b8331588b18ff931730c8b44.zip
hostap-4193b8975089c878b8331588b18ff931730c8b44.tar.gz
hostap-4193b8975089c878b8331588b18ff931730c8b44.tar.bz2
tests: Remove direct HostapdGlobal() use
Use hostapd.add_ap() and hostapd.remove_bss() to avoid direct HostapdGlobal() use in some of the dynamic AP test cases to make them more usable for testing with remote hosts. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_ap_dynamic.py41
1 files changed, 11 insertions, 30 deletions
diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py
index cf73942..d8f6e27 100644
--- a/tests/hwsim/test_ap_dynamic.py
+++ b/tests/hwsim/test_ap_dynamic.py
@@ -242,42 +242,34 @@ def test_ap_remove_during_acs(dev, apdev):
force_prev_ap_on_24g(apdev[0])
params = hostapd.wpa2_params(ssid="test-acs-remove", passphrase="12345678")
params['channel'] = '0'
- ifname = apdev[0]['ifname']
- hapd = hostapd.HostapdGlobal()
hostapd.add_ap(apdev[0], params)
- hapd.remove(ifname)
+ hostapd.remove_bss(apdev[0])
def test_ap_remove_during_acs2(dev, apdev):
"""Remove BSS during ACS in multi-BSS configuration"""
force_prev_ap_on_24g(apdev[0])
ifname = apdev[0]['ifname']
ifname2 = ifname + "-2"
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.add(ifname)
- hapd = hostapd.Hostapd(ifname)
- hapd.set_defaults()
+ hapd = hostapd.add_ap(apdev[0], {}, no_enable=True)
hapd.set("ssid", "test-acs-remove")
hapd.set("channel", "0")
hapd.set("bss", ifname2)
hapd.set("ssid", "test-acs-remove2")
hapd.enable()
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
def test_ap_remove_during_acs3(dev, apdev):
"""Remove second BSS during ACS in multi-BSS configuration"""
force_prev_ap_on_24g(apdev[0])
ifname = apdev[0]['ifname']
ifname2 = ifname + "-2"
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.add(ifname)
- hapd = hostapd.Hostapd(ifname)
- hapd.set_defaults()
+ hapd = hostapd.add_ap(apdev[0], {}, no_enable=True)
hapd.set("ssid", "test-acs-remove")
hapd.set("channel", "0")
hapd.set("bss", ifname2)
hapd.set("ssid", "test-acs-remove2")
hapd.enable()
- hapd_global.remove(ifname2)
+ hostapd.remove_bss(apdev[0], ifname2)
def test_ap_remove_during_ht_coex_scan(dev, apdev):
"""Remove interface during HT co-ex scan"""
@@ -285,49 +277,38 @@ def test_ap_remove_during_ht_coex_scan(dev, apdev):
params['channel'] = '1'
params['ht_capab'] = "[HT40+]"
ifname = apdev[0]['ifname']
- hapd = hostapd.HostapdGlobal()
hostapd.add_ap(apdev[0], params)
- hapd.remove(ifname)
+ hostapd.remove_bss(apdev[0])
def test_ap_remove_during_ht_coex_scan2(dev, apdev):
"""Remove BSS during HT co-ex scan in multi-BSS configuration"""
ifname = apdev[0]['ifname']
ifname2 = ifname + "-2"
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.add(ifname)
- hapd = hostapd.Hostapd(ifname)
- hapd.set_defaults()
+ hapd = hostapd.add_ap(apdev[0], {}, no_enable=True)
hapd.set("ssid", "test-ht-remove")
hapd.set("channel", "1")
hapd.set("ht_capab", "[HT40+]")
hapd.set("bss", ifname2)
hapd.set("ssid", "test-ht-remove2")
hapd.enable()
- hapd_global.remove(ifname)
+ hostapd.remove_bss(apdev[0])
def test_ap_remove_during_ht_coex_scan3(dev, apdev):
"""Remove second BSS during HT co-ex scan in multi-BSS configuration"""
ifname = apdev[0]['ifname']
ifname2 = ifname + "-2"
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.add(ifname)
- hapd = hostapd.Hostapd(ifname)
- hapd.set_defaults()
+ hapd = hostapd.add_ap(apdev[0], {}, no_enable=True)
hapd.set("ssid", "test-ht-remove")
hapd.set("channel", "1")
hapd.set("ht_capab", "[HT40+]")
hapd.set("bss", ifname2)
hapd.set("ssid", "test-ht-remove2")
hapd.enable()
- hapd_global.remove(ifname2)
+ hostapd.remove_bss(apdev[0], ifname2)
def test_ap_enable_disable_reenable(dev, apdev):
"""Enable, disable, re-enable AP"""
- ifname = apdev[0]['ifname']
- hapd_global = hostapd.HostapdGlobal()
- hapd_global.add(ifname)
- hapd = hostapd.Hostapd(ifname)
- hapd.set_defaults()
+ hapd = hostapd.add_ap(apdev[0], {}, no_enable=True)
hapd.set("ssid", "dynamic")
hapd.enable()
ev = hapd.wait_event(["AP-ENABLED"], timeout=30)