From patchwork Sun Mar 12 22:36:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 737896 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vhGBS62gWz9s75 for ; Mon, 13 Mar 2017 09:38:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NLtNiJRg"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C0Fli5QC"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Mta7GNryX0KyvDLEmnNiUc09/lE1bIIloogdIosaops=; b=NLtNiJRgPf0ypSMhkXQUtn9fG1 MxuGeuPK2IePMCsBSw/fojn+SrkGoBfSLsrGdHlLiIFgcihd73i+5j6PurcyLQqronWR2F0VPpCM4 hnZQP3hkh+T9l1c8jy7anPJVM9bzmv5bHMOAPJPY7siGacBzPYMkDSF8Kc6fcN0SpmBEJA5EhQ7PP b8azTb7i7rW7Tb9ZweGjraprci7DPrGEhONpsl5741+Mz5/y65lXs/wn7nY5sZE4qij5QzLBbxyQR iOBHrIEqgf9I2VPA9yTHCfuH88TXApmAo9r5+bgYgW7kYw08gVAJu3ndKqGYjrTdHsLutxJBdmyMx K+hBdf6w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cnC7x-00056K-Pw; Sun, 12 Mar 2017 22:38:13 +0000 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cnC6k-0004QR-Ni for hostap@lists.infradead.org; Sun, 12 Mar 2017 22:37:00 +0000 Received: by mail-pg0-x242.google.com with SMTP id 77so16148621pgc.0 for ; Sun, 12 Mar 2017 15:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7GGWjVDxSiuUFaRnlfSSNhMELDrCTtMROH3tYjWYTjc=; b=C0Fli5QCF/LPsnBlemo/9Ko/HVPm+KfJYv4Oh4XznkTnYWftCFDfBdXKppcJ/xWkZi Tx7aULba9ISetgjojvnex65/48paTFAoTliOt0Twje68gXd5GVmGsYyLnkZPV9VOfIPn jA6UFdBwIVQ2XLsw7iZz3D1SPVTX1exTfXbPomqSA+QiRzrLGm6Wq0NeCcdgVmniiCaM 0TKc/RdG4Pnb6VbPYcA1CxhwS30YjsNDx4LfVhLn5exCP/LbLXD4lMt+3L7iAQaouvP6 fCGQ20lEIBRtbfuzrHyAVbgnX4SIlFl2QTJaSztcKyrjjIxG8spnnFgv2VYNJQhCCYhl Q0bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7GGWjVDxSiuUFaRnlfSSNhMELDrCTtMROH3tYjWYTjc=; b=KHYoPq+0MZ+nwWYgyM45XubBi8UHtAopeaC7jzoiHVJ6ix6zIIHZvx+Pvjf2uzBUlg p+bZL1kWfPBQTcVdavRgmWTS15GFE27wyUlz+rJNOmqm9xxD1EFzAomoVXcGWDm/ijKG UfqYBlGjIIyXC2xHbX+wqsWDxG6en5cuPsO/K2vGrxflji+hBb5tdt8XBDw+SPs7WTHC WjZeeeoQ/GOaMgCh0qEh8q/tf5ZkswsglpfqQrB/LNb/WlX16wS5/OZ8h6GcPgLPnQo+ aXAHNKGcPQ4JlL/9zpy7Lg5EFOu7mJORmx5JLo1oJqwbxDVyYmxO98Hemj37MIZ5dZAd T5MQ== X-Gm-Message-State: AMke39lCRcquhpkNdSxTdu9SggA5w2rs0BTWWsuOqDV0mASplMIY+kBlpDDePB+OHyeqdQ== X-Received: by 10.84.232.198 with SMTP id x6mr42556380plm.74.1489358198009; Sun, 12 Mar 2017 15:36:38 -0700 (PDT) Received: from localhost.localdomain (p6e1217.kngwnt01.ap.so-net.ne.jp. [218.110.18.23]) by smtp.gmail.com with ESMTPSA id s65sm29902638pgb.64.2017.03.12.15.36.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Mar 2017 15:36:37 -0700 (PDT) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH v5 2/4] tests: Check wmediumd version Date: Mon, 13 Mar 2017 07:36:16 +0900 Message-Id: <1489358178-7729-2-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489358178-7729-1-git-send-email-masashi.honma@gmail.com> References: <1488332457-23457-1-git-send-email-masashi.honma@gmail.com> <1489358178-7729-1-git-send-email-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170312_153658_804624_6B54B335 X-CRM114-Status: UNSURE ( 7.47 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c05:0:0:0:242 listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: j@w1.fi, Masashi Honma , me@bobcopeland.com MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Some wmediumd tests requires new wmediumd features. Modified SNR table, location-based config and log levels. The wmediumd 0.2 does not have these features, so skip such a tests. Signed-off-by: Masashi Honma --- tests/hwsim/test_wmediumd.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/hwsim/test_wmediumd.py b/tests/hwsim/test_wmediumd.py index 9da54d3..6678dbb 100644 --- a/tests/hwsim/test_wmediumd.py +++ b/tests/hwsim/test_wmediumd.py @@ -11,6 +11,9 @@ from test_wpas_mesh import check_mesh_support, check_mesh_group_added from test_wpas_mesh import check_mesh_peer_connected, add_open_mesh_network from test_wpas_mesh import check_mesh_group_removed +class LocalVariables: + revs = [] + CFG = """ ifaces : { @@ -34,6 +37,32 @@ ifaces : }; """ +def get_wmediumd_version(): + if len(LocalVariables.revs) > 0: + return LocalVariables.revs; + + try: + verstr = subprocess.check_output(['wmediumd', '-V']) + except OSError, e: + if e.errno == errno.ENOENT: + raise HwsimSkip('wmediumd not available') + raise + + vernum = verstr.split(' ')[1][1:] + LocalVariables.revs = vernum.split('.') + for i in range(0, len(LocalVariables.revs)): + LocalVariables.revs[i] = int(LocalVariables.revs[i]) + while len(LocalVariables.revs) < 3: + LocalVariables.revs += [0] + + return LocalVariables.revs; + +def require_wmediumd_version_more_than(major, minor, patch): + revs = get_wmediumd_version() + if revs[0] < major or revs[1] < minor or revs[2] < patch: + raise HwsimSkip('wmediumd v%s.%s.%s is old for this test' % + (revs[0], revs[1], revs[2])) + def output_wmediumd_log(p, params, data): log_file = open(os.path.abspath(os.path.join(params['logdir'], 'wmediumd.log')), 'a') @@ -93,6 +122,7 @@ def test_wmediumd_path_simple(dev, apdev, params): # | | # +-----X-----+ # This tests if 1 and 2 can communicate each other via 0. + require_wmediumd_version_more_than(0, 3, 0) fd, fn = tempfile.mkstemp() try: f = os.fdopen(fd, 'w')