commit 13952ff3504168433603ea5d81400db37a4d180e
parent 2be49a93ba87d9a4254b090641e6a9ae8688c4a4
Author: James Prestwood <prestwoj@gmail.com>
Date: Mon, 13 Nov 2023 06:32:54 -0800
auto-t: add stop APIs and fix some issues wpas.py
- wait_for_event was returning a list in certain cases, not the
event itself
- The configurator ID was not being printed (',' instead of '%')
- The DPP ID was not being properly waited for with PKEX
Diffstat:
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/autotests/util/wpas.py b/autotests/util/wpas.py
@@ -76,7 +76,7 @@ class Wpas:
for e in self._rx_data:
if event in e:
- return self._rx_data
+ return e
return False
@@ -281,7 +281,7 @@ class Wpas:
self._dpp_conf_id = self.wait_for_result()
if not uri:
- print("DPP Configurator ID: %s", self._dpp_conf_id)
+ print("DPP Configurator ID: %s" % self._dpp_conf_id)
return
self._rx_data = []
@@ -315,6 +315,8 @@ class Wpas:
self._rx_data = []
self._ctrl_request(cmd)
self._dpp_id = self.wait_for_result()
+ while not self._dpp_id.isnumeric():
+ self._dpp_id = self.wait_for_result()
def dpp_pkex_add(self, code, identifier=None, version=None, initiator=False, role=None):
cmd = f'DPP_PKEX_ADD own={self._dpp_id}'
@@ -336,10 +338,18 @@ class Wpas:
self._rx_data = []
self._ctrl_request(cmd)
+ def dpp_pkex_remove(self):
+ self._rx_data = []
+ self._ctrl_request("DPP_PKEX_REMOVE *")
+
def dpp_listen(self, freq):
self._rx_data = []
self._ctrl_request(f'DPP_LISTEN {freq}')
+ def dpp_stop_listen(self):
+ self._rx_data = []
+ self._ctrl_request("DPP_STOP_LISTEN")
+
def dpp_configurator_remove(self):
self._ctrl_request('DPP_CONFIGURATOR_REMOVE *')
self.wait_for_result()