tests: Additional D-Bus error path coverage

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2015-01-09 01:41:57 +02:00
parent a354bcc886
commit 795b6f57a8
2 changed files with 34 additions and 0 deletions

View file

@ -1353,6 +1353,13 @@ def test_dbus_tdls_invalid(dev, apdev):
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])
@ -2460,6 +2467,17 @@ def test_dbus_p2p_autogo(dev, apdev):
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'],

View file

@ -552,6 +552,22 @@ def test_dbus_old_connect_eap(dev, apdev):
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: