eiwd

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

connection_test.py (1005B)


      1 #!/usr/bin/python3
      2 
      3 import unittest
      4 import sys
      5 
      6 sys.path.append('../util')
      7 import iwd
      8 from iwd import IWD
      9 from iwd import PSKAgent
     10 from iwd import NetworkType
     11 import testutil
     12 
     13 class Test(unittest.TestCase):
     14 
     15     def test_connection_success(self):
     16         wd = IWD()
     17 
     18         psk_agent = PSKAgent("secret123")
     19         wd.register_psk_agent(psk_agent)
     20 
     21         devices = wd.list_devices(1)
     22         device = devices[0]
     23 
     24         ordered_network = device.get_ordered_network('ssidCCMP')
     25 
     26         self.assertEqual(ordered_network.type, NetworkType.psk)
     27 
     28         condition = 'not obj.connected'
     29         wd.wait_for_object_condition(ordered_network.network_object, condition)
     30 
     31         with self.assertRaises(iwd.NotSupportedEx):
     32             ordered_network.network_object.connect()
     33 
     34         wd.unregister_psk_agent(psk_agent)
     35 
     36     @classmethod
     37     def setUpClass(cls):
     38         pass
     39 
     40     @classmethod
     41     def tearDownClass(cls):
     42         IWD.clear_storage()
     43 
     44 if __name__ == '__main__':
     45     unittest.main(exit=True)