eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit 65eeab1313ff6df2662689ff1ce172b26872b0dc
parent 0c554500e1d44018c870c56f64d714b55e2f29ea
Author: James Prestwood <james.prestwood@linux.intel.com>
Date:   Tue, 11 Jun 2019 09:25:54 -0700

auto-t: updated autotests to use hwsim.get_radio

This removes all the duplicated code where the interfaces are iterated
and the radio/hostapd instances are created. Instead the two new APIs
are used to get each instance, e.g.:

hapd = HostapdCLI(config='ssid.conf')
radio = hwsim.get_radio('radX')

Diffstat:
Mautotests/testAPRoam/connection_test.py | 26++++++--------------------
Mautotests/testBSSBlacklist/all_blacklisted_test.py | 26++++++--------------------
Mautotests/testBSSBlacklist/bad_pass_test.py | 26++++++--------------------
Mautotests/testBSSBlacklist/connection_test.py | 26++++++--------------------
Mautotests/testBSSBlacklist/temp_blacklist_test.py | 26++++++--------------------
Mautotests/testFT-8021x-roam/test.py | 21++++-----------------
Mautotests/testFT-FILS-SHA256/test.py | 21++++-----------------
Mautotests/testFT-FILS-SHA384/test.py | 21++++-----------------
Mautotests/testFT-PSK-over-DS/test.py | 21++++-----------------
Mautotests/testFT-PSK-roam/test.py | 21++++-----------------
Mautotests/testFT-SAE-roam/test.py | 25++++++-------------------
Mautotests/testHT-VHT/test.py | 29++++++-----------------------
Mautotests/testOWE/timeout_test.py | 8+-------
Mautotests/testPreauth-roam/test.py | 21++++-----------------
Mautotests/testSAQuery-spoofing/connection_test.py | 8++------
15 files changed, 69 insertions(+), 257 deletions(-)

