From patchwork Wed Aug 30 14:51:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amir Goldstein X-Patchwork-Id: 9929887 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 6BE6960383 for ; Wed, 30 Aug 2017 14:51:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D5E928691 for ; Wed, 30 Aug 2017 14:51:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51F6B286AB; Wed, 30 Aug 2017 14:51:57 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 0170E28691 for ; Wed, 30 Aug 2017 14:51:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751774AbdH3Ov0 (ORCPT ); Wed, 30 Aug 2017 10:51:26 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:35689 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751759AbdH3OvY (ORCPT ); Wed, 30 Aug 2017 10:51:24 -0400 Received: by mail-wm0-f65.google.com with SMTP id e204so2056831wma.2; Wed, 30 Aug 2017 07:51:23 -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=DFbBWE9rUM0nJAFhLUTZeWsskAi65hN5ypmv2HoUOUCVjUsLK3tDNyHhZ+7YStsfvw aWN7gdwqjCiikQ0v3Jo0AN17voym1s/rk6pA7p8QBOuNZB0z/obhlfOhzEstxdG27Bs7 zgG6gXVrf6d+OQYYw/1UQxmQMiYR55I9Edju8m487nyd0QZd6v90fs+O2SSc4UL49uPZ n1/CJlBPjQcoC1DYto3Q2Zk63zAbQEL2kmnnXn/h7C5mRJ32yFRxRbXLTTYUB3T+ZCQe 7JNuBumH0IxIN8lyhjYr/7FrtGaJ3ljrBQ4YnGAbO8z+CmYKzSc5Nzj+EvC2W2GuQxtu jS0w== 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=Psglzm62QvQRhVKmLRyoJcU4+lp6CtCDGdGiJ8fC2W0L/zh3eaJfBKULSW7FmiTiyk AjV5KsHxXCguTBeoM5X4iYbGrVrd69Vel4xv89Je33SVppmsyh89ZlzafvDJ/KvO06/u esUjalmw3CV7QrBfaeYcAFr9NAvJWkso/jE8HsuNUBecsCOuiAIuHT4FR5Vu8AiKaaBy L+a+lFb7Q31WTjZHDqVfZiSktvCKEV5s+OPjOYhDa2jk6Z4rTL2AXW2Cm87dy8j0EnrA /mzpjEl7viurTNmsPaepvsog2EDtsJcDI6WZpazOQxKmwK7+ftMLALwe5YoxI1jhKNyw 7BjQ== X-Gm-Message-State: AHYfb5hbnpxbVoPkjsa902bixQx/TtenzPstYDgRUGWufupg/rhiCTNU Byz+71Ant9kR2g== X-Received: by 10.28.238.197 with SMTP id j66mr1341070wmi.170.1504104683119; Wed, 30 Aug 2017 07:51:23 -0700 (PDT) Received: from localhost.localdomain (bzq-166-168-31-246.red.bezeqint.net. [31.168.166.246]) by smtp.gmail.com with ESMTPSA id f42sm2606306wrf.27.2017.08.30.07.51.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 07:51:22 -0700 (PDT) From: Amir Goldstein To: Eryu Guan Cc: Josef Bacik , "Darrick J . Wong" , Christoph Hellwig , fstests@vger.kernel.org, linux-xfs@vger.kernel.org Subject: [PATCH v2 02/14] common/rc: fix _require_xfs_io_command params check Date: Wed, 30 Aug 2017 17:51:34 +0300 Message-Id: <1504104706-11965-3-git-send-email-amir73il@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504104706-11965-1-git-send-email-amir73il@gmail.com> References: <1504104706-11965-1-git-send-email-amir73il@gmail.com> Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@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 Reviewed-by: Darrick J. Wong --- 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 }