From f0b39e057a4e1fea488f5fb1a6bfb9e3658b7c56 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 27 Nov 2015 19:24:33 +0200 Subject: [PATCH] tests: Convert p2p_go_move_scm_peer_supports to use dynamic hwsim Use a dynamically added HWSimRadio to allow the MCC case to be covered with a single test run with the mac80211_hwsim default radios disabling MCC. In addition, remove dependency on --long since this test case does not really take that long (just couple of seconds). Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_channel.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py index 8b3f72e29..2ef0f5e88 100644 --- a/tests/hwsim/test_p2p_channel.py +++ b/tests/hwsim/test_p2p_channel.py @@ -804,14 +804,19 @@ def _test_p2p_go_move_scm(dev, apdev): dev[0].global_request("P2P_SET disallow_freq ") dev[0].global_request("SET p2p_go_freq_change_policy 2") -def test_p2p_go_move_scm_peer_supports(dev, apdev, params): - """P2P GO move due to SCM operation preference (peer supports) [long]""" - if dev[0].get_mcc() <= 1: - raise HwsimSkip("Skip due to MCC not being enabled") +def test_p2p_go_move_scm_peer_supports(dev, apdev): + """P2P GO move due to SCM operation preference (peer supports)""" + with HWSimRadio(n_channels=2) as (radio, iface): + wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5') + wpas.interface_add(iface) - if not params['long']: - raise HwsimSkip("Skip test case with long duration due to --long not specified") + if wpas.get_mcc() < 2: + raise Exception("New radio does not support MCC") + ndev = [ wpas, dev[1] ] + _test_p2p_go_move_scm_peer_supports(ndev, apdev) + +def _test_p2p_go_move_scm_peer_supports(dev, apdev): try: dev[0].global_request("SET p2p_go_freq_change_policy 1") set_country("US", dev[0])