]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Use hostapd.add_ap() instead of HostapdGlobal() (DFS)
authorJanusz Dziedzic <janusz.dziedzic@tieto.com>
Thu, 7 Apr 2016 05:38:05 +0000 (07:38 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 24 Apr 2016 16:25:06 +0000 (19:25 +0300)
This makes the DFS test cases that use start_dfs_ap() more usable for
testing with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
tests/hwsim/test_dfs.py

index 49b061185b7b0b21a53bcb3295d32ea0af65af88..9bf6e54fe66b213dd175ef0e0988ab042ea3eea3 100644 (file)
@@ -30,13 +30,7 @@ def start_dfs_ap(ap, allow_failure=False, ssid="dfs", ht=True, ht40=False,
                  channel=None):
     ifname = ap['ifname']
     logger.info("Starting AP " + ifname + " on DFS channel")
-    hapd_global = hostapd.HostapdGlobal()
-    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()
+    hapd = hostapd.add_ap(ap, {}, no_enable=True)
     hapd.set("ssid", ssid)
     hapd.set("country_code", "FI")
     hapd.set("ieee80211d", "1")