From ba3146e1541cb021b001783f75ca876fa4ce3c4b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 1 Jan 2019 11:45:50 +0200 Subject: [PATCH] tests: Wait a bit after 'iw reg set 00' at the end of test cases This is needed to avoid leaving unexpected cfg80211 regulatory country code in place at the point when a test case terminates. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_acs.py | 1 + tests/hwsim/test_ap_ht.py | 1 + tests/hwsim/test_ap_track.py | 6 ++++++ tests/hwsim/test_ap_vht.py | 5 +++++ tests/hwsim/test_dfs.py | 1 + tests/hwsim/test_dpp.py | 1 + tests/hwsim/test_scan.py | 1 + 7 files changed, 16 insertions(+) diff --git a/tests/hwsim/test_ap_acs.py b/tests/hwsim/test_ap_acs.py index 151c5b6f1..94ff38a61 100644 --- a/tests/hwsim/test_ap_acs.py +++ b/tests/hwsim/test_ap_acs.py @@ -327,6 +327,7 @@ def test_ap_acs_vht160_scan_disable(dev, apdev): time.sleep(3) hapd.request("DISABLE") hostapd.cmd_execute(apdev[0], ['iw', 'reg', 'set', '00']) + time.sleep(0.1) def test_ap_acs_bias(dev, apdev): """Automatic channel selection with bias values""" diff --git a/tests/hwsim/test_ap_ht.py b/tests/hwsim/test_ap_ht.py index c0a16c1c7..e6f6502f4 100644 --- a/tests/hwsim/test_ap_ht.py +++ b/tests/hwsim/test_ap_ht.py @@ -30,6 +30,7 @@ def set_world_reg(apdev0=None, apdev1=None, dev0=None): hostapd.cmd_execute(apdev1, ['iw', 'reg', 'set', '00']) if dev0: dev0.cmd_execute(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def test_ap_ht40_scan(dev, apdev): """HT40 co-ex scan""" diff --git a/tests/hwsim/test_ap_track.py b/tests/hwsim/test_ap_track.py index 8965af9e6..765aa4314 100644 --- a/tests/hwsim/test_ap_track.py +++ b/tests/hwsim/test_ap_track.py @@ -19,6 +19,7 @@ def test_ap_track_sta(dev, apdev): _test_ap_track_sta(dev, apdev) finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def _test_ap_track_sta(dev, apdev): params = { "ssid": "track", @@ -85,6 +86,7 @@ def test_ap_track_sta_no_probe_resp(dev, apdev): _test_ap_track_sta_no_probe_resp(dev, apdev) finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def _test_ap_track_sta_no_probe_resp(dev, apdev): dev[0].flush_scan_cache() @@ -127,6 +129,7 @@ def test_ap_track_sta_no_auth(dev, apdev): _test_ap_track_sta_no_auth(dev, apdev) finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def _test_ap_track_sta_no_auth(dev, apdev): params = { "ssid": "track", @@ -173,6 +176,7 @@ def test_ap_track_sta_no_auth_passive(dev, apdev): _test_ap_track_sta_no_auth_passive(dev, apdev) finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def _test_ap_track_sta_no_auth_passive(dev, apdev): dev[0].flush_scan_cache() @@ -230,6 +234,7 @@ def test_ap_track_sta_force_5ghz(dev, apdev): _test_ap_track_sta_force_5ghz(dev, apdev) finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def _test_ap_track_sta_force_5ghz(dev, apdev): params = { "ssid": "track", @@ -264,6 +269,7 @@ def test_ap_track_sta_force_2ghz(dev, apdev): _test_ap_track_sta_force_2ghz(dev, apdev) finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def _test_ap_track_sta_force_2ghz(dev, apdev): params = { "ssid": "track", diff --git a/tests/hwsim/test_ap_vht.py b/tests/hwsim/test_ap_vht.py index 64c0921b0..2cd1f995b 100644 --- a/tests/hwsim/test_ap_vht.py +++ b/tests/hwsim/test_ap_vht.py @@ -199,6 +199,7 @@ def test_ap_vht80_invalid(dev, apdev): if hapd: hapd.request("DISABLE") subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def test_ap_vht80_invalid2(dev, apdev): """VHT with invalid 80 MHz channel configuration (seg0)""" @@ -229,6 +230,7 @@ def test_ap_vht80_invalid2(dev, apdev): if hapd: hapd.request("DISABLE") subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def test_ap_vht_20(devs, apdevs): """VHT and 20 MHz channel""" @@ -309,6 +311,7 @@ def test_ap_vht_capab_not_supported(dev, apdev): raise Exception("Unexpected SET failure") finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def test_ap_vht160(dev, apdev): """VHT with 160 MHz channel width (1)""" @@ -569,6 +572,7 @@ def test_ap_vht160_no_ht40(dev, apdev): if hapd: hapd.request("DISABLE") subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def test_ap_vht80plus80(dev, apdev): """VHT with 80+80 MHz channel width""" @@ -672,6 +676,7 @@ def test_ap_vht80plus80_invalid(dev, apdev): if hapd: hapd.request("DISABLE") subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def test_ap_vht80_csa(dev, apdev): """VHT with 80 MHz channel width and CSA""" diff --git a/tests/hwsim/test_dfs.py b/tests/hwsim/test_dfs.py index ae07b90d7..5983324d5 100644 --- a/tests/hwsim/test_dfs.py +++ b/tests/hwsim/test_dfs.py @@ -299,6 +299,7 @@ def test_dfs_radar2(dev, apdev): if hapd: hapd.request("DISABLE") subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) @remote_compatible def test_dfs_radar_on_non_dfs_channel(dev, apdev): diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 256d1741a..a59e05b3d 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -2829,6 +2829,7 @@ def test_dpp_pkex_5ghz(dev, apdev): dev[0].request("SET country 00") dev[1].request("SET country 00") subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def run_dpp_pkex_5ghz(dev, apdev): check_dpp_capab(dev[0]) diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py index 1ee9ef265..fc5ebbe9a 100644 --- a/tests/hwsim/test_scan.py +++ b/tests/hwsim/test_scan.py @@ -975,6 +975,7 @@ def test_scan_dfs(dev, apdev, params): _test_scan_dfs(dev, apdev, params) finally: subprocess.call(['iw', 'reg', 'set', '00']) + time.sleep(0.1) def _test_scan_dfs(dev, apdev, params): subprocess.call(['iw', 'reg', 'set', 'US'])