From 62fbc0a784e1ab4400f662a54b8d3607cfbd5f8f Mon Sep 17 00:00:00 2001 From: Avraham Stern Date: Tue, 10 Jun 2014 20:50:38 +0300 Subject: [PATCH] tests: GO configured preferred channels are disallowed Verify that when all configured preferred channels are disallowed, the GO is instantiated on a random channel. Signed-off-by: Avraham Stern --- tests/hwsim/test_p2p_channel.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py index 58955679d..608b26533 100644 --- a/tests/hwsim/test_p2p_channel.py +++ b/tests/hwsim/test_p2p_channel.py @@ -433,3 +433,17 @@ def test_autogo_random_channel(dev, apdev): dev[0].remove_group(result['ifname']) if i == 20: raise Exception("GO created 20 times and not all social channels were selected. freqs not selected: " + str(list(set(go_freqs) - set(freqs)))) + +def test_p2p_autogo_pref_chan_disallowed(dev, apdev): + """P2P channel selection: GO preferred channels are disallowed""" + try: + dev[0].request("SET p2p_pref_chan 81:1,81:3,81:6,81:9,81:11") + dev[0].request("P2P_SET disallow_freq 2412,2422,2437,2452,2462") + for i in range(0, 5): + res = autogo(dev[0]) + if res['freq'] in [ "2412", "2422", "2437", "2452", "2462" ]: + raise Exception("GO channel is disallowed") + dev[0].remove_group(res['ifname']) + finally: + dev[0].request("P2P_SET disallow_freq ") + dev[0].request("SET p2p_pref_chan ") -- 2.47.2