]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: wpa_supplicant MIB command
authorJouni Malinen <j@w1.fi>
Sat, 15 Mar 2014 22:18:03 +0000 (00:18 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 15 Mar 2014 22:18:03 +0000 (00:18 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wpas_ctrl.py
tests/hwsim/wpasupplicant.py

index adb659f374d8e12ae2afb1dc504421f089842710..2daa3dc5e7aa5cb8eb7e3e2fe1186628c5361ac3 100644 (file)
@@ -263,3 +263,11 @@ def test_wpas_ctrl_config_parser(dev):
 
     if "FAIL" not in dev[0].request("SET serial_number 0123456789abcdef0123456789abcdef0"):
         raise Exception("Too long string accepted")
+
+def test_wpas_ctrl_mib(dev):
+    """wpa_supplicant ctrl_iface MIB"""
+    mib = dev[0].get_mib()
+    if "dot11RSNAOptionImplemented" not in mib:
+        raise Exception("Missing MIB entry")
+    if mib["dot11RSNAOptionImplemented"] != "TRUE":
+        raise Exception("Unexpected dot11RSNAOptionImplemented value")
index 0e745a3f3928866826f0b9be168ded4da4591b38..3ad1558570633fca0806f102f461278ad09c7b23 100644 (file)
@@ -290,6 +290,18 @@ class WpaSupplicant:
             return vals[field]
         return None
 
+    def get_mib(self):
+        res = self.request("MIB")
+        lines = res.splitlines()
+        vals = dict()
+        for l in lines:
+            try:
+                [name,value] = l.split('=', 1)
+                vals[name] = value
+            except ValueError, e:
+                logger.info(self.ifname + ": Ignore unexpected MIB line: " + l)
+        return vals
+
     def p2p_dev_addr(self):
         return self.get_status_field("p2p_device_address")