3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

auto-t: add client test to testAP

Tests iwctl functionality with ap commands
This commit is contained in:
James Prestwood 2022-06-30 11:03:31 -07:00 committed by Denis Kenzior
parent d1c5e42ae2
commit ac8e9f53f2

View File

@ -3,6 +3,7 @@
import unittest import unittest
from iwd import IWD from iwd import IWD
from config import ctx
from validation import validate, client_connect from validation import validate, client_connect
class Test(unittest.TestCase): class Test(unittest.TestCase):
@ -20,6 +21,24 @@ class Test(unittest.TestCase):
# Finally test dev1 can go to client mode and connect again # Finally test dev1 can go to client mode and connect again
client_connect(wd, dev1, 'TestAP1') client_connect(wd, dev1, 'TestAP1')
def test_client_start_ap(self):
wd = IWD(True)
dev1, dev2 = wd.list_devices(2)
ctx.start_process(['iwctl', 'device', dev1.name, 'set-property', 'Mode', 'ap'], check=True)
ctx.start_process(['iwctl', 'ap', dev1.name, 'start', 'TestAP2', 'Password2'], check=True)
iwctl = ctx.start_process(['iwctl', 'ap', 'list'], check=True)
self.assertIn(dev1.name, iwctl.out)
iwctl = ctx.start_process(['iwctl', 'ap', dev1.name, 'show'], check=True)
self.assertIn('TestAP2', iwctl.out)
validate(wd, dev2, dev1, 'TestAP2', 'Password2')
@classmethod @classmethod
def setUpClass(cls): def setUpClass(cls):
IWD.copy_to_storage('TestAP1.psk') IWD.copy_to_storage('TestAP1.psk')