From patchwork Thu Jun 30 18:03:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12902062 Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 47DF27B for ; Thu, 30 Jun 2022 18:06:00 +0000 (UTC) Received: by mail-pj1-f44.google.com with SMTP id 73-20020a17090a0fcf00b001eaee69f600so230017pjz.1 for ; Thu, 30 Jun 2022 11:06:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qtGZToBq6FGjpXuT2wG0YMa/oqd0RIE4ptaHo29vJYI=; b=b0e9ouKm6T/7CJl2qJsyiqmPIq7aXJT4y236SVCHIIdB4yq8Xo8zdH4wVtv7W13N4r N5tbtv9Stpt5sez4zKOTc+3EgoiaH31BBeZ0HQR6CMBjC49gRBGSYAeWA2CAzMAWHmod lqHNf5U2Yh50v+Uuv0Hghcvf5GRcse4ERDSz7qm8L1VCWavilCX7773JrP2SaGQ2p4vs /NauX8OLWMnLPQHAeBkHr0Crjp91+/qHBNtYhZ6GU+RRQ6pb2IsYUwv0896OogW3uC89 QyxNjjLeevDX87jI7Vaj2thf3EzJkDT30QXitczbFh2a6WrCoRcaoPYNI6HiZydu8lwn 5jZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=qtGZToBq6FGjpXuT2wG0YMa/oqd0RIE4ptaHo29vJYI=; b=uLkYsGxHvRpE+Y3CXWty74QJ8J01Da8S7RRRk4AVdLvMH5CcbIkRl4djByhzRIiByj gHFaLvk/SkWV4mwYgSLN41+13X/1d5JB321R0C9XgNWiGpHFINohVSmldABcfdJPWU7y lDf7Fs1MRWNjodm+cxi8Ob2EBA6qbpSeCTtf2lAunLFHQ8e5V8HFYAFfhsedsb/wuOer JS+BosJk/emDe1DhlmezcB282fD2aV41pha7v3AEggx+AT94NmfsF2ospFtWmvn+x7xi WTMAv69/CJVcbYaCF35hbtZtVo5haaknCVpO2PTHG9vJaHzbUI5eEC/Uu5ovW0QYD1MU YSpQ== X-Gm-Message-State: AJIora+gGIlEXtIzQ2KMb9qNM+smDpp557ECjofeXYQGnbULmONTbiuX lex32TSgSbS/akpVVMx5lPFAC0U3CNw= X-Google-Smtp-Source: AGRyM1vyYIy1UY8/N/+2KEEXwS3ChN+qBuSB11QzoHIyPWGIYZfIz3CswaT03yVIpahUblg/yDx4hA== X-Received: by 2002:a17:90b:1d04:b0:1ec:f898:d863 with SMTP id on4-20020a17090b1d0400b001ecf898d863mr13579494pjb.79.1656612359536; Thu, 30 Jun 2022 11:05:59 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id h6-20020a170902680600b00163ffe73300sm13777187plk.137.2022.06.30.11.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 11:05:59 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/7] auto-t: iwd.py: add DPP properties Date: Thu, 30 Jun 2022 11:03:25 -0700 Message-Id: <20220630180331.206419-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- autotests/util/iwd.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 5591d7e1..df310a32 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -294,6 +294,18 @@ class DeviceProvisioning(IWDDBusAbstract): def stop(self): self._iface.Stop() + @property + def uri(self): + return self._properties['URI'] + + @property + def started(self): + return self._properties['Started'] + + @property + def role(self): + return self._properties['Role'] + class Device(IWDDBusAbstract): ''' Class represents a network device object: net.connman.iwd.Device From patchwork Thu Jun 30 18:03:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12902063 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E66017B for ; Thu, 30 Jun 2022 18:06:01 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id jh14so89793plb.1 for ; Thu, 30 Jun 2022 11:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+o1nLAtiA1ovow+LoyeteKJX/MfOtqjxXhBG/kg4zjk=; b=AQVwDY5WxEfM9KFDmOQTOQgSEMyqEw4dQ0T7/XYvhh5/KZyBnsBtCcFPWLEQyaZUJe kMWs/1IDtUwlM7Mmlg4nahIqwAQE0eqaVO0BQ8ihK4opceEP3tcTnYH+Ty/JEF+Uz5/+ 0mHeiLEq0UosFtMbLL4uOxaNS97luz5xrD6C0flto+m9/WehzNd7pB9b7Ax0BY4f/jet QvfvUo5U96HNLIbPsfBcbTX6hQ1Fbnnkn5kPJKOIbKMVHQOLrFcg/0osC+blSaUKnKby BOcii9qD1G0wTILARYLQkK4gEnOgnrHxdlRUv1W16vQ+iSFaEkqV8kSN1rwnMTKjfCnh 2PHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+o1nLAtiA1ovow+LoyeteKJX/MfOtqjxXhBG/kg4zjk=; b=we0WWpZIvkJjzfTze5pyEztaGLIEICAjg6t1RyWNDM5vS208v1wreZFzB2Y9kLBtT3 sQV//SaRJOOz9pVdKXeA0p6rxcuDMw53UWEi7S+8Ib9OHr4HzB31iA8Iy+AJKTo1FXpi AHiQvO5hY2UINxIlcUS8abAaiNWQG32/ChG9vqePaL1pVz0LLq8lRFdvLbpyWZruPkGt 6GKBGws72c7uN+4sexZfxx9uIzv81iKuGCMVlwPGn3Sh+bGaxByxjmCAqvNMrzgask4Y fhU2aN8APQOInrhrjzY86ITCD2JjyzALr4ShePt3UFgQuvAkyiiipfZdNG2Y0iTJS6Tj Zh5w== X-Gm-Message-State: AJIora+qNy+seQDTlwTMlN39AYJgn1nZsBr7PO1/4uXPq/Rb6Fzd+6S8 UYLwIvG2lwYXacXb/8jo37ZVC5PJncA= X-Google-Smtp-Source: AGRyM1ts2nRIQF/q/A3muVWe9X/+b3ognBuq59kOHBKTbZnNqY/U/HNYfB8PowNAqDeY9Zczw6Jveg== X-Received: by 2002:a17:90b:1a8c:b0:1ed:1afb:7a73 with SMTP id ng12-20020a17090b1a8c00b001ed1afb7a73mr11811602pjb.144.1656612360655; Thu, 30 Jun 2022 11:06:00 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id h6-20020a170902680600b00163ffe73300sm13777187plk.137.2022.06.30.11.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 11:06:00 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/7] auto-t: add client test to testKnownNetworks Date: Thu, 30 Jun 2022 11:03:26 -0700 Message-Id: <20220630180331.206419-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630180331.206419-1-prestwoj@gmail.com> References: <20220630180331.206419-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Tests iwctl functionality with known-networks command --- .../testKnownNetworks/known_network_test.py | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/autotests/testKnownNetworks/known_network_test.py b/autotests/testKnownNetworks/known_network_test.py index 2bdcc955..a383e5ff 100644 --- a/autotests/testKnownNetworks/known_network_test.py +++ b/autotests/testKnownNetworks/known_network_test.py @@ -2,10 +2,11 @@ import unittest import sys +import subprocess sys.path.append('../util') -import iwd from iwd import IWD +from config import ctx class Test(unittest.TestCase): @@ -70,8 +71,26 @@ class Test(unittest.TestCase): self.list_removal_and_addition(wd) + def test_client_known_networks(self): + networks = ['Hotspot Network', 'ssidOpen', 'ssidTKIP', 'ssidEAP-TLS'] + wd = IWD(True) + + iwctl = ctx.start_process(['iwctl', 'known-networks', 'list'], check=True) + + for n in networks: + self.assertIn(n, iwctl.out) + + for n in networks: + ctx.start_process(['iwctl', 'known-networks', n, 'show'], check=True) + + networks.remove('ssidOpen') + ctx.start_process(['iwctl', 'known-networks', 'ssidOpen', 'forget'], check=True) + + with self.assertRaises(subprocess.CalledProcessError): + ctx.start_process(['iwctl', 'known-networks', 'ssidOpen', 'show'], check=True) + @classmethod - def setUpClass(cls): + def setUp(self): IWD.copy_to_storage('known_networks/ssidOpen.open') IWD.copy_to_storage('known_networks/ssidTKIP.psk') IWD.copy_to_storage('known_networks/ssidEAP-TLS.8021x') From patchwork Thu Jun 30 18:03:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12902064 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E90B746A for ; Thu, 30 Jun 2022 18:06:02 +0000 (UTC) Received: by mail-pl1-f181.google.com with SMTP id r1so51594plo.10 for ; Thu, 30 Jun 2022 11:06:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WnNhMt2Hzuc0vXrTWH6rZReuZu7TSMyg/rWTjU3eC/k=; b=ZLrC/RgWLFpQ+klLpUAgW+uEB6QMCtUDf9ESeith6fqWOKzH7rNg0NYSP6X/ORw0do qTPfQUHgfBRLs5Y0NQSovZyzpVirRhdgGBmpyK4muwv7G9LdMKtiC6pdNvFlS55YdB9I 4eQ/ZivR2JVxbcmMG3X5P/jcxjymh4d+8OZt0MxLASNWBMFeMt8fOXmQXSEVDbcQkh9y a0Hj3GqGQSQB77Phn56qC2FJIGMpQTtLL0lleRb61w3MsEavBznBnaGKWI75lIm32bFX wuIBUVKOYfGAcvd/W203BknHfdJAjvNH87RYl/cKudKt4cz3I7q+iBm2AKD24jMWeQLD +f4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WnNhMt2Hzuc0vXrTWH6rZReuZu7TSMyg/rWTjU3eC/k=; b=sjCgzkR/KLj2lT8N3rJgTwNrzuY+SpLYe18gPp0aihzpMWoAZy5qDA4ZBxUlEG/GwI SHUxX5gK9N7PtbJuUP9lX6xSnlWEKSFB8ttVkEljL/vq3Dkw3qtKPi0kgUlmYyfRGGJK a38tlvvwm7nEd3xIOvo1hThyXl+xcsE4jVa/498g4ynDlmUw4cqcrmY0GTmMiLmNYg5I J35fdwEdT6Fz2OF+UwJiWGW9jpJzR9+GNRRn4XCT6XqcTLd9KxHqSF6+UeLPzU0XRAdj Z1uK86mJqMHGdeg0sak73OX58uWo5aXq61tmFy+d3OqTpAMnFNsF8y1V5Nr8Vmt/wtYq A2LA== X-Gm-Message-State: AJIora+s4u52tnRZ0XrxmOAegOhhEWiYy41bDBTWoxDJICB+xEXmBa+g 1J/8Qyti7nn2Z8ISAJ/S84IgFOGDR6A= X-Google-Smtp-Source: AGRyM1uom0LM2ofiwkGkjXEPQYkw4IBg+VvhSgq45mFNpfZVX6xajGC1jVazjPPXNGruHMev5nqCKw== X-Received: by 2002:a17:90a:410a:b0:1ef:3ca7:79a5 with SMTP id u10-20020a17090a410a00b001ef3ca779a5mr4437660pjf.154.1656612361495; Thu, 30 Jun 2022 11:06:01 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id h6-20020a170902680600b00163ffe73300sm13777187plk.137.2022.06.30.11.06.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 11:06:01 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/7] auto-t: add client test to testEAP-WPS Date: Thu, 30 Jun 2022 11:03:27 -0700 Message-Id: <20220630180331.206419-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630180331.206419-1-prestwoj@gmail.com> References: <20220630180331.206419-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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') From patchwork Thu Jun 30 18:03:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12902065 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7C360746E for ; Thu, 30 Jun 2022 18:06:03 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id jh14so89866plb.1 for ; Thu, 30 Jun 2022 11:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J6jjr9pRsMf+ATZjr7oXZAwPd0ZnsGdMpclUDg9uHxw=; b=HKeUPeEbg2yWkI5pKwN47HTtU+PZUidatjwo/VbQmO//xkDL5/ir3mt765kiO7mfOB HPqKQ8C2n24X9+JEWFsAJUGWFMISDtKJbn/63zoOYyPcc9dV7h5V6jPtbzM0QaGoJ1Cl VHD8R8u46BR2I5FGeAoZTKd4Tuy+2k7PUm97Pv14GnwZsdgkyMwEDwh9atdC3evr53J8 PQp9GdZ5w2e2U6mJPfcmquI+6p6m0uOrymJMGYWMwl+KHgdL7+wdtnua5LXmfRXPfMO1 mP0oh6dPm2kZpCp5Px1G1iNXK7wZui2ifETzvr44Rt+29yShYalQcaHddQyt9nqSzjsM LryA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=J6jjr9pRsMf+ATZjr7oXZAwPd0ZnsGdMpclUDg9uHxw=; b=OF4nODdgstuaCgMWKIPX0Ryy0lBuzX7f6CCnPnnSVa7A21+HOBkXvkaQ4oI3AaZN7l W6xunJPZifl3uSYKQHp9IbySwQLo/IsnkB/ESrp1JuJmU7ulWltsxQ68DdIQPimNrtIg EAFZRq6SECqngH7QqjDIhgw/u/y45kPBI6yPkFkd3NlqDA/hxLmI820jd0JtXWaH8JQv 0DYVCEUQsFzsdPRxh7ckIPEURc5f2RFjKwzzP+yGU7ZFl5DuUiDDbv1HYzfVPMfEn13D hP9xcIPQ11SCgjX+t13Pcz1pIeIk2phIBQVtbo2aa+qDese/L1NMH6ck2ONkk/dwIspW IaLA== X-Gm-Message-State: AJIora+nSwUPrN9C/f6QoQoJulxpABOZVdR+1/xdeobFsZaKjV78deK2 Rolq8V4OFld2rJtj1OL2kd8n4hOXeAM= X-Google-Smtp-Source: AGRyM1v7rZ3HsA2LScuj+Vz8l0iLz4Qmhl7jR6P7Uoh6tb5nxanayloT1JN0idB5Vdmu9c0G1YojDg== X-Received: by 2002:a17:90b:17c7:b0:1ed:1a28:8dc6 with SMTP id me7-20020a17090b17c700b001ed1a288dc6mr11744160pjb.224.1656612362681; Thu, 30 Jun 2022 11:06:02 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id h6-20020a170902680600b00163ffe73300sm13777187plk.137.2022.06.30.11.06.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 11:06:02 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 4/7] auto-t: add client test to testAdHoc Date: Thu, 30 Jun 2022 11:03:28 -0700 Message-Id: <20220630180331.206419-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630180331.206419-1-prestwoj@gmail.com> References: <20220630180331.206419-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Tests iwctl functionality with ad-hoc commands --- autotests/testAdHoc/adhoc_test.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/autotests/testAdHoc/adhoc_test.py b/autotests/testAdHoc/adhoc_test.py index 13c0c016..4c5d5023 100644 --- a/autotests/testAdHoc/adhoc_test.py +++ b/autotests/testAdHoc/adhoc_test.py @@ -2,16 +2,16 @@ import unittest import sys -import time sys.path.append('../util') -import iwd from iwd import IWD +from iwd import AdHocDevice +from config import ctx import testutil class Test(unittest.TestCase): - def validate_connection(self, wd): + def validate_connection(self, wd, client=False): dev1, dev2 = wd.list_devices(2) self.assertIsNotNone(dev1) @@ -22,7 +22,14 @@ class Test(unittest.TestCase): condition = 'obj.started == True' wd.wait_for_object_condition(adhoc1, condition) - adhoc2 = dev2.start_adhoc("AdHocNetwork", "secret123") + if not client: + adhoc2 = dev2.start_adhoc("AdHocNetwork", "secret123") + else: + ctx.start_process(['iwctl', 'device', dev2.name, 'set-property', + 'Mode', 'ad-hoc'], check=True) + ctx.start_process(['iwctl', 'ad-hoc', dev2.name, 'start', + 'AdHocNetwork', 'secret123'], check=True) + adhoc2 = AdHocDevice(dev2.device_path) condition = 'obj.started == True' wd.wait_for_object_condition(adhoc1, condition) @@ -42,6 +49,10 @@ class Test(unittest.TestCase): self.validate_connection(wd) + def test_client_adhoc(self): + wd = IWD(True) + self.validate_connection(wd, client=True) + @classmethod def setUpClass(cls): pass From patchwork Thu Jun 30 18:03:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12902066 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9ADAF7470 for ; Thu, 30 Jun 2022 18:06:04 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id c6-20020a17090abf0600b001eee794a478so3952819pjs.1 for ; Thu, 30 Jun 2022 11:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ifmvu/3OAmxrsLKCRk1xJt8prGQIkSPVeh0DwVekLyc=; b=eJzXdK1XvmxlEikFib2j4vTPSa5e/sXyCLlOiKpd3xb9CjoN9nQ7UyTi/U6lFoiTLu U8Pf9U7HtlJN/S8q1RrQOfYIn2vebQKKpqlxwQpnhQcx2wrTQcKJ/TysIIKU7YY3YTUi zHBPXxMZ1ZK5496Xk5szxn6o1Srl6+30CM6aYIqZy/Vt7wg/TjuYgNjS4QtuEvEMUE+W nogsvn57i6Yi4XFjQc5VKFKgAOmGSKgJWN48y4rK51a5Sgk3B35p5LQgO6MUpDNpuhRo OGd/QzDzYeERnHN+NzCSWaYWpzh2Bg26Y6EkuZIRw3MgFxlj7H6fSr0oKzZe4EDGsE5V ANGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ifmvu/3OAmxrsLKCRk1xJt8prGQIkSPVeh0DwVekLyc=; b=efqI2TpBsbidR+98mkvBvrKpGkUyuxCio18jWWyIhQPZh2aqPAq9iq9UyPJytrpU1+ kcs34/9b5puv+8OnJgPjGhGc1ZJW+kMo9cyYaUOGNyxXWSnSCIAPxZOn9MVpwc5k9TV6 ZxJV0STRHqRs5+b+1v9/7vtAIZIFds5cHa83TD7/LAOuYO7IR7Nv667rLkloeqYiu6c5 fEG8GV5mN77ZfI6OK+nnM1ODE/4ubyELjwyGgaPmrBMeW9qSkAbOUVyWlLw2k6C/K0VT g9P1muA0BNPO64zzZI8IkeEGeEOXYw7gPxfvz/nbUkhnZuFASYzfTqDj7S3Q6QJI6pNa bLUA== X-Gm-Message-State: AJIora++AAf3yffComnvaV11toLJvdujsG5SkDBWC6hjtxElTN6VkV+c kErsmqW2Whl/sdKpPgR4JmLhYCErcME= X-Google-Smtp-Source: AGRyM1vpeEXTw0vg+xlTWtYL5x7qLohsl+0seWxSrKyiXEYeNB+7QqBSM7YIgm8LnkDpRe29Jz6pxw== X-Received: by 2002:a17:90a:fd13:b0:1ec:7a40:3b5 with SMTP id cv19-20020a17090afd1300b001ec7a4003b5mr13443985pjb.8.1656612363814; Thu, 30 Jun 2022 11:06:03 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id h6-20020a170902680600b00163ffe73300sm13777187plk.137.2022.06.30.11.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 11:06:03 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 5/7] auto-t: add client test to testDPP Date: Thu, 30 Jun 2022 11:03:29 -0700 Message-Id: <20220630180331.206419-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630180331.206419-1-prestwoj@gmail.com> References: <20220630180331.206419-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Tests iwctl functionality with dpp commands --- autotests/testDPP/connection_test.py | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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) From patchwork Thu Jun 30 18:03:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12902067 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC35F7469 for ; Thu, 30 Jun 2022 18:06:09 +0000 (UTC) Received: by mail-pg1-f169.google.com with SMTP id r66so86668pgr.2 for ; Thu, 30 Jun 2022 11:06:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lTbYUt8xK8Nfxr3ffET+JWtFWhTFZwAYpqgi+z6sjP4=; b=oYnq/63Nw35NwiO9syynGKPsWIOfpFjpeX7kSzcc7VyprTT8EObyJtD6ytKKzdOEcn sSmz5kLv+opCOEaClLq1imS2rNk88rQb+aZr0XRad6Vn6wLEE5XGxAtzNMR9jBb/3wZO 5ULJgJZo28Yy+XDbn0WwgNwu8DM4SQutm/tmWrjEseRAwM5sFfLlHxXH+3vjpuIje0Ln PA3pSGSaosQxLJFvPpmt0TIA3/lUiDFTQOhP3xSWnagl9vB1tSeCH3TD11A9bAho91a8 yG7YJnS8+IEb5RhgDaiKX25rA1W1ydjrbOiP2g2Cl4SpYwjxvZlwU+PigOHGhweRwjKo Yy4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lTbYUt8xK8Nfxr3ffET+JWtFWhTFZwAYpqgi+z6sjP4=; b=TVpckSNN8NjsV3kOOMOXmN9XbJlpan35wr/Qx85IQgEJUw3vNEJ8Mk4kGWxqOITYJ4 XMXqYH3+pMUEx0b3b1cTWVUxlbasvUZNnzmlNrR7poy707YxrUqriA2QboqnHk1G24TX hm3+HfPnmn2PdsjCV4v0LI+ZlXkVs4GKYb/2DfsLbw/D58hJhYphVb/n6EiCYnYwgVJK 5EhY+dDKDekYGJhBi99Q3dCgDxS6UOIQd8Rsa1VdaIso4jT+6EBbBtMTVp4d79e5bEM5 6agT5IuZcGn3p8brfRv64/Sz6DuR2vkrtcsQa7ExhEc8Yr0wZzq2v8a/45KGehXNc3Lg 1bvg== X-Gm-Message-State: AJIora915ii/D3Md0sEmI55LBUOuFANYElg4tmn0nyIVeHfQwFEgxPln +tZeZMHc+uSvrljUw86jp/t9jnx6JkM= X-Google-Smtp-Source: AGRyM1uPpR0IL73Eq61UgyxUCwuvyncLBJpHm7IFLZL9POsqqbSIyQFKYcnwo9cImXbhKNl7DsUHYA== X-Received: by 2002:a65:668b:0:b0:3f6:4026:97cd with SMTP id b11-20020a65668b000000b003f6402697cdmr8570489pgw.420.1656612369013; Thu, 30 Jun 2022 11:06:09 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id h6-20020a170902680600b00163ffe73300sm13777187plk.137.2022.06.30.11.06.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 11:06:08 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 6/7] auto-t: refactor testAP to reuse code Date: Thu, 30 Jun 2022 11:03:30 -0700 Message-Id: <20220630180331.206419-6-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630180331.206419-1-prestwoj@gmail.com> References: <20220630180331.206419-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 All the AP tests were basically doing the same validation. Refactor this code into validation.py and import that into the tests. --- autotests/testAP/connection_test.py | 74 ++-------------------------- autotests/testAP/dhcp_config_test.py | 49 ++---------------- autotests/testAP/dhcp_test.py | 69 +++++++++----------------- autotests/testAP/validation.py | 71 ++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 161 deletions(-) create mode 100644 autotests/testAP/validation.py diff --git a/autotests/testAP/connection_test.py b/autotests/testAP/connection_test.py index 02213947..273c333c 100644 --- a/autotests/testAP/connection_test.py +++ b/autotests/testAP/connection_test.py @@ -1,90 +1,24 @@ #! /usr/bin/python3 import unittest -import sys, os -import iwd from iwd import IWD -from iwd import PSKAgent -from iwd import NetworkType -from hostapd import HostapdCLI -import testutil +from validation import validate, client_connect class Test(unittest.TestCase): - - def client_connect(self, wd, dev): - hostapd = HostapdCLI(config='psk-ccmp.conf') - - ordered_network = dev.get_ordered_network('TestAP1') - - self.assertEqual(ordered_network.type, NetworkType.psk) - - psk_agent = PSKAgent('Password1') - wd.register_psk_agent(psk_agent) - - ordered_network.network_object.connect() - - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(dev, condition) - - wd.unregister_psk_agent(psk_agent) - - testutil.test_iface_operstate(dev.name) - testutil.test_ifaces_connected(hostapd.ifname, dev.name) - - dev.disconnect() - - condition = 'not obj.connected' - wd.wait_for_object_condition(ordered_network.network_object, condition) - def test_connection_success(self): wd = IWD(True) dev1, dev2 = wd.list_devices(2) - self.client_connect(wd, dev1) + client_connect(wd, dev1, 'TestAP1') dev1.start_ap('TestAP2', 'Password2') - try: - networks = {} - networks['TestAP1'] = dev2.get_ordered_network('TestAP1', full_scan=True) - networks['TestAP2'] = dev2.get_ordered_network('TestAP2', full_scan=True) - - self.assertEqual(networks['TestAP1'].type, NetworkType.psk) - self.assertEqual(networks['TestAP2'].type, NetworkType.psk) - - psk_agent = PSKAgent('Password2') - wd.register_psk_agent(psk_agent) - - try: - dev2.disconnect() - - condition = 'not obj.connected' - wd.wait_for_object_condition(dev2, condition) - except: - pass - - networks['TestAP2'].network_object.connect() - - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(dev2, condition) - - testutil.test_iface_operstate(dev2.name) - testutil.test_ifaces_connected(dev1.name, dev2.name, group=False) - - wd.unregister_psk_agent(psk_agent) - - dev2.disconnect() - - condition = 'not obj.connected' - wd.wait_for_object_condition(networks['TestAP2'].network_object, - condition) - finally: - dev1.stop_ap() + validate(wd, dev2, dev1, 'TestAP2', 'Password2') # Finally test dev1 can go to client mode and connect again - self.client_connect(wd, dev1) + client_connect(wd, dev1, 'TestAP1') @classmethod def setUpClass(cls): diff --git a/autotests/testAP/dhcp_config_test.py b/autotests/testAP/dhcp_config_test.py index ac3a95ba..2c75d071 100644 --- a/autotests/testAP/dhcp_config_test.py +++ b/autotests/testAP/dhcp_config_test.py @@ -1,14 +1,10 @@ #! /usr/bin/python3 import unittest -import sys, os -import iwd from iwd import IWD -from iwd import PSKAgent -from iwd import NetworkType from config import ctx -import testutil +from validation import validate class Test(unittest.TestCase): def test_connection_success(self): @@ -28,47 +24,8 @@ class Test(unittest.TestCase): dev1.start_ap('APConfig') - try: - networks = {} - networks['APConfig'] = dev2.get_ordered_network('APConfig', full_scan=True) - - self.assertEqual(networks['APConfig'].type, NetworkType.psk) - - psk_agent = PSKAgent('password123') - wd.register_psk_agent(psk_agent) - - try: - dev2.disconnect() - - condition = 'not obj.connected' - wd.wait_for_object_condition(dev2, condition) - except: - pass - - networks['APConfig'].network_object.connect() - - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(dev2, condition) - - testutil.test_iface_operstate(dev2.name) - # - # TODO: cannot yet check the AP interface IP since its in a - # different namespace. - # - testutil.test_ip_address_match(dev2.name, "192.168.1.3") - - testutil.test_ip_connected(('192.168.1.3', ctx), ('192.168.1.1', ns0)) - - wd.unregister_psk_agent(psk_agent) - - dev2.disconnect() - - condition = 'not obj.connected' - wd.wait_for_object_condition(networks['APConfig'].network_object, - condition) - - finally: - dev1.stop_ap() + validate(wd, dev2, dev1, 'APConfig', 'password123', + sta_ip_info=('192.168.1.3', ctx), ap_ip_info=('192.168.1.1', ns0)) @classmethod def setUpClass(cls): diff --git a/autotests/testAP/dhcp_test.py b/autotests/testAP/dhcp_test.py index a8f89eb0..aa50fdb4 100644 --- a/autotests/testAP/dhcp_test.py +++ b/autotests/testAP/dhcp_test.py @@ -10,6 +10,8 @@ from iwd import NetworkType from config import ctx import testutil +from validation import validate + class Test(unittest.TestCase): def test_connection_success(self): wd = IWD(True, '/tmp/dhcp') @@ -25,59 +27,36 @@ class Test(unittest.TestCase): with self.assertRaises(iwd.AlreadyExistsEx): dev4.start_ap('TestAP4', 'Password4') - try: - networks = {} - networks['TestAP2'] = dev2.get_ordered_network('TestAP2', full_scan=True) - - self.assertEqual(networks['TestAP2'].type, NetworkType.psk) - - psk_agent = PSKAgent('Password2') - wd.register_psk_agent(psk_agent) - - try: - dev2.disconnect() - - condition = 'not obj.connected' - wd.wait_for_object_condition(dev2, condition) - except: - pass + validate(wd, dev2, dev1, 'TestAP2', 'Password2', ip_checks=False) - networks['TestAP2'].network_object.connect() + network = dev2.get_ordered_network('TestAP2', full_scan=True) - condition = 'obj.state == DeviceState.connected' - wd.wait_for_object_condition(dev2, condition) - - testutil.test_iface_operstate(dev2.name) - testutil.test_ifaces_connected(dev1.name, dev2.name, group=False) - - try: - testutil.test_ip_address_match(dev1.name, "192.168.80.1") - testutil.test_ip_address_match(dev2.name, "192.168.80.2") - ip = "192.168.80.1" - except: - testutil.test_ip_address_match(dev1.name, "192.168.80.17") - testutil.test_ip_address_match(dev2.name, "192.168.80.18") - ip = "192.168.80.17" - - wd.unregister_psk_agent(psk_agent) + try: + testutil.test_ip_address_match(dev1.name, "192.168.80.1") + testutil.test_ip_address_match(dev2.name, "192.168.80.2") + ip = "192.168.80.1" + except: + testutil.test_ip_address_match(dev1.name, "192.168.80.17") + testutil.test_ip_address_match(dev2.name, "192.168.80.18") + ip = "192.168.80.17" - dev2.disconnect() + dev2.disconnect() - condition = 'not obj.connected' - wd.wait_for_object_condition(networks['TestAP2'].network_object, - condition) + condition = 'not obj.connected' + wd.wait_for_object_condition(network.network_object, condition) - # This should release the IP */ - dev1.stop_ap() + # This should release the IP */ + dev1.stop_ap() - # This should now succeed and the IP should match the old IP dev1 - # got initially. - dev4.start_ap('TestAP4', 'Password4') + # This should now succeed and the IP should match the old IP dev1 + # got initially. + dev4.start_ap('TestAP4', 'Password4') - testutil.test_ip_address_match(dev4.name, ip) + testutil.test_ip_address_match(dev4.name, ip) - finally: - dev1.stop_ap() + dev1.stop_ap() + dev3.stop_ap() + dev4.stop_ap() @classmethod def setUpClass(cls): diff --git a/autotests/testAP/validation.py b/autotests/testAP/validation.py new file mode 100644 index 00000000..b1b867ef --- /dev/null +++ b/autotests/testAP/validation.py @@ -0,0 +1,71 @@ +from iwd import PSKAgent +from iwd import NetworkType +from hostapd import HostapdCLI +import testutil + +def validate(wd, sta_dev, ap_dev, ssid, passphrase, + sta_ip_info=None, ap_ip_info=None, ip_checks=True): + try: + network = sta_dev.get_ordered_network(ssid, full_scan=True) + + if network.type != NetworkType.psk: + raise Exception("Network type mismatch") + + psk_agent = PSKAgent(passphrase) + wd.register_psk_agent(psk_agent) + + network.network_object.connect() + + condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_condition(sta_dev, condition) + + testutil.test_iface_operstate(sta_dev.name) + + # This implies separate namespaces so the iface names won't exist + if not sta_ip_info or not ap_ip_info: + testutil.test_ifaces_connected(ap_dev.name, sta_dev.name, group=False) + + if not ip_checks: + return + + if sta_ip_info: + testutil.test_ip_address_match(sta_dev.name, sta_ip_info[0]) + + if sta_ip_info and ap_ip_info: + testutil.test_ip_connected(sta_ip_info, ap_ip_info) + + wd.unregister_psk_agent(psk_agent) + + sta_dev.disconnect() + + condition = 'not obj.connected' + wd.wait_for_object_condition(network.network_object, condition) + finally: + if ip_checks: + ap_dev.stop_ap() + +def client_connect(wd, dev, ssid): + hostapd = HostapdCLI(config='psk-ccmp.conf') + + ordered_network = dev.get_ordered_network(ssid) + + if ordered_network.type != NetworkType.psk: + raise Exception("Network type mismatch") + + psk_agent = PSKAgent('Password1') + wd.register_psk_agent(psk_agent) + + ordered_network.network_object.connect() + + condition = 'obj.state == DeviceState.connected' + wd.wait_for_object_condition(dev, condition) + + wd.unregister_psk_agent(psk_agent) + + testutil.test_iface_operstate(dev.name) + testutil.test_ifaces_connected(hostapd.ifname, dev.name) + + dev.disconnect() + + condition = 'not obj.connected' + wd.wait_for_object_condition(ordered_network.network_object, condition) From patchwork Thu Jun 30 18:03:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12902068 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3C417469 for ; Thu, 30 Jun 2022 18:06:11 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id dw10-20020a17090b094a00b001ed00a16eb4so225985pjb.2 for ; Thu, 30 Jun 2022 11:06:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t0j8KSCwWKe6mk9SXRLFL6SSwxrrPJzGrzeVOKcwk6k=; b=jOUoGnRE3GM8JCU2/Pb0mT+EUC/Get7KQDq3i8jGq1xFu6f6snLG+yTvCj0gbLk4wA 4lNTBaFxjcKBdrksZctmaseIizrlb01NmGYwvb+c+CeojqHuJb2uJrdwejn9GnW6BBHL 0KUS2NycPQDND/iQqVeneQvOsGZhbRRqlXYh8FP2uO9nkOo5bstmP0M4ApYMPu1n4PXS RO/3x6+jr6J15sRY6gbb4rpMsrFSdBJ28BUOYwCsJQnCbo4FVI6BZL62M/ZMR79fpcUn U0vtU/j3cDZB8fn7l8J1MikrYKHllGXSiuD2DARBGelLUt1lnT7TG145LnT2gfaUJ4jU kZyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t0j8KSCwWKe6mk9SXRLFL6SSwxrrPJzGrzeVOKcwk6k=; b=I3HXLt9WQXWMOuVC8ljtsZ869OqEVSS/ILcT1JoMfw3FrFU1g2JABLah0DBA+q42LL 0hKG1R+1wAmGd33FwucGLy9afS6LEqI+fsgtxwjaLCfhcgYa73G5+6PqRo9WNATVJ2A4 +gH1KqktdsqiouUhaJt0UEPg4lNlrSmKIgCn3Cz5Abj1CiCoSs5LY7pzspA/crOB3Jjv R0aNp1SUsmsq9CTY3bFyEO0jw5lEn5dS2jdljM1zBJPJavM2+977tuHh89gqdXPOW3ep ojI1b73ZG2KLEe4akTlhQr0dGRG7pOE1NEBb0dg1m1lu4tA936JXlElLYi/6LzzgNXdm 3mOQ== X-Gm-Message-State: AJIora+VYtFjzFP5ZEiPCcx1EoOqmZfuKtNe6YR33U1dTQIE2Gq8cuZs Srw6qcjXbb6LHZ46e9zf0b593mrNOKk= X-Google-Smtp-Source: AGRyM1uQHyPq8rBs2F5gCGY9ix2RV7g3ZIIMLIUaAihzu29XvGv6bPv+r/i6C8Wr5XkT/2lZAP9IJQ== X-Received: by 2002:a17:902:eb86:b0:16b:a453:9951 with SMTP id q6-20020a170902eb8600b0016ba4539951mr8097975plg.156.1656612370904; Thu, 30 Jun 2022 11:06:10 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id h6-20020a170902680600b00163ffe73300sm13777187plk.137.2022.06.30.11.06.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Jun 2022 11:06:10 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 7/7] auto-t: add client test to testAP Date: Thu, 30 Jun 2022 11:03:31 -0700 Message-Id: <20220630180331.206419-7-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630180331.206419-1-prestwoj@gmail.com> References: <20220630180331.206419-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Tests iwctl functionality with ap commands --- autotests/testAP/connection_test.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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')