tests: Fix dbus_interface to restore P2P channel list to default

It was possible for the dbus_interface test case to leave the P2P
channel lists with 5 GHz channels enabled due to the special driver=none
case. This could make the following P2P test case fail due to selecting
an unexpected channel. Fix this by forcing P2P channel list update at
the end of the dbus_interface test case.

This was triggering with the following hwsim test case sequence:
dbus_interface p2ps_connect_adv_go_p2ps_method_group_iface.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
master
Jouni Malinen 9 years ago committed by Jouni Malinen
parent a8412ec9d0
commit 7966674d73

@ -1682,6 +1682,24 @@ def test_dbus_network_oom(dev, apdev):
def test_dbus_interface(dev, apdev):
"""D-Bus CreateInterface/GetInterface/RemoveInterface parameters and error cases"""
try:
_test_dbus_interface(dev, apdev)
finally:
# Need to force P2P channel list update since the 'lo' interface
# with driver=none ends up configuring default dualband channels.
dev[0].request("SET country US")
ev = dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=1)
if ev is None:
ev = dev[0].wait_global_event(["CTRL-EVENT-REGDOM-CHANGE"],
timeout=1)
dev[0].request("SET country 00")
ev = dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=1)
if ev is None:
ev = dev[0].wait_global_event(["CTRL-EVENT-REGDOM-CHANGE"],
timeout=1)
subprocess.call(['iw', 'reg', 'set', '00'])
def _test_dbus_interface(dev, apdev):
(bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])
wpas = dbus.Interface(wpas_obj, WPAS_DBUS_SERVICE)

Loading…
Cancel
Save