]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Add get_driver_status for Hostapd
authorJouni Malinen <j@w1.fi>
Sun, 5 Jan 2014 19:54:46 +0000 (21:54 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jan 2014 08:45:12 +0000 (10:45 +0200)
This is identical to the same command in WpaSupplicant class.

Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/hostapd.py

index fa1d356126b51aeffa2b6722009d49293907f472..b282a9b7417cd4d9179fdaa8fcb15a1de78d0889 100644 (file)
@@ -152,6 +152,21 @@ class Hostapd:
             return vals[field]
         return None
 
+    def get_driver_status(self):
+        res = self.request("STATUS-DRIVER")
+        lines = res.splitlines()
+        vals = dict()
+        for l in lines:
+            [name,value] = l.split('=', 1)
+            vals[name] = value
+        return vals
+
+    def get_driver_status_field(self, field):
+        vals = self.get_driver_status()
+        if field in vals:
+            return vals[field]
+        return None
+
     def mgmt_rx(self, timeout=5):
         ev = self.wait_event(["MGMT-RX"], timeout=timeout)
         if ev is None: