3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-09 05:29:23 +01:00
iwd/autotests/testEAD/connection_test.py

41 lines
929 B
Python
Raw Normal View History

2020-09-17 23:32:47 +02:00
#!/usr/bin/python3
import unittest
import sys
import os
2020-09-17 23:32:47 +02:00
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)
2020-09-17 23:32:47 +02:00
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')
2020-09-17 23:32:47 +02:00
@classmethod
def tearDownClass(cls):
IWD.clear_storage(storage_dir='/tmp/ead')
2020-09-17 23:32:47 +02:00
if __name__ == '__main__':
unittest.main(exit=True)