tests: Fix wpas_ap_async_fail false negative by using common finalizer

wpas_ap_async_fail fails with this message.

---------------
wlan0: Country code not reset back to 00: is FI
wlan0: Country code cleared back to 00
---------------

This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
This commit is contained in:
Masashi Honma 2019-05-30 17:05:55 +09:00 committed by Jouni Malinen
parent 1ae044f77d
commit 689db8b3a7
2 changed files with 5 additions and 3 deletions

View file

@ -10,7 +10,7 @@ import logging
logger = logging.getLogger() logger = logging.getLogger()
import hwsim_utils import hwsim_utils
from utils import HwsimSkip, alloc_fail from utils import HwsimSkip, alloc_fail, clear_regdom_dev
from wpasupplicant import WpaSupplicant from wpasupplicant import WpaSupplicant
from test_p2p_channel import set_country from test_p2p_channel import set_country
@ -761,5 +761,4 @@ def test_wpas_ap_async_fail(dev):
dev[0].select_network(id) dev[0].select_network(id)
dev[0].wait_disconnected() dev[0].wait_disconnected()
finally: finally:
set_country("00") clear_regdom_dev(dev)
dev[0].set("country", "00")

View file

@ -151,6 +151,9 @@ def clear_regdom(hapd, dev, count=1):
if hapd: if hapd:
hapd.request("DISABLE") hapd.request("DISABLE")
time.sleep(0.1) time.sleep(0.1)
clear_regdom_dev(dev, count)
def clear_regdom_dev(dev, count=1):
for i in range(count): for i in range(count):
dev[i].request("DISCONNECT") dev[i].request("DISCONNECT")
for i in range(count): for i in range(count):