From patchwork Tue Mar 21 01:50:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 741377 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 3vnG4k1FZVz9rxm for ; Tue, 21 Mar 2017 12:51:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BCEdcxdb"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qNCNGDrK"; 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=tZFXSn3v0Xdt1MfcKYca63d2sRn5n6+x0jGhkUIUFjY=; b=BCEdcxdbqg4YpqsT4uuRPYn3MR z9iAojNF6mvd7GDUP3JnuWZmeRKB2qPelh0tklZIaR4uYfWXNgW1lL6MFvM9T16uLeByhUU2hYcAW 6b1eCj21ufLuEc4QErLysSjk/GUzgX0/ku5XNQ+Hm17rrPlvkSRomNp9FHU4k7akykBTW/fObcuas ikLDBEHx3vAwGmD7LP+kEoUZR8LIFZunKPgg6PTNqWXKokBMdCe9zozGwhk20+wWzWlooUju2rg/1 4LQDCgZyYRaonYkLrBtUgCqTy2Yswc36yrPs0ArCT+8fHDSPNIvEiUTYpAV2CFwR3SVH4C3YpqeAR zP71jp4Q==; 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 1cq8xA-00007i-Ca; Tue, 21 Mar 2017 01:51:16 +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 1cq8x1-0008Pb-Lr for hostap@lists.infradead.org; Tue, 21 Mar 2017 01:51:09 +0000 Received: by mail-pg0-x242.google.com with SMTP id 81so14692362pgh.3 for ; Mon, 20 Mar 2017 18:50:46 -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=I7Paw1xgV20BnBmBmvmKiKC0vI9uer5d5bEnhheX0/w=; b=qNCNGDrKlnFhaOhGGK2+4CNVkc35OMd9zfUfWsmB0gNVa86+z5CP88J2RgdvxlKFSH 7Vv4h2cpjpWpHqBXmF/hoeqWeEXIHWAGVMi4rnwpGvSNXPRTbcy6C3irqs6P6jgX+4Ab 6W40SBPCJ1g881T19wPvwcHVBrFM/yiG2BI8SjTDIQ9HM7ux3xhF44gi0uP++KCG+GgG 74yfPHO2Y2RqOjrBlrPSRCznTitgawmvG2ozAwY1rhPFYeVlsjK8hMG8nChNaMip8Qu/ K/3z4c1r1uEJNvXi+61rCJHrG3Ei0RXlFuugCeFvv9AWb1sSROIyKPfCiFMixNCbFa44 VsQg== 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=I7Paw1xgV20BnBmBmvmKiKC0vI9uer5d5bEnhheX0/w=; b=p8ZHvGSX9AJVeua6RFR9k99di3YLXGvLauziOg/HcXkw50q8xW7M2RERGnKaVGIYN9 E0nDxKmqXUxD8sMitJEdn3dVwRUiYiQED/ObMamZJ6h4O6ZDQL4ShTehJOgYi1P7bpIf zakrJizpeGXyrndO8Ii9/IrUd/3+mHOZpO54TLNCvZdpuvStG+0RJm4nmBRGj5MBgFja dwoVJBrrnTQS3Rfv73TShFp/eCxgabKzUMLBAQ4PNfq4f/HIwcUb0tbDpm3QSgWjI38M k5ReEuTgdpeu0gIYlCbXyjjZ+UwYqu2pMFYngtvZAOwYlRQpQp2fkfhRmRcMaYbptTWk PSWA== X-Gm-Message-State: AFeK/H1+Us6Yj4hS8iC6ktbNLakDPxRglM+j5zUvJCBPwtcjO933lPn0I83VlN+DotEYZg== X-Received: by 10.99.211.21 with SMTP id b21mr34804949pgg.166.1490061046467; Mon, 20 Mar 2017 18:50:46 -0700 (PDT) Received: from localhost.localdomain (p6e1217.kngwnt01.ap.so-net.ne.jp. [218.110.18.23]) by smtp.gmail.com with ESMTPSA id m3sm35522348pfc.66.2017.03.20.18.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 Mar 2017 18:50:45 -0700 (PDT) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH v6 2/4] tests: Check wmediumd version Date: Tue, 21 Mar 2017 10:50:31 +0900 Message-Id: <1490061033-8462-2-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490061033-8462-1-git-send-email-masashi.honma@gmail.com> References: <1488332457-23457-1-git-send-email-masashi.honma@gmail.com> <1490061033-8462-1-git-send-email-masashi.honma@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170320_185107_824312_14BE5263 X-CRM114-Status: UNSURE ( 7.39 ) 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 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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..64c28cf 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, 1) fd, fn = tempfile.mkstemp() try: f = os.fdopen(fd, 'w')