From patchwork Thu Nov 3 17:30:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13030754 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 2A1B863A0 for ; Thu, 3 Nov 2022 17:31:00 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so5894502pjc.3 for ; Thu, 03 Nov 2022 10:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QOaG1GScb/lJbsqJtwI+4gsf1qpFpiYt0OC9iRcYb5s=; b=L9wCbd6e6Q56SvbGq7zGvseX9afDRjFh3J3nK04O6ysWz3TGCi9m62SYpTHndLInBU vbRJHUeX44ieQSq+p2RGLyF8Bfe6ks2+brn67lHNteqeXJWmpBuBH9L53VzcvHy31MFB 73cK7hWKjJZWjeqETSV1HQ4VAB+1lYV0zbEmrknQ4a3PjDtK78tDvSLoUtqflWumalHy 2DGY3sQmc+k/rbACr/99Pc2IbQZdhQga9GbiwwUaspXDBkdUV4Mt8vxCg8HfrbM8AOr5 IxJu7QGlmcfooBFY/vLkIU/pDaGOGcuUMHEcwzpgLxq93H0jl2NQ8u6m8Jb9Yt8m0gIy vRIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QOaG1GScb/lJbsqJtwI+4gsf1qpFpiYt0OC9iRcYb5s=; b=Vp87AoqN9BmfupeljhmNcRAbE68sTrnF41t9W/OUWypjGcf3n8K8vI1IgBFN41FOvm kUbwC93bs3zLFTHZb/axsvSUVyD/ug3KM0WnGWixTaoeft9ansQI8FfYyY6KdTnKn8JM N8YEJjHyA1xZxIWfWjAfcmXRTYo0ovkf8ODdhuFkV/Q2gcFvSkDYP2XqJvipCyjP1zRA OkH1NIU/hoQzeKjhIQcdJxQ7b3VsrrcuB9MqDh4ca5fXBzM1GaxTP+ISDU9SrMy4Oz1o xhhfIByg9pbWsnpMOYfWIoC5Q+OUnhYH5Kx1d5dw0modJ283b22/YrRSUawdSrUDbGre 693A== X-Gm-Message-State: ACrzQf1vHMZ0oiVn5JQ61ZG9m2Apa+nI9+X5YTYu95ityCd21mf3nh0K OlBhCc950Gk/gtOzOzHRpBZURXdmTns= X-Google-Smtp-Source: AMsMyM6SLL1c3tj8M2iSuEMLvoWMd4OQb3gg4dFlCYTr0hLCdOFL0837qVhdeTiv1yZvzRbNNLqtRQ== X-Received: by 2002:a17:90b:4a92:b0:213:2421:5f38 with SMTP id lp18-20020a17090b4a9200b0021324215f38mr33179610pjb.10.1667496659335; Thu, 03 Nov 2022 10:30:59 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id k18-20020aa79d12000000b0056afd55722asm979721pfp.153.2022.11.03.10.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 10:30:58 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/4] doc: document AP properties PairwiseCiphers/GroupCipher Date: Thu, 3 Nov 2022 10:30:54 -0700 Message-Id: <20221103173057.381232-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- doc/access-point-api.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/access-point-api.txt b/doc/access-point-api.txt index 63e61d49..28e6437d 100644 --- a/doc/access-point-api.txt +++ b/doc/access-point-api.txt @@ -71,3 +71,16 @@ Properties boolean Started [readonly] uint32 Frequency [readonly, optional] The frequency that the Access Point is operating on. + + string PairwiseCiphers [readonly, optional] + + Comma separated list of pairwise ciphers the access + point supports. The same format as setting a list of + ciphers for an AP profile, i.e. TKIP, CCMP-128, + GCMP-128, CCMP-256, GCMP-256 etc. + + string GroupCipher [readonly, optional] + + The group cipher suite the access point is using. + Possible values are the same as what could be included + in the PairwiseCiphers list. From patchwork Thu Nov 3 17:30:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13030755 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 071B663AC for ; Thu, 3 Nov 2022 17:31:00 +0000 (UTC) Received: by mail-pj1-f42.google.com with SMTP id m14-20020a17090a3f8e00b00212dab39bcdso5953228pjc.0 for ; Thu, 03 Nov 2022 10:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z382w+ejbLWQFYQvGWYorSnyaamyHyeaUeQ9Op6/71c=; b=ireXQ1+WwVWYXBW46DsYziwlYRYCIKRaY595XnhC8caW/qFlC8ZTD6tEC/7RlmRflG KIWvGZApxRhRf5iI5QuLSQV4BDR2toNg7Yx0RpZRwRlLG49Xv7KeOLVoUgMTy4wetKhl xCcmzdD7psOaqgvCCBRDRFj3Gy4enlmgU/ww4l7ggYioVhwAIIvlQNFVziFdP7ymM0vz 7qZ4aXpmr4DPWnIusOWrlYsKaXg5F9MWwguV7AIp0V+9+uFO2q/l6cPh43MLgpPY/n7o PNf8IBxo2HdJu4mlsE9/7L8WXxnH/fXxgmQFo1RAu05LIxYYBm82gMLbgICTwn+pd6/K 3oTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z382w+ejbLWQFYQvGWYorSnyaamyHyeaUeQ9Op6/71c=; b=ENWznHvl3zSM2Aat2cK/fG/NJfaYpRt0M++yXyjwl6cn4yub2tPTrVjI2nBU2LCxm4 9nBg7RrEw7DVtOGRsqGvP/vO58qQ4WhS6dRJxQpA/XhQSYJMswU1X/S7QBfN2RXIes0H inS2E4q/Px1n2gWsv4y+aqjriWJHS5UX0GHrE0+vDk/mlyqvthkzGrgKcVQSvv0XXcay NUcJb02NbFLssjOkVtyqQ4KpD8/Sefh4yjTCa9nCVUzlfoxZFU8lf4FQTF6R1JSpCQE6 sBYPhu6E6OJAdyRTgZrKYko3Bk06LPD2TZdp0DCPefVLuXapKkQG1a1GH7sFk7KnRyln C4IQ== X-Gm-Message-State: ACrzQf1oOHX5gPqCEZ5kQmuFjjWOpL09uof75KTK4q/QbMDq/Hg9zvjf uGtpVo7t0kn6Zx7vBvEK2k1rJMRQPPI= X-Google-Smtp-Source: AMsMyM5kz+i2twp7fiNovVech1OIDLGWULFpcqtzeIWmayX4SsmYTF1RR+qROuKW70VANFtJ5wZAyQ== X-Received: by 2002:a17:90a:b8f:b0:213:c985:b5e5 with SMTP id 15-20020a17090a0b8f00b00213c985b5e5mr27486640pjr.57.1667496660262; Thu, 03 Nov 2022 10:31:00 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id k18-20020aa79d12000000b0056afd55722asm979721pfp.153.2022.11.03.10.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 10:30:59 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/4] ap: update Scanning property when AP starts Date: Thu, 3 Nov 2022 10:30:55 -0700 Message-Id: <20221103173057.381232-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221103173057.381232-1-prestwoj@gmail.com> References: <20221103173057.381232-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This wasn't being updated meaning the property is missing until a scan is issued over DBus. Rather than duplicate all the property changed calls they were all factored out into a helper function. --- src/ap.c | 55 +++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 30 deletions(-) v2: * Fixed build problem that didn't make it into v1 diff --git a/src/ap.c b/src/ap.c index 9c82a545..665c1857 100644 --- a/src/ap.c +++ b/src/ap.c @@ -3672,6 +3672,28 @@ struct ap_if_data { struct l_dbus_message *pending; }; +static void ap_properties_changed(struct ap_if_data *ap_if) +{ + l_dbus_property_changed(dbus_get_bus(), + netdev_get_path(ap_if->netdev), + IWD_AP_INTERFACE, "Started"); + l_dbus_property_changed(dbus_get_bus(), + netdev_get_path(ap_if->netdev), + IWD_AP_INTERFACE, "Name"); + l_dbus_property_changed(dbus_get_bus(), + netdev_get_path(ap_if->netdev), + IWD_AP_INTERFACE, "Frequency"); + l_dbus_property_changed(dbus_get_bus(), + netdev_get_path(ap_if->netdev), + IWD_AP_INTERFACE, "PairwiseCiphers"); + l_dbus_property_changed(dbus_get_bus(), + netdev_get_path(ap_if->netdev), + IWD_AP_INTERFACE, "GroupCipher"); + l_dbus_property_changed(dbus_get_bus(), + netdev_get_path(ap_if->netdev), + IWD_AP_INTERFACE, "Scanning"); +} + static void ap_if_event_func(enum ap_event_type type, const void *event_data, void *user_data) { @@ -3703,21 +3725,8 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data, reply = l_dbus_message_new_method_return(ap_if->pending); dbus_pending_reply(&ap_if->pending, reply); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "Started"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "Name"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "Frequency"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "PairwiseCiphers"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "GroupCipher"); + + ap_properties_changed(ap_if); l_rtnl_set_linkmode_and_operstate(rtnl, netdev_get_ifindex(ap_if->netdev), @@ -3730,21 +3739,7 @@ static void ap_if_event_func(enum ap_event_type type, const void *event_data, netdev_get_path(ap_if->netdev), IWD_AP_DIAGNOSTIC_INTERFACE); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "Started"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "Name"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "Frequency"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "PairwiseCiphers"); - l_dbus_property_changed(dbus_get_bus(), - netdev_get_path(ap_if->netdev), - IWD_AP_INTERFACE, "GroupCipher"); + ap_properties_changed(ap_if); l_rtnl_set_linkmode_and_operstate(rtnl, netdev_get_ifindex(ap_if->netdev), From patchwork Thu Nov 3 17:30:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13030756 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.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 B33D163AF for ; Thu, 3 Nov 2022 17:31:01 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id g62so2242862pfb.10 for ; Thu, 03 Nov 2022 10:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uuaLdpWzsIa65B9D+BQqDuU1vAJrEspEFUSJXgonnZ0=; b=LtMz24XGJEZ48pes+bXthzt3jspgkHsjmpX7tKunYxrWSWERUkbSE6WK0MSvHQjYYC zyyBHww0wkGbDs6niMM2hvT5koDY4nVGI91930qlTW7zarW6Wp3NFnVux/2NZFJl84CI CXppO/pYUFfhgdjnDNXEY1ZnvaOXLIKI/EFS2Mdy8DfHkIOjsCfABgzA6gY8CksihyiM l1mDA7sNtieDHnVE/Op+n4h8vQG0vsAl4XFieN59K/wqno5PQHn1bWxVNQJtwhsSw7rE GVvrSHOly0YH8o6LFxgrnb5SY4sJb1YMrBfmyd/So+hCqFuy323sOqR770lWEZ0f12mg YQWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uuaLdpWzsIa65B9D+BQqDuU1vAJrEspEFUSJXgonnZ0=; b=laukhs8Pg01iHBxTXqlJqJs+ltLZ2CcM15mQWh6Ns7qGInY+OfrL4/abwdBbhjwC70 P+okrob7xJZA+sqj8jebCHOAa9C4bVjUDOcAhmdZ8bhEeSwRssN5EWOYYXf7MkE3dIyJ /P/KwGvTq0j19iv0wTQNghLvCslFdK0gBiciqSQPsKgEzuUYoX+dbylKOrLSW8AAhkHa 7yMKftH8wyzcJ3SSvj5gdpVZVIQLdfByLLXfEUacn4DJvoAAzXWp0/MA5IO10COkUwxP uDTF4Nbl/1uN+n2+MKl3w5BEtX2T8Mtk84w5UGYPWv9M2ffONxIbn7ClUcwJDrBtPeZn s1lw== X-Gm-Message-State: ACrzQf2IcXmqF40O28XPeHv+BeknrmpKLzPFYCtGLiUzULXXQOivpCDB 92gUy6HDUB88+gwuRp07Akv+3wiaU/E= X-Google-Smtp-Source: AMsMyM4yoTisdGUKDvd5msAHwvK9UsMfLt4y5Ep5bJXUYsqsi9fNQ4wE2ljUHJwvwcElfNZVjacGhg== X-Received: by 2002:a05:6a00:1995:b0:56e:1fff:da75 with SMTP id d21-20020a056a00199500b0056e1fffda75mr8190795pfl.81.1667496660967; Thu, 03 Nov 2022 10:31:00 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id k18-20020aa79d12000000b0056afd55722asm979721pfp.153.2022.11.03.10.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 10:31:00 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/4] auto-t: iwd.py: allow certain APIs to be used in AP mode Date: Thu, 3 Nov 2022 10:30:56 -0700 Message-Id: <20221103173057.381232-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221103173057.381232-1-prestwoj@gmail.com> References: <20221103173057.381232-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 AP mode implements a few DBus methods/properties which are named the same as station: Scan, Scanning, and GetOrderedNetworks. Allow the Device object to work with these in AP mode by calling the correct method if the Mode is 'ap'. --- autotests/util/iwd.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index 98b9ea1c..5fa12444 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -521,13 +521,16 @@ class Device(IWDDBusAbstract): def scanning(self): ''' Reflects whether the device is currently scanning - for networks. net.connman.iwd.Network objects are - updated when this property goes from true to false. + for networks. For station devices net.connman.iwd.Network + objects are updated when this property goes from true to false @rtype: boolean ''' - props = self._station_properties() - return bool(props['Scanning']) + if self._properties['Mode'] == 'station': + props = self._station_properties() + return bool(props['Scanning']) + else: + return bool(self._ap.scanning) @property def autoconnect(self): @@ -544,12 +547,14 @@ class Device(IWDDBusAbstract): Possible exception: BusyEx FailedEx ''' - self._iface.Scan(dbus_interface=IWD_STATION_INTERFACE, + if self._properties['Mode'] == 'station': + self._iface.Scan(dbus_interface=IWD_STATION_INTERFACE, reply_handler=self._success, error_handler=self._failure) - - if wait: - self._wait_for_async_op() + if wait: + self._wait_for_async_op() + else: + self._ap.scan() def disconnect(self): '''Disconnect from the network @@ -576,6 +581,9 @@ class Device(IWDDBusAbstract): groups the maximum relative signal-strength is the main sorting factor. ''' + if self._properties['Mode'] == 'ap': + return self._ap.get_ordered_networks() + ordered_networks = [] if not full_scan: for bus_obj in self._station.GetOrderedNetworks(): From patchwork Thu Nov 3 17:30:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13030757 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 54CD463A0 for ; Thu, 3 Nov 2022 17:31:02 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id k5so2311319pjo.5 for ; Thu, 03 Nov 2022 10:31:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jdB7I+XkRlGpC7TkkPgj49Yc/D3ExGTSZAYf7qlfNsE=; b=nFYYIwWKja44LgmHh7fYQk35X0xhqqVpTeF3ED3j6hQVQ8Y7/LwUapRPsXftepQSf0 srFkokKCVA4dFRS/HGYtdwl4G32nNVAf3Aml9S/eWVwAbn1QSwMl0kRqjZNwJv02UAzd +WLq/M2SjN7RzUtbTuiU0cdkdi6EVOinlZzZrz2KqUJeWRQ0q5mjVxS3fOYHR72Qz9Qn bGGlINo5TNALr2Q78pkGZ/64TFdXEG8FwHSoD7LRvuiLy9Gce41lm2bvBVbJSER0ddWD TK2BsjTh5BIjgup1oY1pKSrpvzofeEO/vgIQ0tRkri+g8MY1Nzzfptp+AY+JVeVHYBEi 82BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jdB7I+XkRlGpC7TkkPgj49Yc/D3ExGTSZAYf7qlfNsE=; b=l/akad2DvoCnRMf8eFjo/cdH/yoLi+3+p+4tjOqBbt6ls/L/5CDoh+b4Rhh0v6C3TD 4BiMD8YPCkUcH8DRaR30bSN15PKrVm8/z/eQTl+OkJ7sSK2XTPvNG44SiM8FWeK+EgoH seAZ3IZdTEQ2M2bU6Pn81gmiYHbicN54xDYjLqkqrdqSBIdeYTeYlr0cSMU8vf6GGexO 9w17GE3PNE/xOpXOE7N91IwCEfU7gOL8u0KPA+7EgZdDsvx/iRtCzEbMsRGk+JCC1ypA VLke40cXX9isn/cA7AZmD4/iOvJufFKYXw0+jMFBl5fkenBbkYTWRMXUOkbJ80gTKMRu ComA== X-Gm-Message-State: ACrzQf08TkkF9/ZJi02hajbAL6ckTmG8NRyPrqIRg7NmESlQnfgLM/V2 76X1wwguGJ0ws7Nx+iD9yukRY5GH+B0= X-Google-Smtp-Source: AMsMyM7c6HF399QHX3rXDnxcf2CHPtck5zjnK2dk9y9hG2YyBiwzotJIuYdKrRgvJ06IkLXntvgvxg== X-Received: by 2002:a17:90a:24b:b0:213:9da2:5c98 with SMTP id t11-20020a17090a024b00b002139da25c98mr32595292pje.123.1667496661685; Thu, 03 Nov 2022 10:31:01 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.160.234]) by smtp.gmail.com with ESMTPSA id k18-20020aa79d12000000b0056afd55722asm979721pfp.153.2022.11.03.10.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 10:31:01 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 4/4] auto-t: add test for scanning in AP mode Date: Thu, 3 Nov 2022 10:30:57 -0700 Message-Id: <20221103173057.381232-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20221103173057.381232-1-prestwoj@gmail.com> References: <20221103173057.381232-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 --- autotests/testAP/scan_test.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 autotests/testAP/scan_test.py diff --git a/autotests/testAP/scan_test.py b/autotests/testAP/scan_test.py new file mode 100644 index 00000000..0935912c --- /dev/null +++ b/autotests/testAP/scan_test.py @@ -0,0 +1,20 @@ +#! /usr/bin/python3 + +import unittest + +from iwd import IWD + +class Test(unittest.TestCase): + def test_ap_scan(self): + wd = IWD(True) + + dev = wd.list_devices(1)[0] + + dev.start_ap('TestAP2', 'Password2') + + dev.scan() + + networks = dev.get_ordered_networks() + + self.assertTrue(len(networks) == 1) + self.assertTrue(networks[0]['Name'] == 'TestAP1')