Skip to contentSkip to conversation

test-runner: make default iwd_config_dir=/tmp

PATCH In review James Prestwood 2 participants 4 messages Mar 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 test-runner: make default iwd_config_dir=/tmp

The configuration value of iwd_config_dir was defaulting to /etc/iwd which, in the context of test-runner, is probably not the best idea. The system may have a main.conf file in /etc/iwd which could cause tests to fail or behave unexpectedly.

In addition all tests which use iwd_config_dir set it to /tmp anyways. Because of this, the new default value will be /tmp and no tests will even need to bother setting this.

The configuration value itself is not being removed because it may be useful to set arbitrary paths (e.g. /etc/iwd) for example when using the shell functionality.

---
 tools/test-runner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/test-runner.c +1 -1
index 1be3f640..1adb8377 100644
@@ -2205,7 +2205,7 @@ static void create_network_and_run_tests(void *data, void *user_data)
 						HW_CONFIG_GROUP_SETUP,
 						HW_CONFIG_SETUP_IWD_CONF_DIR);
 		if (!iwd_config_dir)
-			iwd_config_dir = DAEMON_CONFIGDIR;
+			iwd_config_dir = "/tmp";
 
 		iwd_pid = start_iwd(iwd_config_dir, wiphy_list,
 				iwd_ext_options, iwd_phys, test_name);
Signature · 1 line
2.21.1
#1 lore raw

PATCH 2/3 auto-t: fix testAddressRandomization

This test was dependent on having a local main.conf in /etc/iwd

---
 autotests/testAddressRandomization/connection_test.py | 2 +-
 autotests/testAddressRandomization/hw.conf            | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)
autotests/testAddressRandomization/connection_test.py +1 -1
index fab8fea9..74c9601d 100644
@@ -38,7 +38,7 @@ class Test(unittest.TestCase):
         return device.address
 
     def test_connection_success(self):
-        wd = IWD(True)
+        wd = IWD()
 
         devices = wd.list_devices(1)
         device = devices[0]
autotests/testAddressRandomization/hw.conf +0 -1
index fa46c8b8..35af520e 100644
@@ -1,6 +1,5 @@
 [SETUP]
 num_radios=2
-start_iwd=0
 tmpfs_extra_stuff=main.conf
 
 [HOSTAPD]
Signature · 1 line
2.21.1
#2 lore raw

PATCH 3/3 auto-t: remove iwd_config_dir from autotests

In reply to James Prestwood

This is no longer needed unless setting a different directory than /tmp

---
 autotests/testAP/hw.conf             | 1 -
 autotests/testEAP-TLS-Frag/hw.conf   | 1 -
 autotests/testEAP-TTLS-Frag/hw.conf  | 1 -
 autotests/testEAP-WPS-Frag/hw.conf   | 1 -
 autotests/testFT-8021x-roam/hw.conf  | 2 --
 autotests/testFT-FILS-SHA256/hw.conf | 1 -
 autotests/testFT-FILS-SHA384/hw.conf | 1 -
 autotests/testFT-PSK-over-DS/hw.conf | 1 -
 autotests/testFT-PSK-roam/hw.conf    | 1 -
 autotests/testFT-SAE-roam/hw.conf    | 1 -
 autotests/testHT-VHT/hw.conf         | 1 -
 autotests/testRSSIAgent/hw.conf      | 1 -
 12 files changed, 13 deletions(-)
autotests/testAP/hw.conf +0 -1
index dc9b7bff..96a2bbb1 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=3
 max_test_exec_interval_sec=40
-iwd_config_dir=/tmp
 tmpfs_extra_stuff=main.conf
 
 [HOSTAPD]
autotests/testEAP-TLS-Frag/hw.conf +0 -1
index e210f674..80b08975 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=2
 tmpfs_extra_stuff=../misc/certs:main.conf
-iwd_config_dir=/tmp
 
 [HOSTAPD]
 rad0=ssidEAP-TLS.conf
