3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-06 03:18:46 +02:00
iwd/autotests/testAP/connection_test.py

33 lines
721 B
Python
Raw Normal View History

2017-10-21 01:27:22 +02:00
#! /usr/bin/python3
import unittest
from iwd import IWD
from validation import validate, client_connect
2017-10-21 01:27:22 +02:00
class Test(unittest.TestCase):
def test_connection_success(self):
wd = IWD(True)
2017-10-21 01:27:22 +02:00
dev1, dev2 = wd.list_devices(2)
2017-10-21 01:27:22 +02:00
client_connect(wd, dev1, 'TestAP1')
2017-10-21 01:27:22 +02:00
dev1.start_ap('TestAP2', 'Password2')
validate(wd, dev2, dev1, 'TestAP2', 'Password2')
2017-10-21 01:27:22 +02:00
# Finally test dev1 can go to client mode and connect again
client_connect(wd, dev1, 'TestAP1')
2017-10-21 01:27:22 +02:00
@classmethod
def setUpClass(cls):
IWD.copy_to_storage('TestAP1.psk')
2017-10-21 01:27:22 +02:00
@classmethod
def tearDownClass(cls):
IWD.clear_storage()
if __name__ == '__main__':
unittest.main(exit=True)