From 9a1046a7a166205992e325e836360cced777d7bd Mon Sep 17 00:00:00 2001 From: Masashi Honma Date: Tue, 25 Jun 2019 10:51:09 +0900 Subject: [PATCH] tests: Fix scan_dfs false negative by using common finalizer scan_dfs fails with this message. --------------- wlan0: Country code not reset back to 00: is US wlan0: Country code cleared back to 00 --------------- This patch fixes the issue. Signed-off-by: Masashi Honma --- tests/hwsim/test_scan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index 735ccffc3..220ce2b12 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -16,6 +16,7 @@ import subprocess import hostapd from wpasupplicant import WpaSupplicant from utils import HwsimSkip, fail_test, alloc_fail, wait_fail_trigger, parse_ie +from utils import clear_regdom_dev from tshark import run_tshark from test_ap_csa import switch_channel, wait_channel_switch, csa_supported @@ -974,8 +975,7 @@ def test_scan_dfs(dev, apdev, params): try: _test_scan_dfs(dev, apdev, params) finally: - subprocess.call(['iw', 'reg', 'set', '00']) - time.sleep(0.1) + clear_regdom_dev(dev) def _test_scan_dfs(dev, apdev, params): subprocess.call(['iw', 'reg', 'set', 'US'])