diff --git a/autotests/testFT-SAE-roam/connection_test.py b/autotests/testFT-SAE-roam/connection_test.py index dcea148c..99f58456 100644 --- a/autotests/testFT-SAE-roam/connection_test.py +++ b/autotests/testFT-SAE-roam/connection_test.py @@ -11,9 +11,12 @@ from iwd import NetworkType from hwsim import Hwsim from hostapd import HostapdCLI import testutil +from config import ctx class Test(unittest.TestCase): def test_roam_success(self): + wd = IWD() + hwsim = Hwsim() rule0 = hwsim.rules.create() @@ -28,8 +31,6 @@ class Test(unittest.TestCase): rule2.source = self.bss_radio[2].addresses[0] rule2.bidirectional = True - wd = IWD() - psk_agent = PSKAgent("EasilyGuessedPassword") wd.register_psk_agent(psk_agent) @@ -158,17 +159,20 @@ class Test(unittest.TestCase): hwsim.get_radio('rad1'), hwsim.get_radio('rad2') ] - # Set interface addresses to those expected by hostapd config files - os.system('ifconfig "' + cls.bss_hostapd[0].ifname + - '" down hw ether 12:00:00:00:00:01 up') - os.system('ifconfig "' + cls.bss_hostapd[1].ifname + - '" down hw ether 12:00:00:00:00:02 up') - os.system('ifconfig "' + cls.bss_hostapd[2].ifname + - '" down hw ether 12:00:00:00:00:03 up') + ctx.start_process(['ifconfig', cls.bss_hostapd[0].ifname, 'down', 'hw', \ + 'ether', '12:00:00:00:00:01', 'up'], wait=True) + ctx.start_process(['ifconfig', cls.bss_hostapd[1].ifname, 'down', 'hw', \ + 'ether', '12:00:00:00:00:02', 'up'], wait=True) + ctx.start_process(['ifconfig', cls.bss_hostapd[2].ifname, 'down', 'hw', \ + 'ether', '12:00:00:00:00:03', 'up'], wait=True) + # Set interface addresses to those expected by hostapd config files cls.bss_hostapd[0].reload() + cls.bss_hostapd[0].wait_for_event("AP-ENABLED") cls.bss_hostapd[1].reload() + cls.bss_hostapd[1].wait_for_event("AP-ENABLED") cls.bss_hostapd[2].reload() + cls.bss_hostapd[2].wait_for_event("AP-ENABLED") # Fill in the neighbor AP tables in both BSSes. By default each # instance knows only about current BSS, even inside one hostapd diff --git a/autotests/testFT-SAE-roam/ft-psk-3.conf b/autotests/testFT-SAE-roam/ft-psk-3.conf index 6a2d4cad..8918cf9e 100644 --- a/autotests/testFT-SAE-roam/ft-psk-3.conf +++ b/autotests/testFT-SAE-roam/ft-psk-3.conf @@ -16,8 +16,6 @@ wpa_passphrase=EasilyGuessedPassword wpa_ptk_rekey=30 wpa_group_rekey=80 ieee80211w=2 -rsn_preauth=1 -rsn_preauth_interfaces=lo disable_pmksa_caching=0 # Allow PMK cache to be shared opportunistically among configured interfaces # and BSSes (i.e., all configurations within a single hostapd process). diff --git a/autotests/testFT-SAE-roam/ft-sae-1.conf b/autotests/testFT-SAE-roam/ft-sae-1.conf index 6642c398..aa40494a 100644 --- a/autotests/testFT-SAE-roam/ft-sae-1.conf +++ b/autotests/testFT-SAE-roam/ft-sae-1.conf @@ -10,14 +10,12 @@ nas_identifier=dummy1 wpa=2 # Can support SAE and FT-SAE (space separated list) and/or EAP at the same # time but we want to force FT -wpa_key_mgmt=FT-SAE +wpa_key_mgmt=FT-SAE SAE sae_password=EasilyGuessedPassword|mac=ff:ff:ff:ff:ff:ff wpa_pairwise=CCMP wpa_ptk_rekey=30 wpa_group_rekey=80 ieee80211w=2 -rsn_preauth=1 -rsn_preauth_interfaces=lo disable_pmksa_caching=0 # Allow PMK cache to be shared opportunistically among configured interfaces # and BSSes (i.e., all configurations within a single hostapd process). diff --git a/autotests/testFT-SAE-roam/ft-sae-2.conf b/autotests/testFT-SAE-roam/ft-sae-2.conf index fa841db8..5bff6c9d 100644 --- a/autotests/testFT-SAE-roam/ft-sae-2.conf +++ b/autotests/testFT-SAE-roam/ft-sae-2.conf @@ -10,14 +10,12 @@ nas_identifier=dummy2 wpa=2 # Can support SAE and FT-SAE (space separated list) and/or EAP at the same # time but we want to force FT -wpa_key_mgmt=FT-SAE +wpa_key_mgmt=FT-SAE SAE sae_password=EasilyGuessedPassword|mac=ff:ff:ff:ff:ff:ff wpa_pairwise=CCMP wpa_ptk_rekey=30 wpa_group_rekey=80 ieee80211w=2 -rsn_preauth=1 -rsn_preauth_interfaces=lo disable_pmksa_caching=0 # Allow PMK cache to be shared opportunistically among configured interfaces # and BSSes (i.e., all configurations within a single hostapd process).