From patchwork Tue May 17 16:36:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 9114401 Return-Path: X-Original-To: patchwork-fstests@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5E42C9F37F for ; Tue, 17 May 2016 16:36:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 93627202F0 for ; Tue, 17 May 2016 16:36:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7B415201C0 for ; Tue, 17 May 2016 16:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755928AbcEQQg1 (ORCPT ); Tue, 17 May 2016 12:36:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44174 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755838AbcEQQg1 (ORCPT ); Tue, 17 May 2016 12:36:27 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4B0DC05B1E6 for ; Tue, 17 May 2016 16:36:26 +0000 (UTC) Received: from localhost (vpn1-7-167.pek2.redhat.com [10.72.7.167]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u4HGaPRn013128; Tue, 17 May 2016 12:36:26 -0400 From: Zorro Lang To: fstests@vger.kernel.org Cc: Zorro Lang Subject: [PATCH 1/2] common/rc: modify _require_xfs_io_command function Date: Wed, 18 May 2016 00:36:20 +0800 Message-Id: <1463502981-15593-1-git-send-email-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 17 May 2016 16:36:26 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 1. This function try to run $XFS_IO_PROG -c "$command help", that's wrong. It should be "help $command". 2. The $param can't be used for all command's options, for example "help pwrite" include: -Z N -- zeed the random number generator (used when writing randomly) (heh, zorry, the -s/-S arguments were already in use in pwrite) We should make param="-Z N", not only "-Z". After this patch, we can run this function as: _require_xfs_io_command pwrite -Z N Signed-off-by: Zorro Lang --- common/rc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/rc b/common/rc index 51092a0..3b87d7e 100644 --- a/common/rc +++ b/common/rc @@ -1874,7 +1874,8 @@ _require_xfs_io_command() exit 1 fi command=$1 - param=$2 + shift + param="$*" testfile=$TEST_DIR/$$.xfs_io case $command in @@ -1896,7 +1897,7 @@ _require_xfs_io_command() _notrun "xfs_io $command support is missing" ;; *) - testio=`$XFS_IO_PROG -c "$command help" 2>&1` + testio=`$XFS_IO_PROG -c "help $command" 2>&1` esac rm -f $testfile 2>&1 > /dev/null