Message ID | bfc91ba98e593a46c7b9b4f7a0f7839fb1ab062f.1530319109.git.petrm@mellanox.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <linux-kselftest-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3ECFC602CC for <patchwork-linux-kselftest@patchwork.kernel.org>; Sat, 30 Jun 2018 00:46:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 21BDF28D8E for <patchwork-linux-kselftest@patchwork.kernel.org>; Sat, 30 Jun 2018 00:46:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11E5828E03; Sat, 30 Jun 2018 00:46:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B58928D8E for <patchwork-linux-kselftest@patchwork.kernel.org>; Sat, 30 Jun 2018 00:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935792AbeF3AqJ (ORCPT <rfc822;patchwork-linux-kselftest@patchwork.kernel.org>); Fri, 29 Jun 2018 20:46:09 -0400 Received: from mail-db5eur01on0056.outbound.protection.outlook.com ([104.47.2.56]:27184 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934248AbeF3AqH (ORCPT <rfc822; linux-kselftest@vger.kernel.org>); Fri, 29 Jun 2018 20:46:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EV+jpVU2T0fw7g6RKiQ+7z84BZo/UDoKlUzfz010EFI=; b=tJkTT7R/H/p4QNcBdFx8NC6K8AVRs9SPHXSlbNTqfaNh8vq7FcxtcIfhb4GaZkhN6f8Hl+0kppgWzBFFl3QMIQvmH86t2Nje6CQJT7h9FS6cferJU8hMSY8cjDup9y1LJFOhiFGYKfajvHTJG/8Z9dJ0EUiyShtLSOMs96dsJ0E= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.176.83.59) by VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Sat, 30 Jun 2018 00:46:04 +0000 From: Petr Machata <petrm@mellanox.com> To: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: jiri@mellanox.com, idosch@mellanox.com, shuah@kernel.org, davem@davemloft.net Subject: [PATCH net-next 02/13] selftests: forwarding: lib: Add check_err_fail() In-Reply-To: <cover.1530319109.git.petrm@mellanox.com> References: <cover.1530319109.git.petrm@mellanox.com> Message-Id: <bfc91ba98e593a46c7b9b4f7a0f7839fb1ab062f.1530319109.git.petrm@mellanox.com> Date: Sat, 30 Jun 2018 02:45:47 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [89.176.83.59] X-ClientProxiedBy: HE1PR05CA0367.eurprd05.prod.outlook.com (2603:10a6:7:94::26) To VI1PR05MB4191.eurprd05.prod.outlook.com (2603:10a6:803:4e::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eee786e5-cc5b-433b-ceaa-08d5de22dc6b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(48565401081)(5600052)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:VI1PR05MB4191; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 3:2b+lGLRkhYirPBEyUXaA2wxiB18W3nH75UihQALyC0uNs2pu27WRke4CqSVAeEARTK1tbDl3kXxlLB5rjWM/9rgcDToAIrrkEnt8VJsTXENEM6tOh9f+4eHeHeB7Q8m4LorwSVylXWXZwVUhtqNBbsuMcVclcGG/rOQrFJuovLsC2+yWO8bZwAhEzlUXjlDVYb5FAMqzWl+IsSdjl1W1RKwWOjYHTMuw4AbLw3UF9k86Q/pauuAzbzEMbuNJ0Oag; 25:d8IWWrcV37pb0iJNUBen876ce7YZRsnpJOwBHYBeU2B3SbKS1in7yQOBfrA0WDZOG2CTAsv6s/cQhS6uip73rZqYZCAneBqH+Q6joSHCwJv8qLGWF9uOZDWhOrx03fFC9i+boZetq8bRdewVi1JB68Rgh66h1FTMmL6njNvXTPR/CUvLYKal4cF7ePqA+ImnbHxTr54Ps1TttHcnWDqiaf+8t7yDQIBrZJD3l4/1HOshT9B3txH9kA6LJBJTIHdjllq9/iqyjnMeFu4xuIDJpOLtGUriWtfT1siv4kJ5ezrJrIFZLHSlVJzfKsgXoKcw1fDvHPnSWw8ru04kDMI9dQ==; 31:jAnjK6qqjsKkpV3oxRHu1HJyoC60oguTtDdyqjaCmyYZtMyn0hBiQlQt1YbWXfZdhMRFPPofGoAgwzAzRpNTD2/BV51ki8uWB0s2MLoVKtUQqE+0XJDKagP8CUmcvejTmG1MTs06zX/ndcwWKCxtURHV9ofktRl5Zu00BKNi5GWzSR6lceU58X1kipO7o2ZojIIKaAz/KaT5pqxcbe0GsnyGqiTQq2dBUcEKzpkj+wc= X-MS-TrafficTypeDiagnostic: VI1PR05MB4191: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 20:aQhzVVE27qN8Wh9GrCqu36hXDRl0oym08agjlRnl0E8tUlqI5LLuZ9TVsj8hr1t1xi6Q/hize75hRqGQPr6YVdHDnhkbxWDIFwRPN9F4RNGXuSg4V2YYta1hOr1zrtlR86LKsbMht5mFrsNpNONvPC4wnJ5nbKGACbOMjAWFVKDsqlQ54GdJskD5740If8jk254TKNecI2Yvnk+aDAdtXRLBPJi4BKJDUEJtCpDugqpJxnyxEOoMZHzHlguwiS4RhyPLSS/dwgvyffDE9ACNZJh7faNUhAQ3YBvWPC6BmE4bSmFE23WgRFZFUeM/79/nEYn4+iePUkiYtFKVZQCUoR0Gig2UANbB9Im5vCC2UyfYqKpLKen0ZbOlhe1Lu4fkDXMbOHDJJzu5azNAAzc+FjDZdLOeCzPSUksyfQLOSMa3P0ugqgEH5r8gyZOoO7A+ekTQJ70pNJU15PSaCk2ijFHewpzChIGK6nq6hGVCO6F2F9ub490/xGp/WKmMAoIT; 4:H4xTA2KJznV6a1soystzq+xeiNLdtWOjluGS02r3qfZD48nOhfqDsloeCYLsxJ/9Rlt/a/L46zkHj7lEdUv0EVL4G91JhJGqRGJ+MQxWj2y/PqtaLXs9LCG9bBNN5yYCCzkML68E1Mshu8SM3UdwFfK7gUgaPHtxaqndVbTNIIqWXOXZv9HwLIn2/ttzCtM+RWsflrcYyrlsni02Py9WGjEaWSd3sw4RYfv2yoohONxIdQNiOrV6cQjT0EIMu5Nz0R/jxjIS7iyKoG0wuOf2OQ== X-Microsoft-Antispam-PRVS: <VI1PR05MB41912E569F13397A23729719DB4D0@VI1PR05MB4191.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:VI1PR05MB4191; BCL:0; PCL:0; RULEID:; SRVR:VI1PR05MB4191; X-Forefront-PRVS: 0719EC6A9A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(136003)(396003)(39860400002)(366004)(346002)(376002)(199004)(189003)(50466002)(386003)(6666003)(316002)(25786009)(81166006)(8936002)(305945005)(58126008)(8676002)(81156014)(7736002)(16586007)(106356001)(26005)(16526019)(186003)(105586002)(97736004)(3846002)(52116002)(76176011)(47776003)(66066001)(53936002)(68736007)(2616005)(956004)(486006)(476003)(86362001)(478600001)(6496006)(2906002)(6116002)(6486002)(51416003)(118296001)(48376002)(36756003)(446003)(5660300001)(4326008)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4191; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR05MB4191; 23:e2hFrvhYuoETEb2+WKv8l71inXUKj+ewmWvkRoA0t?= =?us-ascii?Q?Wj2Lu9psSzWcx8KkXSVZEx0piM98GnghBXNE1E1rAdHnNyXeWJgyZ0PYPjLA?= =?us-ascii?Q?UTqUd6mw7mhPnNmZTre45nhe2bXpaXJIYAlphmB0/N3R//9AdR4ntMSKF8b3?= =?us-ascii?Q?twxflHTRrtUHgZq+PZrq8EZKHzIOqpquaktCLX8PgvK062GEtCaInxVXHWqq?= =?us-ascii?Q?z0OyyzrJJwbcAIX6q+Egfak6dwhEBoTDkgYY+YiIcilclBdeIj/Rbhv18Jki?= =?us-ascii?Q?+aLLT/hit/uAvACKwjOHChJ0YmhK+UyWnnQIgRaTqYrJFKETJIqSNRxG9FMU?= =?us-ascii?Q?JWlxTdFN7alwdMB3OkeuPiteNnVnxQWpsajcVzXb338i9n5T+LpYrw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ticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB4191; 7:zYhmbl3q+JWDof2OpRw5lgljtl/0cqYGArPvTXc2getbwx4VzF2ARxVoxEt+EXi73Z9/gWZHsIfqnOmqpTFJBHwfsMejTP9nOQbseYOMUe3xsv/oltBdc3Mv+nMxqLiqg3u/8IeKZF7KWPUOUvG8aBTjmG8T6XjygNFySgalcd1VkPyV/mtDVqtnMzsKvUO4vjPLTwFvKiORSFgWCZB2EJrtQbBe/JMhuvD7ff1ukCXW0U2eP9kM+PkkUUrOLrGY X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2018 00:46:04.1256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eee786e5-cc5b-433b-ceaa-08d5de22dc6b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4191 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: <linux-kselftest.vger.kernel.org> X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/tools/testing/selftests/net/forwarding/lib.sh b/tools/testing/selftests/net/forwarding/lib.sh index 59272824ef37..5f4b7ed2c65a 100644 --- a/tools/testing/selftests/net/forwarding/lib.sh +++ b/tools/testing/selftests/net/forwarding/lib.sh @@ -156,6 +156,19 @@ check_fail() fi } +check_err_fail() +{ + local should_fail=$1; shift + local err=$1; shift + local what=$1; shift + + if ((should_fail)); then + check_fail $err "$what succeeded, but should have failed" + else + check_err $err "$what failed" + fi +} + log_test() { local test_name=$1