mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-27 19:22:34 +01:00
313d8dbbed
The host systems configuration directories for IWD/EAD were being mounted in the virtual machine. This required that the host create these directories before hand. Instead we can just set up the system and IWD/EAD to use directories in /tmp that we create when we start the VM. This avoids the need for any host configuration.
41 lines
929 B
Python
41 lines
929 B
Python
#!/usr/bin/python3
|
|
|
|
import unittest
|
|
import sys
|
|
import os
|
|
|
|
sys.path.append('../util')
|
|
from iwd import IWD
|
|
from config import ctx
|
|
|
|
from ead import EAD
|
|
|
|
class Test(unittest.TestCase):
|
|
def test_connection_success(self):
|
|
env = os.environ.copy()
|
|
env['STATE_DIRECTORY'] = '/tmp/ead'
|
|
ctx.start_process(['ead', '-i', 'eth1', '-d'], env=env)
|
|
|
|
ead = EAD()
|
|
|
|
adapter = ead.list_adapters(1)[0]
|
|
|
|
condition = 'obj.connected == True'
|
|
ead.wait_for_object_condition(adapter, condition)
|
|
|
|
condition = 'obj.authenticated == True'
|
|
ead.wait_for_object_condition(adapter, condition)
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
os.mkdir('/tmp/ead')
|
|
|
|
IWD.copy_to_storage('default.8021x', storage_dir='/tmp/ead')
|
|
|
|
@classmethod
|
|
def tearDownClass(cls):
|
|
IWD.clear_storage(storage_dir='/tmp/ead')
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main(exit=True)
|