tests: Use hostapd.remove_bss() instead of HostapdGlobal() (WPS)

This makes ap_wps_twice more usable for testing with remote hosts.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
This commit is contained in:
Janusz Dziedzic 2016-04-07 07:38:05 +02:00 committed by Jouni Malinen
parent 84f3f3a5e6
commit 01703a9f2f

View file

@ -292,8 +292,7 @@ def test_ap_wps_twice(dev, apdev):
params = { "ssid": ssid, "eap_server": "1", "wps_state": "2",
"wpa_passphrase": "12345678", "wpa": "2",
"wpa_key_mgmt": "WPA-PSK", "rsn_pairwise": "CCMP" }
hostapd.add_ap(apdev[0], params)
hapd = hostapd.Hostapd(apdev[0]['ifname'])
hapd = hostapd.add_ap(apdev[0], params)
logger.info("WPS provisioning step")
hapd.request("WPS_PBC")
dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
@ -303,11 +302,9 @@ def test_ap_wps_twice(dev, apdev):
dev[0].request("DISCONNECT")
logger.info("Restart AP with different passphrase and re-run WPS")
hapd_global = hostapd.HostapdGlobal()
hapd_global.remove(apdev[0]['ifname'])
hostapd.remove_bss(apdev[0])
params['wpa_passphrase'] = 'another passphrase'
hostapd.add_ap(apdev[0], params)
hapd = hostapd.Hostapd(apdev[0]['ifname'])
hapd = hostapd.add_ap(apdev[0], params)
logger.info("WPS provisioning step")
hapd.request("WPS_PBC")
dev[0].dump_monitor()