if "InvalidArgs" not in str(e):
raise Exception("Unexpected error message for invalid TDLSTeardown: " + str(e))
+ try:
+ iface.TDLSTeardown("00:11:22:33:44:55")
+ raise Exception("TDLSTeardown accepted for unknown peer")
+ except dbus.exceptions.DBusException, e:
+ if "UnknownError: error performing TDLS teardown" not in str(e):
+ raise Exception("Unexpected error message: " + str(e))
+
def test_dbus_tdls(dev, apdev):
"""D-Bus TDLS"""
(bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
if len(addr) > 0:
addr += ':'
addr += '%02x' % ord(p)
+
+ params = { 'Role': 'registrar',
+ 'P2PDeviceAddress': self.peer['DeviceAddress'],
+ 'Bssid': self.peer['DeviceAddress'],
+ 'Type': 'pin' }
+ try:
+ wps.Start(params)
+ raise Exception("Invalid WPS.Start() accepted")
+ except dbus.exceptions.DBusException, e:
+ if "InvalidArgs" not in str(e):
+ raise Exception("Unexpected error message: " + str(e))
params = { 'Role': 'registrar',
'P2PDeviceAddress': self.peer['DeviceAddress'],
'Bssid': self.peer['DeviceAddress'],
if not t.success():
raise Exception("Expected signals not seen")
+def test_dbus_old_network_set(dev, apdev):
+ """The old D-Bus interface and network set method"""
+ (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
+
+ path = if_obj.addNetwork(dbus_interface=WPAS_DBUS_OLD_IFACE)
+ netw_obj = bus.get_object(WPAS_DBUS_OLD_SERVICE, path)
+ netw_obj.disable(dbus_interface=WPAS_DBUS_OLD_NETWORK)
+
+ params = dbus.Dictionary({ 'priority': dbus.UInt64(1) }, signature='sv')
+ try:
+ netw_obj.set(params, dbus_interface=WPAS_DBUS_OLD_NETWORK)
+ raise Exception("set succeeded with unexpected type")
+ except dbus.exceptions.DBusException, e:
+ if "InvalidOptions" not in str(e):
+ raise Exception("Unexpected error message for unexpected type: " + str(e))
+
def test_dbus_old_wps_pbc(dev, apdev):
"""The old D-Bus interface and WPS/PBC"""
try: