eiwd

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

fils_384_test.py (2046B)


      1 #!/usr/bin/python3
      2 
      3 import unittest
      4 import sys
      5 import os
      6 
      7 sys.path.append('../util')
      8 import iwd
      9 from iwd import IWD
     10 from iwd import NetworkType
     11 from hostapd import HostapdCLI
     12 import testutil
     13 
     14 class Test(unittest.TestCase):
     15     def test_connection_success(self):
     16         hapd = HostapdCLI(config='ssidFILS-384.conf')
     17 
     18         wd = IWD(True)
     19 
     20         devices = wd.list_devices(1)
     21         device = devices[0]
     22 
     23         ordered_network = device.get_ordered_network('ssidFILS-384')
     24 
     25         self.assertEqual(ordered_network.type, NetworkType.eap)
     26 
     27         condition = 'not obj.connected'
     28         wd.wait_for_object_condition(ordered_network.network_object, condition)
     29 
     30         ordered_network.network_object.connect()
     31 
     32         condition = 'obj.state == DeviceState.connected'
     33         wd.wait_for_object_condition(device, condition)
     34 
     35         testutil.test_iface_operstate()
     36         testutil.test_ifaces_connected(device.name, hapd.ifname)
     37 
     38         device.disconnect()
     39 
     40         condition = 'not obj.connected'
     41         wd.wait_for_object_condition(ordered_network.network_object, condition)
     42 
     43         ordered_network = device.get_ordered_network('ssidFILS-384')
     44 
     45         self.assertEqual(ordered_network.type, NetworkType.eap)
     46 
     47         condition = 'not obj.connected'
     48         wd.wait_for_object_condition(ordered_network.network_object, condition)
     49 
     50         ordered_network.network_object.connect()
     51 
     52         condition = 'obj.state == DeviceState.connected'
     53         wd.wait_for_object_condition(device, condition)
     54 
     55         testutil.test_iface_operstate()
     56         testutil.test_ifaces_connected(device.name, hapd.ifname)
     57 
     58         #
     59         # TODO: If this is failing its likely due to an older hostapd version
     60         #       not containing commit 7ee814201b72
     61         #
     62         hapd.rekey(device.address)
     63 
     64         device.disconnect()
     65 
     66     @classmethod
     67     def setUpClass(cls):
     68         IWD.copy_to_storage('ssidFILS-384.8021x')
     69 
     70     @classmethod
     71     def tearDownClass(cls):
     72         IWD.clear_storage()
     73 
     74 if __name__ == '__main__':
     75     unittest.main(exit=True)