[RESEND PATCH 3/3] tests: D-Bus Get/Set Pmf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Based on Jouni Malinen's [76055b4c6 "tests: D-Bus Get/Set Pmf"], modified
to use the correct "s" signature for the "Pmf" property.

Removed the negative test cases, because the synthesized property doens't
seem to do error checking upon being set.

Signed-off-by: Jouni Malinen <j@xxxxx>
Signed-off-by: Lubomir Rintel <lkundrak@xxxxx>
---
 tests/hwsim/test_dbus.py | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py
index b79e24ae9..82057365d 100644
--- a/tests/hwsim/test_dbus.py
+++ b/tests/hwsim/test_dbus.py
@@ -2367,6 +2367,33 @@ def _test_dbus_apscan(dev, apdev):
     if_obj.Set(WPAS_DBUS_IFACE, "ApScan", dbus.UInt32(1),
                dbus_interface=dbus.PROPERTIES_IFACE)
 
+def test_dbus_pmf(dev, apdev):
+    """D-Bus Get/Set Pmf"""
+    try:
+        _test_dbus_pmf(dev, apdev)
+    finally:
+        dev[0].request("SET pmf 0")
+
+def _test_dbus_pmf(dev, apdev):
+    (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
+
+    dev[0].set("pmf", "0")
+    res = if_obj.Get(WPAS_DBUS_IFACE, "Pmf",
+                     dbus_interface=dbus.PROPERTIES_IFACE)
+    if res != "0":
+        raise Exception("Unexpected initial Pmf value: %s" % res)
+
+    for i in range(3):
+        if_obj.Set(WPAS_DBUS_IFACE, "Pmf", str(i),
+                   dbus_interface=dbus.PROPERTIES_IFACE)
+        res = if_obj.Get(WPAS_DBUS_IFACE, "Pmf",
+                         dbus_interface=dbus.PROPERTIES_IFACE)
+        if res != str(i):
+            raise Exception("Unexpected Pmf value %s (expected %d)" % (res, i))
+
+    if_obj.Set(WPAS_DBUS_IFACE, "Pmf", "1",
+               dbus_interface=dbus.PROPERTIES_IFACE)
+
 def test_dbus_fastreauth(dev, apdev):
     """D-Bus Get/Set FastReauth"""
     (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
-- 
2.19.0


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux