diff options
author | Thomas Haller <thaller@redhat.com> | 2018-05-15 10:06:37 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2018-05-15 10:06:38 +0200 |
commit | ca5dc9cb17ededd0a538d2e24802ccf426f1124b (patch) | |
tree | ec1b007012064ae892ae5bccda579714ab546f50 /tools | |
parent | 250d915da32e2ff8771bac60d7fcef708ba5f1a7 (diff) |
tests/trivial: move code
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/test-networkmanager-service.py | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/tools/test-networkmanager-service.py b/tools/test-networkmanager-service.py index ec47eefee..39dc37f57 100755 --- a/tools/test-networkmanager-service.py +++ b/tools/test-networkmanager-service.py @@ -1245,6 +1245,36 @@ class Settings(ExportedObj): ############################################################################### +IFACE_DNS_MANAGER = 'org.freedesktop.NetworkManager.DnsManager' + +PRP_DNS_MANAGER_MODE = 'Mode' +PRP_DNS_MANAGER_RC_MANAGER = 'RcManager' +PRP_DNS_MANAGER_CONFIGURATION = 'Configuration' + +class DnsManager(ExportedObj): + def __init__(self): + ExportedObj.__init__(self, "/org/freedesktop/NetworkManager/DnsManager") + + props = { + PRP_DNS_MANAGER_MODE: "dnsmasq", + PRP_DNS_MANAGER_RC_MANAGER: "symlink", + PRP_DNS_MANAGER_CONFIGURATION: dbus.Array( + [ + dbus.Dictionary( + { + 'nameservers' : dbus.Array(['1.2.3.4', '5.6.7.8'], 's'), + 'priority' : dbus.Int32(100), + }, + 'sv') + ], + 'a{sv}'), + } + + self.dbus_interface_add(IFACE_DNS_MANAGER, props) + self.export() + +############################################################################### + IFACE_AGENT_MANAGER = 'org.freedesktop.NetworkManager.AgentManager' IFACE_AGENT = 'org.freedesktop.NetworkManager.SecretAgent' @@ -1341,36 +1371,6 @@ class ObjectManager(dbus.service.Object): ############################################################################### -IFACE_DNS_MANAGER = 'org.freedesktop.NetworkManager.DnsManager' - -PRP_DNS_MANAGER_MODE = 'Mode' -PRP_DNS_MANAGER_RC_MANAGER = 'RcManager' -PRP_DNS_MANAGER_CONFIGURATION = 'Configuration' - -class DnsManager(ExportedObj): - def __init__(self): - ExportedObj.__init__(self, "/org/freedesktop/NetworkManager/DnsManager") - - props = { - PRP_DNS_MANAGER_MODE: "dnsmasq", - PRP_DNS_MANAGER_RC_MANAGER: "symlink", - PRP_DNS_MANAGER_CONFIGURATION: dbus.Array( - [ - dbus.Dictionary( - { - 'nameservers' : dbus.Array(['1.2.3.4', '5.6.7.8'], 's'), - 'priority' : dbus.Int32(100), - }, - 'sv') - ], - 'a{sv}'), - } - - self.dbus_interface_add(IFACE_DNS_MANAGER, props) - self.export() - -############################################################################### - def main(): dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) |