All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfstests: handle xfs_quota output w/ long devicenames
Date: Sun, 06 Oct 2013 17:46:19 -0500	[thread overview]
Message-ID: <5251E83B.8060605@redhat.com> (raw)

Long device names may be split onto their own line
on quota output:

Filesystem   Blocks  Quota  Limit Warn/Time    Mounted on
/dev/mapper/my-very-very-very-long-devicename
                48M      0      0  00 [------] /mnt/scratch

which breaks tests that capture quota output - currently,
only xfs/108.

Add a _filter_quota() which fixes this.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---



diff --git a/common/filter b/common/filter
index 066b353..a0d9d2a 100644
--- a/common/filter
+++ b/common/filter
@@ -240,6 +240,15 @@ _filter_spaces()
        sed -e 's/ [ ]*/ /g'
 }
 
+_filter_quota()
+{
+	# Long dev name might be split onto its own line; last
+	# seds remove that newline if present
+	_filter_scratch | _filter_test_dir | _filter_spaces | \
+	sed -e 'N;s/SCRATCH_DEV\n/SCRATCH_DEV/g' | \
+	sed -e 'N;s/TEST_DEV\n/TEST_DEV/g'
+}
+
 # Account for different "ln" failure messages
 _filter_ln()
 {
diff --git a/tests/xfs/108 b/tests/xfs/108
index 82694f1..5030f63 100755
--- a/tests/xfs/108
+++ b/tests/xfs/108
@@ -71,9 +71,9 @@ test_accounting()
 	for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
 		$here/src/lstat64 $file | head -3 | _filter_scratch
 	done
-	xfs_quota -c "quota -hnb -$type $id" $QARGS | _filter_scratch | _filter_spaces
-	xfs_quota -c "quota -hni -$type $id" $QARGS | _filter_scratch | _filter_spaces
-	xfs_quota -c "quota -hnr -$type $id" $QARGS | _filter_scratch | _filter_spaces
+	xfs_quota -c "quota -hnb -$type $id" $QARGS | _filter_quota
+	xfs_quota -c "quota -hni -$type $id" $QARGS | _filter_quota
+	xfs_quota -c "quota -hnr -$type $id" $QARGS | _filter_quota
 }
 
 export MOUNT_OPTIONS="-opquota"

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2013-10-06 22:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-06 22:46 Eric Sandeen [this message]
2013-10-09 22:12 ` [PATCH] xfstests: handle xfs_quota output w/ long devicenames Dave Chinner
2013-10-16 20:33 ` Rich Johnston

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5251E83B.8060605@redhat.com \
    --to=sandeen@redhat.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.