From cb4f1d2a993569e6988049336dd91c6846f4b169 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Fri, 13 Aug 2021 15:45:53 -0700 Subject: [PATCH] auto-t: turn off scan address randomization in testHotspot This (hopefully) will make this test pass better on slower machines. In addition the mechanism of copying over separate main.conf files was changed (rather than echo'ing the option into /tmp/main.conf) --- autotests/testHotspot/anqp_delay_test.py | 5 ++--- autotests/testHotspot/anqp_disabled.conf | 5 +++++ autotests/testHotspot/anqp_enabled.conf | 5 +++++ autotests/testHotspot/autoconnect_test.py | 5 ++--- autotests/testHotspot/hessid_test.py | 5 ++--- autotests/testHotspot/hotspot_test.py | 5 ++--- autotests/testHotspot/roaming_test.py | 5 ++--- 7 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 autotests/testHotspot/anqp_disabled.conf create mode 100644 autotests/testHotspot/anqp_enabled.conf diff --git a/autotests/testHotspot/anqp_delay_test.py b/autotests/testHotspot/anqp_delay_test.py index 323e1fd3..04e5a1d7 100644 --- a/autotests/testHotspot/anqp_delay_test.py +++ b/autotests/testHotspot/anqp_delay_test.py @@ -5,8 +5,8 @@ import sys import os sys.path.append('../util') -import iwd from iwd import IWD +from iwd import IWD_CONFIG_DIR from iwd import PSKAgent from iwd import NetworkType from hostapd import HostapdCLI @@ -87,8 +87,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('example.conf') - conf = '[General]\nDisableANQP=0\n' - os.system('echo "%s" > /tmp/main.conf' % conf) + IWD.copy_to_storage('anqp_enabled.conf', storage_dir=IWD_CONFIG_DIR, name='main.conf') @classmethod def tearDownClass(cls): diff --git a/autotests/testHotspot/anqp_disabled.conf b/autotests/testHotspot/anqp_disabled.conf new file mode 100644 index 00000000..b18f66d7 --- /dev/null +++ b/autotests/testHotspot/anqp_disabled.conf @@ -0,0 +1,5 @@ +[General] +DisableANQP=1 + +[Scan] +DisableMacAddressRandomization=true diff --git a/autotests/testHotspot/anqp_enabled.conf b/autotests/testHotspot/anqp_enabled.conf new file mode 100644 index 00000000..c66a63e0 --- /dev/null +++ b/autotests/testHotspot/anqp_enabled.conf @@ -0,0 +1,5 @@ +[General] +DisableANQP=0 + +[Scan] +DisableMacAddressRandomization=true diff --git a/autotests/testHotspot/autoconnect_test.py b/autotests/testHotspot/autoconnect_test.py index 354bf61b..777a0670 100644 --- a/autotests/testHotspot/autoconnect_test.py +++ b/autotests/testHotspot/autoconnect_test.py @@ -5,8 +5,8 @@ import sys import os sys.path.append('../util') -import iwd from iwd import IWD +from iwd import IWD_CONFIG_DIR from iwd import NetworkType from hostapd import HostapdCLI import testutil @@ -109,8 +109,7 @@ class Test(unittest.TestCase): def setUpClass(cls): IWD.copy_to_hotspot('autoconnect.conf') IWD.copy_to_storage('ssidWPA2-1.psk') - conf = '[General]\nDisableANQP=0\n' - os.system('echo "%s" > /tmp/main.conf' % conf) + IWD.copy_to_storage('anqp_enabled.conf', storage_dir=IWD_CONFIG_DIR, name='main.conf') @classmethod def tearDownClass(cls): diff --git a/autotests/testHotspot/hessid_test.py b/autotests/testHotspot/hessid_test.py index 5d3954b9..88e750de 100644 --- a/autotests/testHotspot/hessid_test.py +++ b/autotests/testHotspot/hessid_test.py @@ -5,8 +5,8 @@ import sys import os sys.path.append('../util') -import iwd from iwd import IWD +from iwd import IWD_CONFIG_DIR from iwd import PSKAgent from iwd import NetworkType from hostapd import HostapdCLI @@ -50,8 +50,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('hessid.conf') - conf = '[General]\nDisableANQP=1\n' - os.system('echo "%s" > /tmp/main.conf' % conf) + IWD.copy_to_storage('anqp_disabled.conf', storage_dir=IWD_CONFIG_DIR, name='main.conf') @classmethod def tearDownClass(cls): diff --git a/autotests/testHotspot/hotspot_test.py b/autotests/testHotspot/hotspot_test.py index 460ff89f..f49477dc 100644 --- a/autotests/testHotspot/hotspot_test.py +++ b/autotests/testHotspot/hotspot_test.py @@ -5,8 +5,8 @@ import sys import os sys.path.append('../util') -import iwd from iwd import IWD +from iwd import IWD_CONFIG_DIR from iwd import PSKAgent from iwd import NetworkType from hostapd import HostapdCLI @@ -50,8 +50,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('example.conf') - conf = '[General]\nDisableANQP=0\n' - os.system('echo "%s" > /tmp/main.conf' % conf) + IWD.copy_to_storage('anqp_enabled.conf', storage_dir=IWD_CONFIG_DIR, name='main.conf') @classmethod def tearDownClass(cls): diff --git a/autotests/testHotspot/roaming_test.py b/autotests/testHotspot/roaming_test.py index d18864e0..6cdd6922 100644 --- a/autotests/testHotspot/roaming_test.py +++ b/autotests/testHotspot/roaming_test.py @@ -5,8 +5,8 @@ import sys import os sys.path.append('../util') -import iwd from iwd import IWD +from iwd import IWD_CONFIG_DIR from iwd import PSKAgent from iwd import NetworkType from hostapd import HostapdCLI @@ -50,8 +50,7 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_hotspot('roaming.conf') - conf = '[General]\nDisableANQP=1\n' - os.system('echo "%s" > /tmp/main.conf' % conf) + IWD.copy_to_storage('anqp_disabled.conf', storage_dir=IWD_CONFIG_DIR, name='main.conf') @classmethod def tearDownClass(cls):