From patchwork Wed Aug 23 15:49:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9917649 Return-Path: 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 546B6603FA for ; Wed, 23 Aug 2017 15:48:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4717C281C3 for ; Wed, 23 Aug 2017 15:48:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3BCD42846D; Wed, 23 Aug 2017 15:48:58 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 F092E281C3 for ; Wed, 23 Aug 2017 15:48:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932251AbdHWPsz (ORCPT ); Wed, 23 Aug 2017 11:48:55 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:37415 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932100AbdHWPsw (ORCPT ); Wed, 23 Aug 2017 11:48:52 -0400 Received: by mail-wm0-f65.google.com with SMTP id t138so506227wmt.4; Wed, 23 Aug 2017 08:48:51 -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=hIQkygpE7vTExLoFzJrgjK91AdNY7aYKHnCyVZorj6k=; b=rtw+8lCWPbFe20CDaRXofJdFblPf+yBmDoFNlbexBJDy/4f9jm+Vyb5KUcRDeAyVhk jg64P3EaalZvWEgxZQvzrMrXvaYhom727YjYQIVAG+4y2XCK82QM+Y6g/H7klsevmiWH S4kyK08J5HwqgAYUGyMQcWY5HSoFGi4N4L8TOKWYGv92s+Xwx0Pw+tuh1+m2OrOOPJyD DsDvgUW5KefGmEMIA19101Oe7vmjCVIWZK3XtlhNHnH5u4TOaBrvaV99tr1Hi2ZFTTgd FPCK9pygXzorDEzh52sebXxeKY3FvjjTsNw8k4Gc9ASkWxT2zTEOfEWcmH7kYSaJjcVz r+oA== 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=hIQkygpE7vTExLoFzJrgjK91AdNY7aYKHnCyVZorj6k=; b=cndzhJcgpMe/3GYaJACZFjzeM/ZV5M9X/RKIkbVH2DNoXjVJZpEWcQTzhi5sBo6XyD qr5PHnXWzUqP6SIjTbHmXlB/sSAJHXeo2qIRVXtfbgVHysdxNdxOuS7GV/mihbn5nEar qmNExc5Hm3IANTlOQz3O3Tnjx2dt4g2iYsDlwE2PT3rK0m2ocm+224KCqcswN/1uHJN7 OuPt1RjhV02gLQlG18AO4JkIf1HfeLNDYT7C41tn1SLzq+gXtihyM4ybNw8sIl94RpFm KCKOOj1l43WdRqXGEDl0Bd4LvgnG1qmUO7qnzWdp7n5wv2U9/1uDhZCrTsILvF8j23qz 8hTQ== X-Gm-Message-State: AHYfb5jZnltDRISS2G23K65ZKmFZmmJIEBadwAo6ID4Zpji2P6nkWiJg R2uj/d5RZHaJzQ== X-Received: by 10.28.33.85 with SMTP id h82mr2380686wmh.18.1503503331274; Wed, 23 Aug 2017 08:48:51 -0700 (PDT) Received: from localhost.localdomain (bzq-79-182-137-119.red.bezeqint.net. [79.182.137.119]) by smtp.gmail.com with ESMTPSA id a6sm1938879wrh.51.2017.08.23.08.48.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 23 Aug 2017 08:48:50 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Josef Bacik , Christoph Hellwig , fstests@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [RFC][PATCH 2/8] common/rc: fix _require_xfs_io_command params check Date: Wed, 23 Aug 2017 18:49:11 +0300 Message-Id: <1503503357-26234-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503503357-26234-1-git-send-email-amir73il@gmail.com> References: <1503503357-26234-1-git-send-email-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When _require_xfs_io_command is passed command parameters, the resulting error from invalid parameters may be ignored. For example, the following bogus params would not abort the test: _require_xfs_io_command "falloc" "-X" _require_xfs_io_command "fiemap" "-X" Fix this by looking for the relevant error message. Signed-off-by: Amir Goldstein --- common/rc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 9d7b783..44b98f6 100644 --- a/common/rc +++ b/common/rc @@ -2212,9 +2212,14 @@ _require_xfs_io_command() echo $testio | grep -q "Function not implemented" && \ _notrun "xfs_io $command support is missing (missing syscall?)" - if [ -n "$param" -a $param_checked -eq 0 ]; then + [ -n "$param" ] || return + + if [ $param_checked -eq 0 ]; then $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \ _notrun "xfs_io $command doesn't support $param" + else + echo $testio | grep -q "invalid option" && \ + _notrun "xfs_io $command doesn't support $param" fi }