diff mbox series

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

Message ID 20220630180331.206419-5-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 dpp commands
---
 autotests/testDPP/connection_test.py | 34 ++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
diff mbox series

Patch

diff --git a/autotests/testDPP/connection_test.py b/autotests/testDPP/connection_test.py
index 0f9b8f1c..0cab5ff1 100644
--- a/autotests/testDPP/connection_test.py
+++ b/autotests/testDPP/connection_test.py
@@ -5,9 +5,11 @@  import sys
 
 sys.path.append('../util')
 from iwd import IWD
+from iwd import DeviceProvisioning
 from wpas import Wpas
 from hostapd import HostapdCLI
 from hwsim import Hwsim
+from config import ctx
 
 class Test(unittest.TestCase):
     def test_iwd_as_enrollee(self):
@@ -98,6 +100,38 @@  class Test(unittest.TestCase):
 
         self.wpas.wait_for_event('DPP-CONF-RECEIVED', timeout=30)
 
+    def test_client_as_configurator(self):
+        self.hapd.reload()
+        self.hapd.wait_for_event('AP-ENABLED')
+
+        IWD.copy_to_storage('ssidCCMP.psk')
+        self.device.autoconnect = True
+
+        condition = 'obj.state == DeviceState.connected'
+        self.wd.wait_for_object_condition(self.device, condition)
+
+        ctx.start_process(['iwctl', 'dpp', self.device.name, 'start-configurator'], check=True)
+
+        dpp = DeviceProvisioning(self.device.device_path)
+
+        self.wpas.dpp_enrollee_start(dpp.uri)
+
+        self.wpas.wait_for_event('DPP-CONF-RECEIVED', timeout=30)
+
+    def test_client_as_enrollee(self):
+        self.device.autoconnect = True
+        self.hapd.reload()
+
+        ctx.start_process(['iwctl', 'dpp', self.device.name, 'start-enrollee'], check=True)
+
+        dpp = DeviceProvisioning(self.device.device_path)
+
+        self.wpas.dpp_configurator_create(dpp.uri)
+        self.wpas.dpp_configurator_start('ssidCCMP', 'secret123')
+
+        condition = 'obj.state == DeviceState.connected'
+        self.wd.wait_for_object_condition(self.device, condition)
+
     def setUp(self):
         self.wpas = Wpas('wpas.conf')
         self.wd = IWD(True)