]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: wpa_supplicant DUMP/GET global parameter
authorJouni Malinen <j@w1.fi>
Sun, 8 Feb 2015 20:06:07 +0000 (22:06 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 8 Feb 2015 20:49:58 +0000 (22:49 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wpas_ctrl.py
tests/hwsim/wpasupplicant.py

index b2144f71b966269b4b9ea190c60822930247eb64..00bde0a8af89155e4b08b9799516200048cf26c7 100644 (file)
@@ -1333,3 +1333,17 @@ def test_wpas_ctrl_misc(dev, apdev):
         raise Exception("Invalid INTERFACE_REMOVE accepted")
     if "FAIL" not in dev[0].global_request("SET foo"):
         raise Exception("Invalid global SET accepted")
+
+def test_wpas_ctrl_dump(dev, apdev):
+    """wpa_supplicant ctrl_iface and DUMP/GET global parameters"""
+    vals = dev[0].get_config()
+    logger.info("Config values from DUMP: " + str(vals))
+    for field in vals:
+        res = dev[0].request("GET " + field)
+        if res == 'FAIL\n':
+            res = "null"
+        if res != vals[field]:
+            print "'{}' != '{}'".format(res, vals[field])
+            raise Exception("Mismatch in config field " + field)
+    if "beacon_int" not in vals:
+        raise Exception("Missing config field")
index aa6b3343999749c5edaaf35cd3fd232bdb372777..4f1f1765394fbbdfe64f410bcc99e35b745226ab 100644 (file)
@@ -1050,3 +1050,14 @@ class WpaSupplicant:
 
     def get_group_ifname(self):
         return self.group_ifname if self.group_ifname else self.ifname
+
+    def get_config(self):
+        res = self.request("DUMP")
+        if res.startswith("FAIL"):
+            raise Exception("DUMP failed")
+        lines = res.splitlines()
+        vals = dict()
+        for l in lines:
+            [name,value] = l.split('=', 1)
+            vals[name] = value
+        return vals