if "InvalidArgs" not in str(e):
raise Exception("Unexpected error message for invalid RejectPeer(): " + str(e))
+ tests = [ { },
+ { 'peer': 'foo' },
+ { 'foo': "bar" },
+ { 'iface': "abc" },
+ { 'iface': 123 } ]
+ for t in tests:
+ try:
+ p2p.RemoveClient(t)
+ raise Exception("Invalid RemoveClient accepted")
+ except dbus.exceptions.DBusException, e:
+ if "InvalidArgs" not in str(e):
+ raise Exception("Unexpected error message for invalid RemoveClient(): " + str(e))
+
tests = [ {'DiscoveryType': 'foo'},
{'RequestedDeviceTypes': 'foo'},
{'RequestedDeviceTypes': ['foo']},
TestDbus.__init__(self, bus)
self.first = True
self.waiting_end = False
+ self.deauthorized = False
self.done = False
def __enter__(self):
"ProvisionDiscoveryRequestDisplayPin")
self.add_signal(self.staAuthorized, WPAS_DBUS_IFACE,
"StaAuthorized")
+ self.add_signal(self.staDeauthorized, WPAS_DBUS_IFACE,
+ "StaDeauthorized")
self.loop.run()
return self
if "Error.Failed" not in str(e):
raise Exception("Unexpected error message for invalid Set(WPSVendorExtensions): " + str(e))
+ p2p.RemoveClient({ 'peer': self.peer_path })
+
self.waiting_end = True
group_p2p = dbus.Interface(self.g_if_obj,
WPAS_DBUS_IFACE_P2PDEVICE)
group_p2p.Disconnect()
+ def staDeauthorized(self, name):
+ logger.debug("staDeauthorized: " + name)
+ self.deauthorized = True
+
def run_test(self, *args):
logger.debug("run_test")
params = dbus.Dictionary({'persistent': True,
return False
def success(self):
- return self.done
+ return self.done and self.deauthorized
with TestDbusP2p(bus) as t:
if not t.success():