Commit f3dddcff authored by Thomas Haller's avatar Thomas Haller

clients/tests: verify connections in test-networkmanager-service.py using libnm

The real NetworkManager service has a clear understanding how a valid
connection looks like. This is what nm_connection_verify() returns.

Let also our stub-service verify connections the same way.

Note that this is cumbersome, because the stub service uses python's
dbus module, while libnm only accepts creating NMConnection instances
from GVariant. Thus, we need to a cumbersome conversion first.

It would be better if test-networkmanager-service.py would also expose
normalized connections on D-Bus. But that requires the inverse converion
from GVariant to python dbus.
parent 780af4cf
location: clients/tests/test-client.py:812:test_004()/3
cmd: $NMCLI connection mod con-xx1 ipv4.gateway 172.16.0.1
lang: C
returncode: 0
returncode: 1
stdout: 0 bytes
>>>
<<<
stderr: 0 bytes
stderr: 119 bytes
>>>
Error: Failed to modify connection 'con-xx1': ipv4.gateway: gateway cannot be set if there are no addresses configured
<<<
location: clients/tests/test-client.py:813:test_004()/4
cmd: $NMCLI connection mod con-xx1 ipv6.gateway ::99
lang: C
returncode: 0
returncode: 1
stdout: 0 bytes
>>>
<<<
stderr: 0 bytes
stderr: 119 bytes
>>>
Error: Failed to modify connection 'con-xx1': ipv6.gateway: gateway cannot be set if there are no addresses configured
<<<
......@@ -280,8 +280,8 @@ class NMStubServer:
raise AttributeError(member)
return self._MethodProxy(self, member[3:])
def addConnection(self, connection, verify_connection = True):
return self.op_AddConnection(connection, verify_connection)
def addConnection(self, connection, do_verify_strict = True):
return self.op_AddConnection(connection, do_verify_strict)
def findConnectionUuid(self, con_id):
try:
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment