From patchwork Tue Jun 10 17:50:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilan Peer X-Patchwork-Id: 358122 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 218EC14007B for ; Wed, 11 Jun 2014 04:48:18 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 12AFA9C1AA; Tue, 10 Jun 2014 14:47:58 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sKlXitx3RCgk; Tue, 10 Jun 2014 14:47:57 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9CD5D9D259; Tue, 10 Jun 2014 14:46:47 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 9B6699D259 for ; Tue, 10 Jun 2014 14:46:45 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MH9E+StyxjSZ for ; Tue, 10 Jun 2014 14:46:40 -0400 (EDT) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6908E9C1AA for ; Tue, 10 Jun 2014 14:46:29 -0400 (EDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 10 Jun 2014 11:41:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="4.98,1010,1392192000"; d="scan'208"; a="545850597" Received: from unknown (HELO ipeer-e6430-1.jer.intel.com) ([10.12.217.176]) by fmsmga001.fm.intel.com with ESMTP; 10 Jun 2014 11:46:27 -0700 From: Ilan Peer To: hostap@lists.shmoo.com Subject: [PATCH 06/14] tests: GO negotiation with BSS on a disallowed channel Date: Tue, 10 Jun 2014 20:50:34 +0300 Message-Id: <1402422642-16690-7-git-send-email-ilan.peer@intel.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402422642-16690-1-git-send-email-ilan.peer@intel.com> References: <1402422642-16690-1-git-send-email-ilan.peer@intel.com> Cc: Avraham Stern X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com From: Avraham Stern Verify that when P2P group is formed and a BSS is on a disallowed channel, the group is formed on a different channel than the BSS (both as GO and client). Requires MCC. Signed-off-by: Avraham Stern --- tests/hwsim/test_p2p_channel.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/hwsim/test_p2p_channel.py b/tests/hwsim/test_p2p_channel.py index f8002e7..ceb815d 100644 --- a/tests/hwsim/test_p2p_channel.py +++ b/tests/hwsim/test_p2p_channel.py @@ -254,3 +254,39 @@ def test_autogo_with_bss_on_disallowed_chan(dev, apdev): test_connectivity(dev[0].ifname, apdev[0]['ifname']) finally: dev[0].request("P2P_SET disallow_freq ") + +def test_go_neg_with_bss_on_disallowed_chan(dev, apdev): + """P2P channel selection: GO negotiation with BSS on a disallowed channel""" + + dev[0].request("SET p2p_no_group_iface 0") + + if dev[0].get_mcc() < 2: + logger.info("Skipping test because driver does not support MCC") + return "skip" + try: + hostapd.add_ap(apdev[0]['ifname'], { "ssid": 'bss-2.4ghz', "channel": '1' }) + dev[0].connect("bss-2.4ghz", key_mgmt="NONE", scan_freq="2412") + dev[0].request("P2P_SET disallow_freq 2412") + + #dev[0] as GO + [i_res, r_res] = go_neg_pbc(i_dev=dev[0], i_intent=10, r_dev=dev[1], + r_intent=1) + check_grpform_results(i_res, r_res) + if i_res['role'] != "GO": + raise Exception("GO not selected according to go_intent") + if i_res['freq'] == "2412": + raise Exception("Group formed on a disallowed channel") + test_connectivity(dev[0].ifname, apdev[0]['ifname']) + dev[0].remove_group(i_res['ifname']) + + #dev[0] as client + [i_res2, r_res2] = go_neg_pbc(i_dev=dev[0], i_intent=1, r_dev=dev[1], + r_intent=10) + check_grpform_results(i_res2, r_res2) + if i_res2['role'] != "client": + raise Exception("GO not selected according to go_intent") + if i_res2['freq'] == "2412": + raise Exception("Group formed on a disallowed channel") + test_connectivity(dev[0].ifname, apdev[0]['ifname']) + finally: + dev[0].request("P2P_SET disallow_freq ")