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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2019-01-01 11:45:50 +02:00
parent 003716ec7b
commit ba3146e154
7 changed files with 16 additions and 0 deletions

View file

@ -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"""

View file

@ -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"""

View file

@ -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",

View file

@ -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"""

View file

@ -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):

View file

@ -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])

View file

@ -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'])