diff mbox series

[7/7] auto-t: add client test to testAP

Message ID 20220630180331.206419-7-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/7] auto-t: iwd.py: add DPP properties | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success

Commit Message

James Prestwood June 30, 2022, 6:03 p.m. UTC
Tests iwctl functionality with ap commands
---
 autotests/testAP/connection_test.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
diff mbox series

Patch

diff --git a/autotests/testAP/connection_test.py b/autotests/testAP/connection_test.py
index 273c333c..dff415e7 100644
--- a/autotests/testAP/connection_test.py
+++ b/autotests/testAP/connection_test.py
@@ -3,6 +3,7 @@ 
 import unittest
 
 from iwd import IWD
+from config import ctx
 from validation import validate, client_connect
 
 class Test(unittest.TestCase):
@@ -20,6 +21,24 @@  class Test(unittest.TestCase):
         # Finally test dev1 can go to client mode and connect again
         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
     def setUpClass(cls):
         IWD.copy_to_storage('TestAP1.psk')