doc: add testing option to hostapd.config
James Prestwood
PATCH 1/6 doc: add testing option to hostapd.config
This is required to be built in for hostapd to rekey on command.
--- doc/hostapd.config | 1 + 1 file changed, 1 insertion(+)
doc/hostapd.config +1 -0
@@ -36,3 +36,4 @@ CONFIG_OCV=y CONFIG_OWE=y CONFIG_DPP=y CONFIG_SAE=y +CONFIG_TESTING_OPTIONS=y
Signature · 1 line
2.31.1
James Prestwood
PATCH 2/6 auto-t: add OCV to FILS test
--- autotests/testFILS/ssidFILS-256.conf | 1 + autotests/testFILS/ssidFILS-384.conf | 1 + 2 files changed, 2 insertions(+)
autotests/testFILS/ssidFILS-256.conf +1 -0
@@ -19,3 +19,4 @@ disable_pmksa_caching=1 wpa_group_rekey=30 wpa_ptk_rekey=30 +ocv=1
autotests/testFILS/ssidFILS-384.conf +1 -0
@@ -19,3 +19,4 @@ disable_pmksa_caching=1 wpa_group_rekey=30 wpa_ptk_rekey=30 +ocv=1
Signature · 1 line
2.31.1
James Prestwood
PATCH 3/6 auto-t: block auth frames for FT-over-DS test
In reply to James PrestwoodThe FT-over-DS test was allowed to fail as it stood. If FT-over-DS failed it would just do a normal over-Air transition which satisfied all the checks. To prevent this Authenticate frames are blocked after the initial connection so if FT-over-DS fails there is no other way to roam.
--- autotests/testPSK-roam/connection_test.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
autotests/testPSK-roam/connection_test.py +15 -0
@@ -59,6 +59,9 @@ class Test(unittest.TestCase): self.assertRaises(Exception, testutil.test_ifaces_connected, (self.bss_hostapd[1].ifname, device.name, True, True)) + if over_ds: + self.rule0.enabled = True + device.roam(self.bss_hostapd[1].bssid) condition = 'obj.state == DeviceState.roaming'
@@ -150,12 +153,24 @@ class Test(unittest.TestCase): os.system('ifconfig "' + self.bss_hostapd[0].ifname + '" up') os.system('ifconfig "' + self.bss_hostapd[1].ifname + '" up') + self.rule0.enabled = False + @classmethod def setUpClass(cls): + hwsim = Hwsim() + IWD.copy_to_storage('TestFT.psk') cls.bss_hostapd = [ HostapdCLI(config='ft-psk-ccmp-1.conf'), HostapdCLI(config='ft-psk-ccmp-2.conf') ] + rad2 = hwsim.get_radio('rad2') + + cls.rule0 = hwsim.rules.create() + cls.rule0.source = rad2.addresses[0] + cls.rule0.bidirectional = True + cls.rule0.signal = -2000 + cls.rule0.prefix = 'b0' + cls.rule0.drop = True # Set interface addresses to those expected by hostapd config files os.system('ifconfig "' + cls.bss_hostapd[0].ifname +
Signature · 1 line
2.31.1
James Prestwood
PATCH 4/6 auto-t: fix testSAE to continue if a test fails
In reply to James Prestwood--- autotests/testSAE/connection_test.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
autotests/testSAE/connection_test.py +12 -15
@@ -62,9 +62,7 @@ class Test(unittest.TestCase): self.hostapd.set_value('vendor_elements', '') self.hostapd.reload() self.hostapd.wait_for_event("AP-ENABLED") - wd = IWD(True) - self.validate_connection(wd) - wd.clear_storage() + self.validate_connection(self.wd) def test_SAE_force_group_19(self): self.hostapd.set_value('sae_pwe', '0')
@@ -74,9 +72,7 @@ class Test(unittest.TestCase): self.hostapd.set_value('vendor_elements', 'dd0cf4f5e8050500000000000000') self.hostapd.reload() self.hostapd.wait_for_event("AP-ENABLED") - wd = IWD(True) - self.validate_connection(wd) - wd.clear_storage() + self.validate_connection(self.wd) def test_SAE_Group20(self): self.hostapd.set_value('sae_pwe', '0')
@@ -84,9 +80,7 @@ class Test(unittest.TestCase): self.hostapd.set_value('vendor_elements', '') self.hostapd.reload() self.hostapd.wait_for_event("AP-ENABLED") - wd = IWD(True) - self.validate_connection(wd) - wd.clear_storage() + self.validate_connection(self.wd) def test_SAE_H2E(self): self.hostapd.set_value('sae_pwe', '1')
@@ -94,9 +88,7 @@ class Test(unittest.TestCase): self.hostapd.set_value('vendor_elements', '') self.hostapd.reload() self.hostapd.wait_for_event("AP-ENABLED") - wd = IWD(True) - self.validate_connection(wd) - wd.clear_storage() + self.validate_connection(self.wd) def test_SAE_H2E_Group20(self): self.hostapd.set_value('sae_pwe', '1')
@@ -104,9 +96,14 @@ class Test(unittest.TestCase): self.hostapd.set_value('vendor_elements', '') self.hostapd.reload() self.hostapd.wait_for_event("AP-ENABLED") - wd = IWD(True) - self.validate_connection(wd) - wd.clear_storage() + self.validate_connection(self.wd) + + def setUp(self): + self.wd = IWD(True) + + def tearDown(self): + self.wd.clear_storage() + self.wd = None @classmethod def setUpClass(cls):
Signature · 1 line
2.31.1
James Prestwood
PATCH 5/6 auto-t: hostapd.py: add rekey() utility
In reply to James PrestwoodForces GTK/PTK rekeys
--- autotests/util/hostapd.py | 6 ++++++ 1 file changed, 6 insertions(+)
autotests/util/hostapd.py +6 -0
@@ -202,6 +202,12 @@ class HostapdCLI(object): cmd = self.cmdline + ['req_beacon', addr, request] ctx.start_process(cmd).wait() + def rekey(self, address): + cmd = 'REKEY_GTK' + self.ctrl_sock.sendall(cmd.encode('utf-8')) + cmd = 'REKEY_PTK %s' % address + self.ctrl_sock.sendall(cmd.encode('utf-8')) + @property def bssid(self): cmd = self.cmdline + ['status']
Signature · 1 line
2.31.1
James Prestwood
PATCH 6/6 auto-t: rekey in FT/FILS tests
In reply to James Prestwood--- autotests/testFILS/fils_256_test.py | 3 +++ autotests/testFILS/fils_384_test.py | 3 +++ autotests/testFT-FILS/connection_test.py | 3 +++ autotests/testPSK-roam/connection_test.py | 3 +++ 4 files changed, 12 insertions(+)
autotests/testFILS/fils_256_test.py +3 -0
@@ -55,6 +55,9 @@ class Test(unittest.TestCase): testutil.test_iface_operstate() testutil.test_ifaces_connected(device.name, hapd.ifname) + hapd.rekey(device.address) + hapd.wait_for_event('EAPOL-4WAY-HS-COMPLETED') + device.disconnect() @classmethod
autotests/testFILS/fils_384_test.py +3 -0
@@ -55,6 +55,9 @@ class Test(unittest.TestCase): testutil.test_iface_operstate() testutil.test_ifaces_connected(device.name, hapd.ifname) + hapd.rekey(device.address) + hapd.wait_for_event('EAPOL-4WAY-HS-COMPLETED') + device.disconnect() @classmethod
autotests/testFT-FILS/connection_test.py +3 -0
@@ -95,6 +95,9 @@ class Test(unittest.TestCase): self.assertRaises(Exception, testutil.test_ifaces_connected, (self.bss_hostapd[0].ifname, device.name, True, True)) + self.bss_hostapd[1].rekey(device.address) + self.bss_hostapd[1].wait_for_event('EAPOL-4WAY-HS-COMPLETED') + def test_fils_ft_roam_sha256(self): wd = IWD(True)
autotests/testPSK-roam/connection_test.py +3 -0
@@ -80,6 +80,9 @@ class Test(unittest.TestCase): self.assertRaises(Exception, testutil.test_ifaces_connected, (self.bss_hostapd[0].ifname, device.name, True, True)) + self.bss_hostapd[1].rekey(device.address) + self.bss_hostapd[1].wait_for_event('EAPOL-4WAY-HS-COMPLETED') + device.roam(self.bss_hostapd[0].bssid) condition = 'obj.state == DeviceState.roaming'
Signature · 1 line
2.31.1
Denis Kenzior
Hi James,
Quoted 5 lines · James Prestwood
This is required to be built in for hostapd to rekey on command.
--- doc/hostapd.config | 1 + 1 file changed, 1 insertion(+)
All applied, thanks.
Regards,
-Denis