autotests/testEAP-TTLS-Frag/hw.conf +0 -1
index f0e55bd6..279842c2 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=2
 tmpfs_extra_stuff=../misc/certs:main.conf
-iwd_config_dir=/tmp
 
 [HOSTAPD]
 rad0=ssidEAP-TTLS.conf
autotests/testEAP-WPS-Frag/hw.conf +0 -1
index ebeade92..eeac3bab 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=2
 tmpfs_extra_stuff=main.conf
-iwd_config_dir=/tmp
 
 [HOSTAPD]
 rad0=ssid-wps-small-mtu.conf
autotests/testFT-8021x-roam/hw.conf +0 -2
index d3c039ae..4906bbf3 100644
@@ -2,8 +2,6 @@
 num_radios=3
 max_test_exec_interval_sec=45
 tmpfs_extra_stuff=../misc/certs:main.conf
-iwd_config_dir=/tmp
-tmpfs_extra_stuff=../misc/certs
 needs_hwsim=1
 
 [HOSTAPD]
autotests/testFT-FILS-SHA256/hw.conf +0 -1
index b5c6757c..c3330d04 100644
@@ -2,7 +2,6 @@
 num_radios=3
 max_test_exec_interval_sec=45
 tmpfs_extra_stuff=../misc/certs:main.conf:pwd.eap_user
-iwd_config_dir=/tmp
 
 [HOSTAPD]
 rad0=ft-eap-ccmp-1.conf
autotests/testFT-FILS-SHA384/hw.conf +0 -1
index b5c6757c..c3330d04 100644
@@ -2,7 +2,6 @@
 num_radios=3
 max_test_exec_interval_sec=45
 tmpfs_extra_stuff=../misc/certs:main.conf:pwd.eap_user
-iwd_config_dir=/tmp
 
 [HOSTAPD]
 rad0=ft-eap-ccmp-1.conf
autotests/testFT-PSK-over-DS/hw.conf +0 -1
index e020b54f..d2d50863 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=3
 max_test_exec_interval_sec=45
-iwd_config_dir=/tmp
 tmpfs_extra_stuff=main.conf
 needs_hwsim=1
 
autotests/testFT-PSK-roam/hw.conf +0 -1
index e020b54f..d2d50863 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=3
 max_test_exec_interval_sec=45
-iwd_config_dir=/tmp
 tmpfs_extra_stuff=main.conf
 needs_hwsim=1
 
autotests/testFT-SAE-roam/hw.conf +0 -1
index a0ff7b16..1f0f1c12 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=4
 max_test_exec_interval_sec=120
-iwd_config_dir=/tmp
 tmpfs_extra_stuff=main.conf
 needs_hwsim=1
 
autotests/testHT-VHT/hw.conf +0 -1
index 98e1b2ea..6d557ad1 100644
@@ -2,7 +2,6 @@
 num_radios=4
 max_test_exec_interval_sec=45
 reg_domain=US
-iwd_config_dir=/tmp
 tmpfs_extra_stuff=main.conf
 
 [HOSTAPD]
autotests/testRSSIAgent/hw.conf +0 -1
index 094e9378..9b9d75be 100644
@@ -1,7 +1,6 @@
 [SETUP]
 num_radios=2
 max_test_exec_interval_sec=60
-iwd_config_dir=/tmp
 tmpfs_extra_stuff=main.conf
 needs_hwsim=1
 
Signature · 1 line
2.21.1
#3 lore raw
In reply to James Prestwood

Hi James,

Quoted 9 lines · James Prestwood

The configuration value of iwd_config_dir was defaulting to /etc/iwd which, in the context of test-runner, is probably not the best idea. The system may have a main.conf file in /etc/iwd which could cause tests to fail or behave unexpectedly.

In addition all tests which use iwd_config_dir set it to /tmp anyways. Because of this, the new default value will be /tmp and no tests will even need to bother setting this.

Quoted 6 lines

The configuration value itself is not being removed because it may be useful to set arbitrary paths (e.g. /etc/iwd) for example when using the shell functionality.

---
  tools/test-runner.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

all applied, thanks.

Regards,
-Denis