All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj at gmail.com>
To: iwd at lists.01.org
Subject: [PATCH 6/6] auto-t: add DPP autotests
Date: Tue, 04 Jan 2022 10:18:57 -0800	[thread overview]
Message-ID: <20220104181857.103331-6-prestwoj@gmail.com> (raw)
In-Reply-To: 20220104181857.103331-1-prestwoj@gmail.com

[-- Attachment #1: Type: text/plain, Size: 3593 bytes --]

---
 autotests/testDPP/connection_test.py | 73 ++++++++++++++++++++++++++++
 autotests/testDPP/hostapd.conf       |  7 +++
 autotests/testDPP/hw.conf            |  9 ++++
 autotests/testDPP/ssidCCMP.psk       |  2 +
 autotests/testDPP/wpas.conf          |  5 ++
 5 files changed, 96 insertions(+)
 create mode 100644 autotests/testDPP/connection_test.py
 create mode 100644 autotests/testDPP/hostapd.conf
 create mode 100644 autotests/testDPP/hw.conf
 create mode 100644 autotests/testDPP/ssidCCMP.psk
 create mode 100644 autotests/testDPP/wpas.conf

diff --git a/autotests/testDPP/connection_test.py b/autotests/testDPP/connection_test.py
new file mode 100644
index 00000000..43822c55
--- /dev/null
+++ b/autotests/testDPP/connection_test.py
@@ -0,0 +1,73 @@
+#!/usr/bin/python3
+
+import unittest
+import sys
+
+sys.path.append('../util')
+from iwd import IWD
+from wpas import Wpas
+from hostapd import HostapdCLI
+
+class Test(unittest.TestCase):
+
+    def test_iwd_as_enrollee(self):
+        wpas = Wpas('wpas.conf')
+
+        wd = IWD(True)
+
+        devices = wd.list_devices(1)
+        device = devices[0]
+        device.autoconnect = True
+
+        uri = device.dpp_start_enrollee()
+
+        wpas.dpp_configurator_create(uri)
+        wpas.dpp_configurator_start('ssidCCMP', 'secret123')
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(device, condition)
+
+        device.disconnect()
+        device.dpp_stop()
+
+        del wpas
+
+    def test_iwd_as_configurator(self):
+        IWD.copy_to_storage('ssidCCMP.psk')
+
+        wpas = Wpas('wpas.conf')
+        hapd = HostapdCLI('hostapd.conf')
+
+        wd = IWD(True)
+
+        devices = wd.list_devices(1)
+        device = devices[0]
+        device.autoconnect = True
+
+        condition = 'obj.state == DeviceState.connected'
+        wd.wait_for_object_condition(device, condition)
+
+        uri = device.dpp_start_configurator()
+
+        wpas.dpp_enrollee_start(uri)
+
+        hapd.wait_for_event('AP-STA-CONNECTED 42:00:00:00:00:00')
+
+        device.disconnect()
+        device.dpp_stop()
+
+        del wpas
+
+    def tearDown(self):
+        IWD.clear_storage()
+
+    @classmethod
+    def setUpClass(cls):
+        pass
+
+    @classmethod
+    def tearDownClass(cls):
+        pass
+
+if __name__ == '__main__':
+    unittest.main(exit=True)
diff --git a/autotests/testDPP/hostapd.conf b/autotests/testDPP/hostapd.conf
new file mode 100644
index 00000000..074e8228
--- /dev/null
+++ b/autotests/testDPP/hostapd.conf
@@ -0,0 +1,7 @@
+hw_mode=g
+channel=1
+ssid=ssidCCMP
+
+wpa=2
+wpa_pairwise=CCMP
+wpa_passphrase=secret123
diff --git a/autotests/testDPP/hw.conf b/autotests/testDPP/hw.conf
new file mode 100644
index 00000000..478f0633
--- /dev/null
+++ b/autotests/testDPP/hw.conf
@@ -0,0 +1,9 @@
+[SETUP]
+num_radios=3
+start_iwd=0
+
+[WPA_SUPPLICANT]
+rad0=wpas.conf
+
+[HOSTAPD]
+rad1=hostapd.conf
diff --git a/autotests/testDPP/ssidCCMP.psk b/autotests/testDPP/ssidCCMP.psk
new file mode 100644
index 00000000..abafdb66
--- /dev/null
+++ b/autotests/testDPP/ssidCCMP.psk
@@ -0,0 +1,2 @@
+[Security]
+Passphrase=secret123
diff --git a/autotests/testDPP/wpas.conf b/autotests/testDPP/wpas.conf
new file mode 100644
index 00000000..5ec815b4
--- /dev/null
+++ b/autotests/testDPP/wpas.conf
@@ -0,0 +1,5 @@
+ctrl_interface=/tmp/rad1-p2p-wpas
+
+update_config=1
+pmf=2
+dpp_config_processing=2
-- 
2.31.1

                 reply	other threads:[~2022-01-04 18:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220104181857.103331-6-prestwoj@gmail.com \
    --to=unknown@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.