tests: D-Bus Get/Set Pmf

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@w1.fi>
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
This commit is contained in:
Lubomir Rintel 2018-10-07 16:59:40 +02:00 committed by Jouni Malinen
parent 59d59eb0e0
commit 8b67f6496e

View File

@ -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])