From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 3/7] auto-t: add client test to testEAP-WPS
Date: Thu, 30 Jun 2022 11:03:27 -0700 [thread overview]
Message-ID: <20220630180331.206419-3-prestwoj@gmail.com> (raw)
In-Reply-To: <20220630180331.206419-1-prestwoj@gmail.com>
Tests iwctl functionality with wsc commands
---
autotests/testEAP-WPS/four_digit_pin_test.py | 16 +++++++++++-----
autotests/testEAP-WPS/push_button_test.py | 17 ++++++++++++-----
2 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/autotests/testEAP-WPS/four_digit_pin_test.py b/autotests/testEAP-WPS/four_digit_pin_test.py
index 7bdb57cb..d30492fb 100644
--- a/autotests/testEAP-WPS/four_digit_pin_test.py
+++ b/autotests/testEAP-WPS/four_digit_pin_test.py
@@ -4,22 +4,23 @@ import unittest
import sys
sys.path.append('../util')
-import iwd
from iwd import IWD
-from iwd import DeviceState
-
from hostapd import HostapdCLI
+from config import ctx
class Test(unittest.TestCase):
- def four_digit_pin_success(self, wd):
+ def four_digit_pin_success(self, wd, client=False):
devices = wd.list_devices(1)
device = devices[0]
pin = '1234'
self.hostapd.wps_pin(pin)
- device.wps_start_pin(pin)
+ if not client:
+ device.wps_start_pin(pin)
+ else:
+ ctx.start_process(['iwctl', 'wsc', device.name, 'start-user-pin', pin], check=True)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
@@ -36,6 +37,11 @@ class Test(unittest.TestCase):
self.four_digit_pin_success(wd)
+ def test_client_four_digit_pin(self):
+ wd = IWD(True)
+
+ self.four_digit_pin_success(wd, client=True)
+
@classmethod
def setUpClass(cls):
cls.hostapd = HostapdCLI(config='ssidWPS.conf')
diff --git a/autotests/testEAP-WPS/push_button_test.py b/autotests/testEAP-WPS/push_button_test.py
index 08463f15..e2b4c2b2 100644
--- a/autotests/testEAP-WPS/push_button_test.py
+++ b/autotests/testEAP-WPS/push_button_test.py
@@ -4,20 +4,22 @@ import unittest
import sys
sys.path.append('../util')
-import iwd
from iwd import IWD
-from iwd import DeviceState
-
from hostapd import HostapdCLI
+from config import ctx
+
class Test(unittest.TestCase):
- def push_button_success(self, wd):
+ def push_button_success(self, wd, client=False):
self.hostapd.wps_push_button()
devices = wd.list_devices(1)
device = devices[0]
- device.wps_push_button()
+ if not client:
+ device.wps_push_button()
+ else:
+ ctx.start_process(['iwctl', 'wsc', device.name, 'push-button'], check=True)
condition = 'obj.state == DeviceState.connected'
wd.wait_for_object_condition(device, condition)
@@ -34,6 +36,11 @@ class Test(unittest.TestCase):
self.push_button_success(wd)
+ def test_client_push_button(self):
+ wd = IWD(True)
+
+ self.push_button_success(wd, client=True)
+
@classmethod
def setUpClass(cls):
cls.hostapd = HostapdCLI(config='ssidWPS.conf')
--
2.34.1
next prev parent reply other threads:[~2022-06-30 18:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-30 18:03 [PATCH 1/7] auto-t: iwd.py: add DPP properties James Prestwood
2022-06-30 18:03 ` [PATCH 2/7] auto-t: add client test to testKnownNetworks James Prestwood
2022-06-30 18:03 ` James Prestwood [this message]
2022-06-30 18:03 ` [PATCH 4/7] auto-t: add client test to testAdHoc James Prestwood
2022-06-30 18:03 ` [PATCH 5/7] auto-t: add client test to testDPP James Prestwood
2022-06-30 18:03 ` [PATCH 6/7] auto-t: refactor testAP to reuse code James Prestwood
2022-06-30 18:03 ` [PATCH 7/7] auto-t: add client test to testAP James Prestwood
2022-06-30 18:38 ` [PATCH 1/7] auto-t: iwd.py: add DPP properties Denis Kenzior
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=20220630180331.206419-3-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox