mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-07 04:34:04 -05:00
tests: Additional D-Bus error path coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
a354bcc886
commit
795b6f57a8
@ -1353,6 +1353,13 @@ def test_dbus_tdls_invalid(dev, apdev):
|
|||||||
if "InvalidArgs" not in str(e):
|
if "InvalidArgs" not in str(e):
|
||||||
raise Exception("Unexpected error message for invalid TDLSTeardown: " + 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):
|
def test_dbus_tdls(dev, apdev):
|
||||||
"""D-Bus TDLS"""
|
"""D-Bus TDLS"""
|
||||||
(bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
|
(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:
|
if len(addr) > 0:
|
||||||
addr += ':'
|
addr += ':'
|
||||||
addr += '%02x' % ord(p)
|
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',
|
params = { 'Role': 'registrar',
|
||||||
'P2PDeviceAddress': self.peer['DeviceAddress'],
|
'P2PDeviceAddress': self.peer['DeviceAddress'],
|
||||||
'Bssid': self.peer['DeviceAddress'],
|
'Bssid': self.peer['DeviceAddress'],
|
||||||
|
@ -552,6 +552,22 @@ def test_dbus_old_connect_eap(dev, apdev):
|
|||||||
if not t.success():
|
if not t.success():
|
||||||
raise Exception("Expected signals not seen")
|
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):
|
def test_dbus_old_wps_pbc(dev, apdev):
|
||||||
"""The old D-Bus interface and WPS/PBC"""
|
"""The old D-Bus interface and WPS/PBC"""
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user