diff mbox

[2/2] tests: D-Bus MeshInterfaceAdd

Message ID 1483629509-2641-3-git-send-email-saurav.babu@samsung.com
State Changes Requested
Headers show

Commit Message

Saurav Babu Jan. 5, 2017, 3:18 p.m. UTC
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
---
 tests/hwsim/test_dbus.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox

Patch

diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py
index d7b4b6d..bb17b1d 100644
--- a/tests/hwsim/test_dbus.py
+++ b/tests/hwsim/test_dbus.py
@@ -5418,3 +5418,14 @@  def test_dbus_assoc_reject(dev, apdev):
     with TestDbusConnect(bus) as t:
         if not t.success():
             raise Exception("Expected signals not seen")
+
+def test_dbus_mesh_interface_add(dev, apdev):
+    """D-Bus MeshInterfaceAdd"""
+    (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
+    iface = dbus.Interface(if_obj, WPAS_DBUS_IFACE)
+    try:
+        iface.MeshInterfaceAdd("mesh0")
+        raise Exception("MeshInterfaceAdd() accepted unexpectedly")
+    except dbus.exceptions.DBusException, e:
+        if not str(e).startswith("fi.w1.wpa_supplicant1.UnknownError: Not allowed to add mesh interface"):
+            raise Exception("Unexpected error message for MeshInterfaceAdd(): " + str(e))