From 8bc871ba624bf917c8e8193e3cec69754f2074e7 Mon Sep 17 00:00:00 2001 From: James Prestwood Date: Wed, 26 Oct 2022 11:56:53 -0700 Subject: [PATCH] auto-t: fix get_ordered_network if hostapd isn't running This API optimizes scanning to run tests quickly by only scanning the frequencies which hostapd is using. But if a test doesn't use hostapd this API raises an uncaught exception. Check if hostapd is being used, and if not just do a full scan. --- autotests/util/iwd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autotests/util/iwd.py b/autotests/util/iwd.py index a9df0dca..a9e2f2f5 100755 --- a/autotests/util/iwd.py +++ b/autotests/util/iwd.py @@ -519,7 +519,8 @@ class Device(IWDDBusAbstract): IWD._wait_for_object_condition(self, condition) try: - if full_scan: + # Do a full scan if instructed or if hostapd isn't being used + if full_scan or not ctx.hostapd: self.scan() else: self.debug_scan(ctx.get_frequencies())