From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [RFC 4/4] auto-t: add a few more DPP tests for seen/known networks
Date: Wed, 13 Dec 2023 09:25:46 -0800 [thread overview]
Message-ID: <20231213172546.145998-5-prestwoj@gmail.com> (raw)
In-Reply-To: <20231213172546.145998-1-prestwoj@gmail.com>
These ensure DPP works correctly when a network has already been seen
in the scan results as well as if its a known network.
---
autotests/testDPP/pkex_test.py | 40 ++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/autotests/testDPP/pkex_test.py b/autotests/testDPP/pkex_test.py
index 9e0b5dd8..07def453 100644
--- a/autotests/testDPP/pkex_test.py
+++ b/autotests/testDPP/pkex_test.py
@@ -186,6 +186,46 @@ class Test(unittest.TestCase):
self.agent = None
+ def test_network_seen_before_dpp(self):
+ self.start_iwd_pkex_configurator(self.device[0])
+
+ # Scan first so a network object already exists
+ self.device[1].scan()
+ self.wd.wait_for_object_condition(self.device[1], 'obj.scanning == True')
+ self.wd.wait_for_object_condition(self.device[1], 'obj.scanning == False')
+
+ self.device[1].dpp_pkex_enroll('secret123', identifier="test")
+
+ condition = 'obj.state == DeviceState.connected'
+ self.wd.wait_for_object_condition(self.device[1], condition)
+
+ # Check additional settings were carried over
+ with open('/tmp/ns0/ssidCCMP.psk', 'r') as f:
+ settings = f.read()
+
+ self.assertIn("SendHostname=true", settings)
+
+ def test_existing_known_network(self):
+ # Copy an invalid profile, make sure DPP overwrites it and connects
+ IWD.copy_to_storage("existingProfile.psk", "/tmp/ns0/", "ssidCCMP.psk")
+ self.start_iwd_pkex_configurator(self.device[0])
+
+ # Scan first so a network object exists, and its a known network
+ self.device[1].scan()
+ self.wd.wait_for_object_condition(self.device[1], 'obj.scanning == True')
+ self.wd.wait_for_object_condition(self.device[1], 'obj.scanning == False')
+
+ self.device[1].dpp_pkex_enroll('secret123', identifier="test")
+
+ condition = 'obj.state == DeviceState.connected'
+ self.wd.wait_for_object_condition(self.device[1], condition)
+
+ # Check additional settings were carried over
+ with open('/tmp/ns0/ssidCCMP.psk', 'r') as f:
+ settings = f.read()
+
+ self.assertIn("SendHostname=true", settings)
+
def setUp(self):
ns0 = ctx.get_namespace('ns0')
self.wpas = Wpas('wpas.conf')
--
2.34.1
next prev parent reply other threads:[~2023-12-13 17:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-13 17:25 [RFC 0/4] Fix extra settings not being taken post-DPP James Prestwood
2023-12-13 17:25 ` [RFC 1/4] knownnetworks: set ops on info in __network_info_init James Prestwood
2023-12-13 17:25 ` [RFC 2/4] station: unify scan cancelation James Prestwood
2023-12-13 17:32 ` James Prestwood
2023-12-13 17:25 ` [RFC 3/4] dpp: fix non-scan connect path in DPP James Prestwood
2023-12-13 17:25 ` James Prestwood [this message]
2023-12-13 22:59 ` [RFC 0/4] Fix extra settings not being taken post-DPP 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=20231213172546.145998-5-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