From patchwork Sun Mar 12 22:36:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 737895 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 3vhGBH6D66z9s7C for ; Mon, 13 Mar 2017 09:38:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="c9RmdXkR"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G/F7ucln"; 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=irXsUl5d9r2mWZwZCbaf8rbUeHSAcpwIi02kc2ABbjU=; b=c9RmdXkRS5c8YcueCQX0jjCJAk R2bn7d6pSMrIy3v3fk4VDTwc5d5si4AArQURpbEQFODp8EvoI5hDxUri4XmAfjk6yCDNcm4FCLGQx 6sL5nlwAFBVK2hXCPaw1W1qDdFHkr0TrnkvtStNGAgab/cwnnma8O+Qq91PbznqN/LHj+abHUaDw9 c8nb4jQAi7+LCZkoAtuv8yUIVPOYQ327WUzikyHCKpBF0eCx1WHaB+XUHgGGILmLNw1/Q1dWgTGwW flda2ckC4LmGX/nQ02G3QuiciOUv1WkiB4CoNrbybQjqD40Uv5YIVBLJY2fK/F/IjIPOl6+6HPDY2 CYK4Td4Q==; 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 1cnC8M-0005O7-Pd; Sun, 12 Mar 2017 22:38:38 +0000 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cnC6j-0004QJ-FA for hostap@lists.infradead.org; Sun, 12 Mar 2017 22:37:01 +0000 Received: by mail-pg0-x241.google.com with SMTP id g2so11702368pge.2 for ; Sun, 12 Mar 2017 15:36:36 -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=G2eJITLEJNrZXWBZN0xKbnt2YXHoCqNTOHtb1nyQybo=; b=G/F7uclnA7LNx7/xA9VB6FH9NYda040y4NGEnd5rkHbkvVsMqpBeIfPeG4u4BsdMez Dm3FDiJtSwV01z7R9PYo78OsMEAmkyCJ31RdHhErp2oJArs4DmPvuOpXfNg5Zl2a6+Hv S1Ve6Q1kN0cu7ECfyonHR+wma+wpKVUwQJLXsjBPGA0Qp98jvtOtutyhlPLtLkZR9RGw dzDjzq7qEV9UF232PqYGnV394q7TBkzJALRYbFWBfjCMMOVsEE5QH4H1IKvqJaBz9OHd y5JaennxUGVQlDATZA+A0QlvQAowlrKFFZdjvzFc3xFoQ/PPO8ZzywYnP+5ToOFwQOsQ C39A== 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=G2eJITLEJNrZXWBZN0xKbnt2YXHoCqNTOHtb1nyQybo=; b=aA5ioF46RPkiJQOfDtlz+0yA5N8Jv+q9ByLXc/e7MDESmw6TrXi+JJf1Wvc88DwimI /r5oyGqqX0E/LrcC10DCY1jMU0sMOF18uYp30CXDtj5McNUCXz18HBXZwwTc8jj/tMRh Zg5ptR6BgmpIdefiHUxSWeFwAfaqQaWPp0rBoh0G1Wnom5/1OuhNXQ/Nz3xPlBIf+AoT 8R/9bqjh3yoSJRuRnmVbk9jAmEYJVpE+1y8don50f2xT1GtU9GQpiz+rYq2yu8TY2MaQ +iLu5zCBs3Rt3uwDAu88zeb7bj58tl4VN3fmRzY6jh7rqpeyKb+WFKN4vzY8va3ftGLD ANWw== X-Gm-Message-State: AMke39nG89KJRsvm5eHDSNDIOJNJdnRbvH2tgY+ZPhdZ6oBd8RTGOGexWO+wWE0wjBeBUA== X-Received: by 10.99.64.70 with SMTP id n67mr33104751pga.53.1489358196342; Sun, 12 Mar 2017 15:36:36 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Mar 2017 15:36:35 -0700 (PDT) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH v5 1/4] tests: Extend test_connectivity to check disconnection Date: Mon, 13 Mar 2017 07:36:15 +0900 Message-Id: <1489358178-7729-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1488332457-23457-1-git-send-email-masashi.honma@gmail.com> References: <1488332457-23457-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_153657_568191_310F27A7 X-CRM114-Status: UNSURE ( 9.23 ) 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:241 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 Add success_expected argument to test_connectivity because the function is expected to fail on some test cases. Signed-off-by: Masashi Honma --- tests/hwsim/hwsim_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/hwsim_utils.py b/tests/hwsim/hwsim_utils.py index c74af2f..535220d 100644 --- a/tests/hwsim/hwsim_utils.py +++ b/tests/hwsim/hwsim_utils.py @@ -141,7 +141,7 @@ def run_connectivity_test(dev1, dev2, tos, dev1group=False, dev2group=False, def test_connectivity(dev1, dev2, dscp=None, tos=None, max_tries=1, dev1group=False, dev2group=False, ifname1=None, ifname2=None, config=True, timeout=5, - multicast_to_unicast=False): + multicast_to_unicast=False, success_expected=True): if dscp: tos = dscp << 2 if not tos: @@ -161,7 +161,9 @@ def test_connectivity(dev1, dev2, dscp=None, tos=None, max_tries=1, last_err = e if i + 1 < max_tries: time.sleep(1) - if not success: + if success_expected and not success: + raise Exception(last_err) + if not success_expected and success: raise Exception(last_err) def test_connectivity_iface(dev1, dev2, ifname, dscp=None, tos=None,