From 0218bf05d6d281be6a686be27075882dcb67eb09 Mon Sep 17 00:00:00 2001 From: Thomas Pedersen Date: Fri, 1 May 2020 14:02:07 -0700 Subject: [PATCH] tests: sigma_dut: set regulatory inside try/except If sigma_dut is not installed, start_sigma_dut() will throw an exception. Call start_sigma_dut() inside the try/except to correctly reset the regulatory domain. This fixes several seemingly random failures due to regulatory domain not being reset. Signed-off-by: Thomas Pedersen --- tests/hwsim/test_sigma_dut.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/hwsim/test_sigma_dut.py b/tests/hwsim/test_sigma_dut.py index 10313c215..dc2986b51 100644 --- a/tests/hwsim/test_sigma_dut.py +++ b/tests/hwsim/test_sigma_dut.py @@ -4401,9 +4401,9 @@ def run_sigma_dut_ap_channel(dev, apdev, params, channel, mode, scan_freq, extra=None, check_signal=None, program=None): logdir = params['prefix'] + ".sigma-hostapd" with HWSimRadio() as (radio, iface): - subprocess.call(['iw', 'reg', 'set', 'US']) sigma = start_sigma_dut(iface, hostapd_logdir=logdir) try: + subprocess.call(['iw', 'reg', 'set', 'US']) cmd = "ap_reset_default" if program: cmd += ",program," + program