From patchwork Mon Sep 5 14:33:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Otcheretianski X-Patchwork-Id: 665865 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sSXL41603z9s9Y for ; Tue, 6 Sep 2016 00:34:20 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bguyK-0007mQ-7Z; Mon, 05 Sep 2016 14:34:04 +0000 Received: from mga04.intel.com ([192.55.52.120]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bguy1-0007Uk-0I for hostap@lists.infradead.org; Mon, 05 Sep 2016 14:33:48 +0000 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP; 05 Sep 2016 07:33:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,286,1470726000"; d="scan'208";a="4899693" Received: from unknown (HELO TEMPHOSTNAME.ger.corp.intel.com) ([10.12.217.205]) by orsmga005.jf.intel.com with ESMTP; 05 Sep 2016 07:33:30 -0700 From: andrei.otcheretianski@intel.com To: hostap@lists.infradead.org Subject: [PATCH 13/18] tests: Fix p2p_ext_vendor_elem_assoc test Date: Mon, 5 Sep 2016 17:33:06 +0300 Message-Id: <1473085991-5073-13-git-send-email-andrei.otcheretianski@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1473085991-5073-1-git-send-email-andrei.otcheretianski@intel.com> References: <1473085991-5073-1-git-send-email-andrei.otcheretianski@intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160905_073345_307332_59D5A3D1 X-CRM114-Status: UNSURE ( 9.93 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [192.55.52.120 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [192.55.52.120 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Avraham Stern MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Avraham Stern For configurations that use a dedicated P2P Device interafce, which mandates that a separate interface is used for the P2P group, vendor specific IE's must be added to the VENDOR_ELEM_P2P_* frame type in order to be used by the P2P group interface. So in case a dedicated P2P Device interface is used, don't add the IE that is added to association request but not to P2P association request because it is not expected to be added by the P2P group interface. Signed-off-by: Avraham Stern --- tests/hwsim/test_p2p_ext.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_p2p_ext.py b/tests/hwsim/test_p2p_ext.py index 9d2d569..82b7658 100644 --- a/tests/hwsim/test_p2p_ext.py +++ b/tests/hwsim/test_p2p_ext.py @@ -336,11 +336,15 @@ def test_p2p_ext_vendor_elem_assoc(dev, apdev, params): def _test_p2p_ext_vendor_elem_assoc(dev, apdev, params): addr0 = dev[0].p2p_dev_addr() addr1 = dev[1].p2p_dev_addr() + + res = dev[0].get_driver_status() + p2p_device = True if (int(res['capa.flags'], 0) & 0x20000000) else False + if "OK" not in dev[0].request("VENDOR_ELEM_ADD 11 dd050011223308"): raise Exception("VENDOR_ELEM_ADD failed") if "OK" not in dev[1].request("VENDOR_ELEM_ADD 12 dd050011223309"): raise Exception("VENDOR_ELEM_ADD failed") - if "OK" not in dev[0].request("VENDOR_ELEM_ADD 13 dd05001122330a"): + if not p2p_device and "OK" not in dev[0].request("VENDOR_ELEM_ADD 13 dd05001122330a"): raise Exception("VENDOR_ELEM_ADD failed") dev[0].p2p_listen() dev[1].p2p_listen() @@ -355,7 +359,7 @@ def _test_p2p_ext_vendor_elem_assoc(dev, apdev, params): "wlan.fc.type_subtype == 0x00", wait=False) if "Vendor Specific Data: 3308" not in out: raise Exception("Vendor element (P2P) not found from Association Request frame") - if "Vendor Specific Data: 330a" not in out: + if not p2p_device and "Vendor Specific Data: 330a" not in out: raise Exception("Vendor element (non-P2P) not found from Association Request frame") out = run_tshark(os.path.join(params['logdir'], "hwsim0.pcapng"),