diff mbox series

[08/11] auto-t: add HostapdCLI.sta_status

Message ID 20240227183405.257206-8-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [01/11] doc: Document UseDefaultEccGroup | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Feb. 27, 2024, 6:34 p.m. UTC
Gets information about a specific STA hostapd is tracking. This
object will contain detailed information such as the SAE group
number used.
---
 autotests/util/hostapd.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py
index cee08092..2f92e330 100644
--- a/autotests/util/hostapd.py
+++ b/autotests/util/hostapd.py
@@ -306,6 +306,22 @@  class HostapdCLI(object):
 
         return ret
 
+    def sta_status(self, address):
+        ret = {}
+
+        cmd = self.cmdline + ['sta', address]
+        proc = ctx.start_process(cmd)
+        proc.wait()
+        status = proc.out.strip().split('\n')
+
+        # Pop address
+        status.pop(0)
+        for kv in status:
+            k, v = kv.split('=', 1)
+            ret[k] = v
+
+        return ret
+
     @property
     def bssid(self):
         return self._get_status()['bssid[0]']