From f0ef68892e84cca695e772a3801fbb732458f1b5 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 21 Oct 2015 11:00:55 -0500 Subject: [PATCH] tests: Add testcases for interface global properties Signed-off-by: Dan Williams --- tests/hwsim/test_dbus.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index cdfaa1ed8..718d17134 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -295,6 +295,26 @@ def test_dbus_properties(dev, apdev): if "InvalidArgs: invalid message format" not in str(e): raise Exception("Unexpected error message: " + str(e)) +def test_dbus_set_global_properties(dev, apdev): + """D-Bus Get/Set fi.w1.wpa_supplicant1 interface global properties""" + (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0]) + + props = [ ('Okc', '0', '1'), ('ModelName', '', 'blahblahblah') ] + + for p in props: + res = if_obj.Get(WPAS_DBUS_IFACE, p[0], + dbus_interface=dbus.PROPERTIES_IFACE) + if res != p[1]: + raise Exception("Unexpected " + p[0] + " value: " + str(res)) + + if_obj.Set(WPAS_DBUS_IFACE, p[0], p[2], + dbus_interface=dbus.PROPERTIES_IFACE) + + res = if_obj.Get(WPAS_DBUS_IFACE, p[0], + dbus_interface=dbus.PROPERTIES_IFACE) + if res != p[2]: + raise Exception("Unexpected " + p[0] + " value after set: " + str(res)) + def test_dbus_invalid_method(dev, apdev): """D-Bus invalid method""" (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0]) @@ -4735,6 +4755,8 @@ def test_dbus_introspect(dev, apdev): logger.info("Initial Introspect: " + str(res)) if res is None or "Introspectable" not in res or "GroupStarted" not in res: raise Exception("Unexpected initial Introspect response: " + str(res)) + if "FastReauth" not in res or "PassiveScan" not in res: + raise Exception("Unexpected initial Introspect response: " + str(res)) with alloc_fail(dev[0], 1, "wpa_dbus_introspect"): res2 = if_obj.Introspect(WPAS_DBUS_IFACE,