3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-01 01:29:23 +01:00
iwd/autotests/testEAD/connection_test.py
James Prestwood 313d8dbbed auto-t: remove requirement for /var/lib/{ead,iwd}
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.
2020-10-14 13:03:17 -05:00

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)