diff --git a/autotests/testAPRoam/connection_test.py b/autotests/testAPRoam/connection_test.py @@ -19,26 +19,12 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - bss_hostapd = [None, None, None] - bss_radio = [None, None, None] - - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - elif intf.config and '3' in intf.config: - bss_idx = 2 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - bss_hostapd[bss_idx] = HostapdCLI(intf) - bss_radio[bss_idx] = radio + bss_hostapd = [ HostapdCLI(config='ssid1.conf'), + HostapdCLI(config='ssid2.conf'), + HostapdCLI(config='ssid3.conf') ] + bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1'), + hwsim.get_radio('rad2') ] wd = IWD() diff --git a/autotests/testBSSBlacklist/all_blacklisted_test.py b/autotests/testBSSBlacklist/all_blacklisted_test.py @@ -21,26 +21,12 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - bss_radio = [None, None, None] - bss_hostapd = [None, None, None] - - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - elif intf.config and '3' in intf.config: - bss_idx = 2 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - bss_radio[bss_idx] = radio - bss_hostapd[bss_idx] = HostapdCLI(intf) + bss_hostapd = [ HostapdCLI(config='ssid1.conf'), + HostapdCLI(config='ssid2.conf'), + HostapdCLI(config='ssid3.conf') ] + bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1'), + hwsim.get_radio('rad2') ] rule0 = hwsim.rules.create() rule0.source = bss_radio[0].addresses[0] diff --git a/autotests/testBSSBlacklist/bad_pass_test.py b/autotests/testBSSBlacklist/bad_pass_test.py @@ -21,26 +21,12 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - bss_radio = [None, None, None] - bss_hostapd = [None, None, None] - - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - elif intf.config and '3' in intf.config: - bss_idx = 2 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - bss_radio[bss_idx] = radio - bss_hostapd[bss_idx] = HostapdCLI(intf) + bss_hostapd = [ HostapdCLI(config='ssid1.conf'), + HostapdCLI(config='ssid2.conf'), + HostapdCLI(config='ssid3.conf') ] + bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1'), + hwsim.get_radio('rad2') ] rule0 = hwsim.rules.create() rule0.source = bss_radio[0].addresses[0] diff --git a/autotests/testBSSBlacklist/connection_test.py b/autotests/testBSSBlacklist/connection_test.py @@ -21,26 +21,12 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - bss_radio = [None, None, None] - bss_hostapd = [None, None, None] - - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - elif intf.config and '3' in intf.config: - bss_idx = 2 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - bss_radio[bss_idx] = radio - bss_hostapd[bss_idx] = HostapdCLI(intf) + bss_hostapd = [ HostapdCLI(config='ssid1.conf'), + HostapdCLI(config='ssid2.conf'), + HostapdCLI(config='ssid3.conf') ] + bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1'), + hwsim.get_radio('rad2') ] rule0 = hwsim.rules.create() rule0.source = bss_radio[0].addresses[0] diff --git a/autotests/testBSSBlacklist/temp_blacklist_test.py b/autotests/testBSSBlacklist/temp_blacklist_test.py @@ -21,26 +21,12 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - bss_radio = [None, None, None] - bss_hostapd = [None, None, None] - - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - elif intf.config and '3' in intf.config: - bss_idx = 2 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - bss_radio[bss_idx] = radio - bss_hostapd[bss_idx] = HostapdCLI(intf) + bss_hostapd = [ HostapdCLI(config='ssid1.conf'), + HostapdCLI(config='ssid2.conf'), + HostapdCLI(config='ssid3.conf') ] + bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1'), + hwsim.get_radio('rad2') ] rule0 = hwsim.rules.create() rule0.source = bss_radio[0].addresses[0] diff --git a/autotests/testFT-8021x-roam/test.py b/autotests/testFT-8021x-roam/test.py @@ -192,23 +192,10 @@ class Test(unittest.TestCase): hwsim = Hwsim() - cls.bss_hostapd = [None, None] - cls.bss_radio = [None, None] - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - cls.bss_hostapd[bss_idx] = HostapdCLI(intf) - cls.bss_radio[bss_idx] = radio + cls.bss_hostapd = [ HostapdCLI(config='ft-eap-ccmp-1.conf'), + HostapdCLI(config='ft-eap-ccmp-2.conf') ] + cls.bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1') ] # Set interface addresses to those expected by hostapd config files os.system('ifconfig "' + cls.bss_hostapd[0].ifname + diff --git a/autotests/testFT-FILS-SHA256/test.py b/autotests/testFT-FILS-SHA256/test.py @@ -147,23 +147,10 @@ class Test(unittest.TestCase): hwsim = Hwsim() - cls.bss_hostapd = [None, None] - cls.bss_radio = [None, None] - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - cls.bss_hostapd[bss_idx] = HostapdCLI(intf) - cls.bss_radio[bss_idx] = radio + cls.bss_hostapd = [ HostapdCLI(config='ft-eap-ccmp-1.conf'), + HostapdCLI(config='ft-eap-ccmp-2.conf') ] + cls.bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1') ] # Set interface addresses to those expected by hostapd config files os.system('ifconfig "' + cls.bss_hostapd[0].ifname + diff --git a/autotests/testFT-FILS-SHA384/test.py b/autotests/testFT-FILS-SHA384/test.py @@ -147,23 +147,10 @@ class Test(unittest.TestCase): hwsim = Hwsim() - cls.bss_hostapd = [None, None] - cls.bss_radio = [None, None] - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - cls.bss_hostapd[bss_idx] = HostapdCLI(intf) - cls.bss_radio[bss_idx] = radio + cls.bss_hostapd = [ HostapdCLI(config='ft-eap-ccmp-1.conf'), + HostapdCLI(config='ft-eap-ccmp-2.conf') ] + cls.bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1') ] # Set interface addresses to those expected by hostapd config files os.system('ifconfig "' + cls.bss_hostapd[0].ifname + diff --git a/autotests/testFT-PSK-over-DS/test.py b/autotests/testFT-PSK-over-DS/test.py @@ -120,23 +120,10 @@ class Test(unittest.TestCase): def setUpClass(cls): hwsim = Hwsim() - cls.bss_hostapd = [None, None] - cls.bss_radio = [None, None] - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - cls.bss_hostapd[bss_idx] = HostapdCLI(intf) - cls.bss_radio[bss_idx] = radio + cls.bss_hostapd = [ HostapdCLI(config='ft-psk-ccmp-1.conf'), + HostapdCLI(config='ft-psk-ccmp-2.conf') ] + cls.bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1') ] # Set interface addresses to those expected by hostapd config files os.system('ifconfig "' + cls.bss_hostapd[0].ifname + diff --git a/autotests/testFT-PSK-roam/test.py b/autotests/testFT-PSK-roam/test.py @@ -201,23 +201,10 @@ class Test(unittest.TestCase): def setUpClass(cls): hwsim = Hwsim() - cls.bss_hostapd = [None, None] - cls.bss_radio = [None, None] - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - cls.bss_hostapd[bss_idx] = HostapdCLI(intf) - cls.bss_radio[bss_idx] = radio + cls.bss_hostapd = [ HostapdCLI(config='ft-psk-ccmp-1.conf'), + HostapdCLI(config='ft-psk-ccmp-2.conf') ] + cls.bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1') ] # Set interface addresses to those expected by hostapd config files os.system('ifconfig "' + cls.bss_hostapd[0].ifname + diff --git a/autotests/testFT-SAE-roam/test.py b/autotests/testFT-SAE-roam/test.py @@ -151,25 +151,12 @@ class Test(unittest.TestCase): def setUpClass(cls): hwsim = Hwsim() - cls.bss_hostapd = [None, None, None] - cls.bss_radio = [None, None, None] - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - elif intf.config and '3' in intf.config: - bss_idx = 2 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - cls.bss_hostapd[bss_idx] = HostapdCLI(intf) - cls.bss_radio[bss_idx] = radio + cls.bss_hostapd = [ HostapdCLI(config='ft-sae-1.conf'), + HostapdCLI(config='ft-sae-2.conf'), + HostapdCLI(config='ft-psk-3.conf') ] + cls.bss_radio = [ hwsim.get_radio('rad0'), + 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 + diff --git a/autotests/testHT-VHT/test.py b/autotests/testHT-VHT/test.py @@ -50,29 +50,12 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - non_ht_hostapd = None - ht_hostapd = None - non_ht_radio = None - ht_radio = None - vht_radio = None - - for intf in hostapd_map.values(): - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - if intf.config == 'non-ht-vht.conf': - non_ht_hostapd = HostapdCLI(intf) - non_ht_radio = radio - elif intf.config == 'ht.conf': - ht_hostapd = HostapdCLI(intf) - ht_radio = radio - elif intf.config == 'vht.conf': - vht_hostapd = HostapdCLI(intf) - vht_radio = radio - else: - continue + non_ht_hostapd = HostapdCLI(config='non-ht-vht.conf') + ht_hostapd = HostapdCLI(config='ht.conf') + vht_hostapd = HostapdCLI(config='vht.conf') + non_ht_radio = hwsim.get_radio('rad0') + ht_radio = hwsim.get_radio('rad1') + vht_radio = hwsim.get_radio('rad2') self.assertIsNotNone(non_ht_hostapd) self.assertIsNotNone(ht_hostapd) diff --git a/autotests/testOWE/timeout_test.py b/autotests/testOWE/timeout_test.py @@ -17,13 +17,7 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - bss_radio = None - - intf = list(hostapd.hostapd_map.values())[0] - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - bss_radio = radio + bss_radio = hwsim.get_radio('rad0') self.assertIsNotNone(bss_radio) diff --git a/autotests/testPreauth-roam/test.py b/autotests/testPreauth-roam/test.py @@ -16,23 +16,10 @@ class Test(unittest.TestCase): def test_preauth_success(self): hwsim = Hwsim() - bss_hostapd = [None, None] - bss_radio = [None, None] - for intf in hostapd_map.values(): - if intf.config and '1' in intf.config: - bss_idx = 0 - elif intf.config and '2' in intf.config: - bss_idx = 1 - else: - continue - - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break - - bss_hostapd[bss_idx] = HostapdCLI(intf) - bss_radio[bss_idx] = radio + bss_hostapd = [ HostapdCLI(config='eaptls-preauth-1.conf'), + HostapdCLI(config='eaptls-preauth-2.conf') ] + bss_radio = [ hwsim.get_radio('rad0'), + hwsim.get_radio('rad1') ] rule0 = hwsim.rules.create() rule0.source = bss_radio[0].addresses[0] diff --git a/autotests/testSAQuery-spoofing/connection_test.py b/autotests/testSAQuery-spoofing/connection_test.py @@ -18,12 +18,8 @@ class Test(unittest.TestCase): def test_connection_success(self): hwsim = Hwsim() - intf = list(hostapd_map.values())[0] - hostapd = HostapdCLI(intf) - for path in hwsim.radios: - radio = hwsim.radios[path] - if radio.name == intf.wiphy.name: - break + hostapd = HostapdCLI(config='ssidCCMP.conf') + radio = hwsim.get_radio('rad0') wd = IWD()