From patchwork Tue Jun 5 16:43:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 10448633 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 C9F8460234 for ; Tue, 5 Jun 2018 16:43:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB0C81FFEB for ; Tue, 5 Jun 2018 16:43:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B00622901C; Tue, 5 Jun 2018 16:43:40 +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, UNPARSEABLE_RELAY 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 2B4C31FFEB for ; Tue, 5 Jun 2018 16:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751902AbeFEQnj (ORCPT ); Tue, 5 Jun 2018 12:43:39 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:49070 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751748AbeFEQni (ORCPT ); Tue, 5 Jun 2018 12:43:38 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w55GfiM1161008; Tue, 5 Jun 2018 16:43:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=bGP5wDIXsgkLQn9qHztRNhMExvWxYp/LoRTwEmFfQVU=; b=R8HqRx7y/mp55dkG96VMQr3CUcSlZD/bNjDL9TjGvy4Aw+DwHW3VYyqBzQIUvIdLEuRk 2TRsY99EC9jIxaM8z7d85vNpn2ydmYSr4HHDAvKeCFPJnU0pWmD5S15K3/tXl/rqr++T eQjZptrIlcwp56WkpxlLb0mf7xbd2NlJCnarT8OORUH/1gKfR+sfkRAkJlt0mQS1vY6c MUa7MVBeC1WuP3Mg5XIUI7Nr1t9BNB3O7pdSDvTUOrIYA1mMtkLPdzLK4VAdv6c5EmPp 7m9RB9+l5WloRbv+3gQ0DbrpUIkCZ3i3/p6WdhQJN7436iHM0Upzrg5PJlZEi3fC+Rup OQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2jbvyp14jt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 05 Jun 2018 16:43:36 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w55GhZoP007884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 5 Jun 2018 16:43:35 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w55GhZDd008871; Tue, 5 Jun 2018 16:43:35 GMT Received: from localhost (/10.159.157.7) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 05 Jun 2018 09:43:34 -0700 Subject: [PATCH 6/6] xfs: make sure pretty printed geometry output matches From: "Darrick J. Wong" To: guaneryu@gmail.com, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org Date: Tue, 05 Jun 2018 09:43:33 -0700 Message-ID: <152821701376.24976.4940261016750526905.stgit@magnolia> In-Reply-To: <152821697018.24976.12939094615403004592.stgit@magnolia> References: <152821697018.24976.12939094615403004592.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8915 signatures=668702 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=4 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=382 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806050192 Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Darrick J. Wong Make sure that all of our commands that can print geometry information all print the /same/ information. Signed-off-by: Darrick J. Wong --- common/xfs | 41 +++++++++++++++++++++++++ tests/xfs/710 | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++ tests/xfs/710.out | 2 + tests/xfs/group | 1 + 4 files changed, 132 insertions(+) create mode 100755 tests/xfs/710 create mode 100644 tests/xfs/710.out -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/common/xfs b/common/xfs index 3e34b118..bc35cd87 100644 --- a/common/xfs +++ b/common/xfs @@ -710,3 +710,44 @@ _require_xfs_db_write_array() rm -f $TEST_DIR/$seq.img [ $supported -eq 0 ] && _notrun "xfs_db write can't support array" } + +_require_xfs_spaceman_command() +{ + if [ -z "$1" ] + then + echo "Usage: _require_xfs_spaceman_command command [switch]" 1>&2 + exit 1 + fi + local command=$1 + shift + local param="$*" + local param_checked=0 + local opts="" + + _require_command "$XFS_SPACEMAN_PROG" "xfs_spaceman" + + testfile=$TEST_DIR/$$.xfs_spaceman + case $command in + *) + testio=`$XFS_SPACEMAN_PROG -c "help $command" $TEST_DIR 2>&1` + esac + + rm -f $testfile 2>&1 > /dev/null + echo $testio | grep -q "not found" && \ + _notrun "xfs_spaceman $command support is missing" + echo $testio | grep -q "Operation not supported" && \ + _notrun "xfs_spaceman $command failed (old kernel/wrong fs?)" + echo $testio | grep -q "Invalid" && \ + _notrun "xfs_spaceman $command failed (old kernel/wrong fs/bad args?)" + echo $testio | grep -q "foreign file active" && \ + _notrun "xfs_spaceman $command not supported on $FSTYP" + echo $testio | grep -q "Function not implemented" && \ + _notrun "xfs_spaceman $command support is missing (missing syscall?)" + + [ -n "$param" ] || return + + if [ $param_checked -eq 0 ]; then + $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \ + _notrun "xfs_spaceman $command doesn't support $param" + fi +} diff --git a/tests/xfs/710 b/tests/xfs/710 new file mode 100755 index 00000000..b03d4836 --- /dev/null +++ b/tests/xfs/710 @@ -0,0 +1,88 @@ +#! /bin/bash +# FS QA Test No. 710 +# +# Make sure pretty printed XFS geometry is the same across all programs. +# +#----------------------------------------------------------------------- +# Copyright (c) 2018 Oracle, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 +trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +rm -f $seqres.full + +# get standard environment, filters and checks +. ./common/rc +. ./common/xfs + +# real QA test starts here +_supported_fs xfs +_supported_os Linux + +_require_scratch_nocheck + +# Geometry printing wasn't unified until xfs_spaceman grew an 'info' +# command, so skip this test if there is no spaceman or it doesn't +# know what 'info' is. +_require_xfs_spaceman_command "info" +_require_command "$XFS_DB_PROG" xfs_db +_require_command "$XFS_GROWFS_PROG" xfs_growfs +_require_command "$XFS_INFO_PROG" xfs_info + +_scratch_mkfs > $tmp.mkfs +echo MKFS >> $seqres.full +cat $tmp.mkfs >> $seqres.full + +_scratch_xfs_db -c "info" > $tmp.dbinfo +echo DB >> $seqres.full +cat $tmp.dbinfo >> $seqres.full +diff -u $tmp.mkfs $tmp.dbinfo + +_scratch_mount + +$XFS_SPACEMAN_PROG -c "info" $SCRATCH_MNT > $tmp.spaceman +echo SPACEMAN >> $seqres.full +cat $tmp.spaceman >> $seqres.full +diff -u $tmp.mkfs $tmp.spaceman + +$XFS_GROWFS_PROG -n $SCRATCH_MNT > $tmp.growfs +echo GROWFS >> $seqres.full +cat $tmp.growfs >> $seqres.full +diff -u $tmp.mkfs $tmp.growfs + +$XFS_INFO_PROG $SCRATCH_MNT > $tmp.info +echo INFO >> $seqres.full +cat $tmp.info >> $seqres.full +diff -u $tmp.mkfs $tmp.info + +echo "Silence is golden." +status=0 +exit 0 diff --git a/tests/xfs/710.out b/tests/xfs/710.out new file mode 100644 index 00000000..ae2659d5 --- /dev/null +++ b/tests/xfs/710.out @@ -0,0 +1,2 @@ +QA output created by 710 +Silence is golden. diff --git a/tests/xfs/group b/tests/xfs/group index 2319f58f..9dd30ae0 100644 --- a/tests/xfs/group +++ b/tests/xfs/group @@ -445,3 +445,4 @@ 445 auto quick filestreams 446 auto quick 447 auto mount +710 auto quick