All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 4/6] auto-t: iwd.py: scan only on needed frequencies
Date: Thu, 12 Aug 2021 16:12:31 -0700	[thread overview]
Message-ID: <20210812231233.747743-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20210812231233.747743-1-prestwoj@gmail.com>

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

get_ordered_network() now scans automatically and has been updated
to use the StationDebug.Scan() API rather than doing a full
dbus scan (unless full_scan = True). The frequencies to be scanned
are picked automatically based on the current hostapd status
(hidden behind ctx.hostapd.get_frequency()).
---
 autotests/util/iwd.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py
index 7bb4c9f0..cee1b99d 100755
--- a/autotests/util/iwd.py
+++ b/autotests/util/iwd.py
@@ -414,7 +414,7 @@ class Device(IWDDBusAbstract):
 
         self._wait_for_async_op()
 
-    def get_ordered_networks(self, scan_if_needed = True):
+    def get_ordered_networks(self, scan_if_needed = True, full_scan = False):
         '''Return the list of networks found in the most recent
            scan, sorted by their user interface importance
            score as calculated by iwd.  If the device is
@@ -440,7 +440,10 @@ class Device(IWDDBusAbstract):
         IWD._wait_for_object_condition(self, condition)
 
         try:
-            self.scan()
+            if full_scan:
+                self.scan()
+            else:
+                self.debug_scan(ctx.get_frequencies())
         except InProgressEx:
             pass
 
@@ -458,7 +461,7 @@ class Device(IWDDBusAbstract):
 
         return None
 
-    def get_ordered_network(self, network, scan_if_needed = True):
+    def get_ordered_network(self, network, scan_if_needed = True, full_scan = False):
         '''Returns a single network from ordered network call, or None if the
            network wasn't found. If the network is not found an exception is
            raised, this removes the need to extra asserts in autotests.
-- 
2.31.1

  parent reply	other threads:[~2021-08-12 23:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 23:12 [PATCH 1/6] station: implement Scan on debug interface James Prestwood
2021-08-12 23:12 ` [PATCH 2/6] auto-t: add python API for StationDebug.Scan James Prestwood
2021-08-12 23:12 ` [PATCH 3/6] test-runner: start HostapdCLI from test-runner James Prestwood
2021-08-12 23:12 ` James Prestwood [this message]
2021-08-12 23:12 ` [PATCH 5/6] auto-t: use .frequency property in SAQuery-spoofing test James Prestwood
2021-08-12 23:12 ` [PATCH 6/6] auto-t: hostapd.py: remove get_freq()/get_config_value() James Prestwood
2021-08-13 15:46 ` [PATCH 1/6] station: implement Scan on debug interface 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=20210812231233.747743-4-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /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.