All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] xfstests patches
@ 2013-03-13 14:57 Eric Sandeen
  2013-03-13 14:57 ` [PATCH 1/3] xfstests: add 274 to the prealloc group Eric Sandeen
                   ` (3 more replies)
  0 siblings, 4 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 14:57 UTC (permalink / raw)
  To: xfs

2 pretty simple ones, and a new btrfs test

[PATCH 1/3] xfstests: add 274 to the prealloc group
[PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
[PATCH 3/3] xfstests: btrfs tests for basic informational commands

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 1/3] xfstests: add 274 to the prealloc group
  2013-03-13 14:57 [PATCH 0/3] xfstests patches Eric Sandeen
@ 2013-03-13 14:57 ` Eric Sandeen
  2013-03-13 17:36   ` Rich Johnston
  2013-03-13 14:57   ` Eric Sandeen
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 14:57 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen

test 274 does preallocation tests but is not in the prealloc group.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 group |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/group b/group
index c3c4161..8096968 100644
--- a/group
+++ b/group
@@ -397,7 +397,7 @@ stress
 271 auto rw quick
 272 auto enospc rw
 273 auto rw
-274 auto rw
+274 auto rw prealloc
 275 auto rw
 276 auto rw metadata
 277 auto ioctl quick metadata
-- 
1.7.1

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

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
  2013-03-13 14:57 [PATCH 0/3] xfstests patches Eric Sandeen
@ 2013-03-13 14:57   ` Eric Sandeen
  2013-03-13 14:57   ` Eric Sandeen
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 14:57 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen, linux-btrfs

SCRATCH_DEV_POOL processing actually takes the first
device out for SCRATCH_DEV and leaves the rest in
SCRATCH_DEV_POOL.

I'm not totally sold on that behavior, but for now,
at least don't populate SCRATCH_DEV_POOL with newlines.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 common.config |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common.config b/common.config
index ed0f44c..5ac58bf 100644
--- a/common.config
+++ b/common.config
@@ -258,7 +258,7 @@ if [ ! -z "$SCRATCH_DEV_POOL" ]; then
         exit 1
     fi
     SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
-    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ for (i = 2; i <= NF; i++) print $i}'`
+    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ ORS=" "; for (i = 2; i <= NF; i++) print $i}'`
 fi
 
 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
@ 2013-03-13 14:57   ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 14:57 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen, linux-btrfs

SCRATCH_DEV_POOL processing actually takes the first
device out for SCRATCH_DEV and leaves the rest in
SCRATCH_DEV_POOL.

I'm not totally sold on that behavior, but for now,
at least don't populate SCRATCH_DEV_POOL with newlines.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 common.config |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common.config b/common.config
index ed0f44c..5ac58bf 100644
--- a/common.config
+++ b/common.config
@@ -258,7 +258,7 @@ if [ ! -z "$SCRATCH_DEV_POOL" ]; then
         exit 1
     fi
     SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
-    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ for (i = 2; i <= NF; i++) print $i}'`
+    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ ORS=" "; for (i = 2; i <= NF; i++) print $i}'`
 fi
 
 echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
-- 
1.7.1

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

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 3/3] xfstests: btrfs tests for basic informational commands
  2013-03-13 14:57 [PATCH 0/3] xfstests patches Eric Sandeen
@ 2013-03-13 14:57   ` Eric Sandeen
  2013-03-13 14:57   ` Eric Sandeen
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 14:57 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen, linux-btrfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accomodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 313           |   96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 313.out       |   51 ++++++++++++++++++++++++++++++
 btrfs.filter  |   47 ++++++++++++++++++++++++++++
 common.filter |   24 ++++++++++++++
 group         |    1 +
 5 files changed, 219 insertions(+), 0 deletions(-)
 create mode 100755 313
 create mode 100644 313.out
 create mode 100644 btrfs.filter

diff --git a/313 b/313
new file mode 100755
index 0000000..6effb0e
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..1aa59a1
--- /dev/null
+++ b/313.out
@@ -0,0 +1,51 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..4e315aa
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,47 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+_filter_btrfs_device_stats()
+{
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..4de9d3d 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,22 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fcbdfb6 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 3/3] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 14:57   ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 14:57 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen, linux-btrfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accomodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 313           |   96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 313.out       |   51 ++++++++++++++++++++++++++++++
 btrfs.filter  |   47 ++++++++++++++++++++++++++++
 common.filter |   24 ++++++++++++++
 group         |    1 +
 5 files changed, 219 insertions(+), 0 deletions(-)
 create mode 100755 313
 create mode 100644 313.out
 create mode 100644 btrfs.filter

diff --git a/313 b/313
new file mode 100755
index 0000000..6effb0e
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..1aa59a1
--- /dev/null
+++ b/313.out
@@ -0,0 +1,51 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].write_io_errs   <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..4e315aa
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,47 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+_filter_btrfs_device_stats()
+{
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..4de9d3d 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,22 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fcbdfb6 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick
-- 
1.7.1

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

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands
  2013-03-13 14:57   ` Eric Sandeen
@ 2013-03-13 15:32     ` Stefan Behrens
  -1 siblings, 0 replies; 44+ messages in thread
From: Stefan Behrens @ 2013-03-13 15:32 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs, linux-btrfs

On Wed, 13 Mar 2013 09:57:03 -0500, Eric Sandeen wrote:
[...]
> +echo "== Show device stats by mountpoint"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats

Is the number of devices in SCRATCH_DEV_POOL fixed to 3? Otherwise you
should pipe the device-stats-by-mountpoint through "head -10" to avoid
failures if the number of devices is != 3.
Possible additional checks (but I am not sure that we really need this
additional level of detail in this check) would be:
1. The number of lines is 5 * number of devices.
2. The 5-line block that is printed for each device always looks the
same (after applying _filter_btrfs_device_stats).

> +echo "== Show device stats by first/scratch dev"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
> +echo "== Show device stats by second dev"
> +$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
> +echo "== Show device stats by last dev"
> +$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/313.out b/313.out
> new file mode 100644
> index 0000000..1aa59a1
> --- /dev/null
> +++ b/313.out
> @@ -0,0 +1,51 @@
> +== QA output created by 313
> +== Set filesystem label to TestLabel.313
> +== Get filesystem label
> +TestLabel.313
> +== Mount.
> +== Show filesystem by label
> +Label: 'TestLabel.313'  uuid: <UUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Show filesystem by UUID
> +Label: 'TestLabel.313'  uuid: <EXACTUUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Sync filesystem
> +FSSync 'SCRATCH_MNT'
> +== Show device stats by mountpoint
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>

3 devices in this case.

> +== Show device stats by first/scratch dev
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +== Show device stats by second dev
> +[FIRST_POOL_DEV].write_io_errs   0
> +[FIRST_POOL_DEV].read_io_errs    0
> +[FIRST_POOL_DEV].flush_io_errs   0
> +[FIRST_POOL_DEV].corruption_errs 0
> +[FIRST_POOL_DEV].generation_errs 0
> +== Show device stats by last dev
> +[LAST_POOL_DEV].write_io_errs   0
> +[LAST_POOL_DEV].read_io_errs    0
> +[LAST_POOL_DEV].flush_io_errs   0
> +[LAST_POOL_DEV].corruption_errs 0
> +[LAST_POOL_DEV].generation_errs 0
[...]


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 15:32     ` Stefan Behrens
  0 siblings, 0 replies; 44+ messages in thread
From: Stefan Behrens @ 2013-03-13 15:32 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, xfs

On Wed, 13 Mar 2013 09:57:03 -0500, Eric Sandeen wrote:
[...]
> +echo "== Show device stats by mountpoint"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats

Is the number of devices in SCRATCH_DEV_POOL fixed to 3? Otherwise you
should pipe the device-stats-by-mountpoint through "head -10" to avoid
failures if the number of devices is != 3.
Possible additional checks (but I am not sure that we really need this
additional level of detail in this check) would be:
1. The number of lines is 5 * number of devices.
2. The 5-line block that is printed for each device always looks the
same (after applying _filter_btrfs_device_stats).

> +echo "== Show device stats by first/scratch dev"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
> +echo "== Show device stats by second dev"
> +$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
> +echo "== Show device stats by last dev"
> +$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/313.out b/313.out
> new file mode 100644
> index 0000000..1aa59a1
> --- /dev/null
> +++ b/313.out
> @@ -0,0 +1,51 @@
> +== QA output created by 313
> +== Set filesystem label to TestLabel.313
> +== Get filesystem label
> +TestLabel.313
> +== Mount.
> +== Show filesystem by label
> +Label: 'TestLabel.313'  uuid: <UUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Show filesystem by UUID
> +Label: 'TestLabel.313'  uuid: <EXACTUUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Sync filesystem
> +FSSync 'SCRATCH_MNT'
> +== Show device stats by mountpoint
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>

3 devices in this case.

> +== Show device stats by first/scratch dev
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +== Show device stats by second dev
> +[FIRST_POOL_DEV].write_io_errs   0
> +[FIRST_POOL_DEV].read_io_errs    0
> +[FIRST_POOL_DEV].flush_io_errs   0
> +[FIRST_POOL_DEV].corruption_errs 0
> +[FIRST_POOL_DEV].generation_errs 0
> +== Show device stats by last dev
> +[LAST_POOL_DEV].write_io_errs   0
> +[LAST_POOL_DEV].read_io_errs    0
> +[LAST_POOL_DEV].flush_io_errs   0
> +[LAST_POOL_DEV].corruption_errs 0
> +[LAST_POOL_DEV].generation_errs 0
[...]

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands
  2013-03-13 15:32     ` Stefan Behrens
@ 2013-03-13 16:17       ` Eric Sandeen
  -1 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 16:17 UTC (permalink / raw)
  To: Stefan Behrens; +Cc: xfs, linux-btrfs

On 3/13/13 10:32 AM, Stefan Behrens wrote:
> On Wed, 13 Mar 2013 09:57:03 -0500, Eric Sandeen wrote:
> [...]
>> +echo "== Show device stats by mountpoint"
>> +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats
> 
> Is the number of devices in SCRATCH_DEV_POOL fixed to 3? Otherwise you
> should pipe the device-stats-by-mountpoint through "head -10" to avoid
> failures if the number of devices is != 3.

Oh, you are right.

I had meant to filter device stats through "uniq" after replacing all
devices & numbers.  I'll add that, then I think it should be ok.

thanks for catching that.

> Possible additional checks (but I am not sure that we really need this
> additional level of detail in this check) would be:
> 1. The number of lines is 5 * number of devices.
> 2. The 5-line block that is printed for each device always looks the
> same (after applying _filter_btrfs_device_stats).

hm, perhaps - I wonder if that might be fragile?  I guess if *any* output
changes, the test will break . . . 

Thanks for the review!
-Eric

>> +echo "== Show device stats by first/scratch dev"
>> +$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
>> +echo "== Show device stats by second dev"
>> +$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
>> +echo "== Show device stats by last dev"
>> +$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
>> +
>> +# success, all done
>> +status=0
>> +exit
>> diff --git a/313.out b/313.out
>> new file mode 100644
>> index 0000000..1aa59a1
>> --- /dev/null
>> +++ b/313.out
>> @@ -0,0 +1,51 @@
>> +== QA output created by 313
>> +== Set filesystem label to TestLabel.313
>> +== Get filesystem label
>> +TestLabel.313
>> +== Mount.
>> +== Show filesystem by label
>> +Label: 'TestLabel.313'  uuid: <UUID>
>> +	Total devices <EXACTNUM> FS bytes used <SIZE>
>> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
>> +
>> +== Show filesystem by UUID
>> +Label: 'TestLabel.313'  uuid: <EXACTUUID>
>> +	Total devices <EXACTNUM> FS bytes used <SIZE>
>> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
>> +
>> +== Sync filesystem
>> +FSSync 'SCRATCH_MNT'
>> +== Show device stats by mountpoint
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
> 
> 3 devices in this case.

Yep, oops.

>> +== Show device stats by first/scratch dev
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
>> +== Show device stats by second dev
>> +[FIRST_POOL_DEV].write_io_errs   0
>> +[FIRST_POOL_DEV].read_io_errs    0
>> +[FIRST_POOL_DEV].flush_io_errs   0
>> +[FIRST_POOL_DEV].corruption_errs 0
>> +[FIRST_POOL_DEV].generation_errs 0
>> +== Show device stats by last dev
>> +[LAST_POOL_DEV].write_io_errs   0
>> +[LAST_POOL_DEV].read_io_errs    0
>> +[LAST_POOL_DEV].flush_io_errs   0
>> +[LAST_POOL_DEV].corruption_errs 0
>> +[LAST_POOL_DEV].generation_errs 0
> [...]
> 


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 16:17       ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 16:17 UTC (permalink / raw)
  To: Stefan Behrens; +Cc: linux-btrfs, xfs

On 3/13/13 10:32 AM, Stefan Behrens wrote:
> On Wed, 13 Mar 2013 09:57:03 -0500, Eric Sandeen wrote:
> [...]
>> +echo "== Show device stats by mountpoint"
>> +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats
> 
> Is the number of devices in SCRATCH_DEV_POOL fixed to 3? Otherwise you
> should pipe the device-stats-by-mountpoint through "head -10" to avoid
> failures if the number of devices is != 3.

Oh, you are right.

I had meant to filter device stats through "uniq" after replacing all
devices & numbers.  I'll add that, then I think it should be ok.

thanks for catching that.

> Possible additional checks (but I am not sure that we really need this
> additional level of detail in this check) would be:
> 1. The number of lines is 5 * number of devices.
> 2. The 5-line block that is printed for each device always looks the
> same (after applying _filter_btrfs_device_stats).

hm, perhaps - I wonder if that might be fragile?  I guess if *any* output
changes, the test will break . . . 

Thanks for the review!
-Eric

>> +echo "== Show device stats by first/scratch dev"
>> +$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
>> +echo "== Show device stats by second dev"
>> +$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
>> +echo "== Show device stats by last dev"
>> +$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
>> +
>> +# success, all done
>> +status=0
>> +exit
>> diff --git a/313.out b/313.out
>> new file mode 100644
>> index 0000000..1aa59a1
>> --- /dev/null
>> +++ b/313.out
>> @@ -0,0 +1,51 @@
>> +== QA output created by 313
>> +== Set filesystem label to TestLabel.313
>> +== Get filesystem label
>> +TestLabel.313
>> +== Mount.
>> +== Show filesystem by label
>> +Label: 'TestLabel.313'  uuid: <UUID>
>> +	Total devices <EXACTNUM> FS bytes used <SIZE>
>> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
>> +
>> +== Show filesystem by UUID
>> +Label: 'TestLabel.313'  uuid: <EXACTUUID>
>> +	Total devices <EXACTNUM> FS bytes used <SIZE>
>> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
>> +
>> +== Sync filesystem
>> +FSSync 'SCRATCH_MNT'
>> +== Show device stats by mountpoint
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
> 
> 3 devices in this case.

Yep, oops.

>> +== Show device stats by first/scratch dev
>> +[SCRATCH_DEV].write_io_errs   <NUM>
>> +[SCRATCH_DEV].read_io_errs    <NUM>
>> +[SCRATCH_DEV].flush_io_errs   <NUM>
>> +[SCRATCH_DEV].corruption_errs <NUM>
>> +[SCRATCH_DEV].generation_errs <NUM>
>> +== Show device stats by second dev
>> +[FIRST_POOL_DEV].write_io_errs   0
>> +[FIRST_POOL_DEV].read_io_errs    0
>> +[FIRST_POOL_DEV].flush_io_errs   0
>> +[FIRST_POOL_DEV].corruption_errs 0
>> +[FIRST_POOL_DEV].generation_errs 0
>> +== Show device stats by last dev
>> +[LAST_POOL_DEV].write_io_errs   0
>> +[LAST_POOL_DEV].read_io_errs    0
>> +[LAST_POOL_DEV].flush_io_errs   0
>> +[LAST_POOL_DEV].corruption_errs 0
>> +[LAST_POOL_DEV].generation_errs 0
> [...]
> 

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 3/3 V2] xfstests: btrfs tests for basic informational commands
  2013-03-13 14:57   ` Eric Sandeen
@ 2013-03-13 16:38     ` Eric Sandeen
  -1 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 16:38 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs, linux-btrfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: sort & uniq device stats output to account for variable
nrs. of devices.  Optionally check that the proper nr. of
devices was returned, as well.

diff --git a/313 b/313
new file mode 100755
index 0000000..579b0d3
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..f513bdd
--- /dev/null
+++ b/313.out
@@ -0,0 +1,41 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..8a749bf
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,60 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+# This eliminates all numbers, and shows only unique lines,
+# to accomodate a varying nr. of devices.
+# If given an argument, make sure we saw that many devices
+# in total.
+_filter_btrfs_device_stats()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		UNIQ_OPT="-c"
+	else
+		NUMDEVS="thiswillnotmatch"
+		UNIQ=""
+	fi
+
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
+	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..4de9d3d 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,22 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fc33125 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 3/3 V2] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 16:38     ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 16:38 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, xfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: sort & uniq device stats output to account for variable
nrs. of devices.  Optionally check that the proper nr. of
devices was returned, as well.

diff --git a/313 b/313
new file mode 100755
index 0000000..579b0d3
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..f513bdd
--- /dev/null
+++ b/313.out
@@ -0,0 +1,41 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..8a749bf
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,60 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+# This eliminates all numbers, and shows only unique lines,
+# to accomodate a varying nr. of devices.
+# If given an argument, make sure we saw that many devices
+# in total.
+_filter_btrfs_device_stats()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		UNIQ_OPT="-c"
+	else
+		NUMDEVS="thiswillnotmatch"
+		UNIQ=""
+	fi
+
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
+	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..4de9d3d 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,22 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fc33125 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick

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

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH 1/3] xfstests: add 274 to the prealloc group
  2013-03-13 14:57 ` [PATCH 1/3] xfstests: add 274 to the prealloc group Eric Sandeen
@ 2013-03-13 17:36   ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-13 17:36 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

Looks good Eric.

Reviewed-by: <rjohnston@sgi.com>

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
  2013-03-13 14:57   ` Eric Sandeen
@ 2013-03-13 17:43     ` Rich Johnston
  -1 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-13 17:43 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs, linux-btrfs

On 03/13/2013 09:57 AM, Eric Sandeen wrote:
> SCRATCH_DEV_POOL processing actually takes the first
> device out for SCRATCH_DEV and leaves the rest in
> SCRATCH_DEV_POOL.
>
> I'm not totally sold on that behavior, but for now,
> at least don't populate SCRATCH_DEV_POOL with newlines.

>
> Cc: linux-btrfs@vger.kernel.org
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>   common.config |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/common.config b/common.config
> index ed0f44c..5ac58bf 100644
> --- a/common.config
> +++ b/common.config
> @@ -258,7 +258,7 @@ if [ ! -z "$SCRATCH_DEV_POOL" ]; then
>           exit 1
>       fi
>       SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
> -    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ for (i = 2; i <= NF; i++) print $i}'`
> +    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ ORS=" "; for (i = 2; i <= NF; i++) print $i}'`
>   fi
>
>   echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
>

Is the purpose of this patch is so future improvements will be able to 
parse/use SCRATCH_DEV_POOL easier from within bash?

Looks good Eric.

Reviewed-by: <rjohnston@sgi.com>

Regards
--Rich

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
@ 2013-03-13 17:43     ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-13 17:43 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, xfs

On 03/13/2013 09:57 AM, Eric Sandeen wrote:
> SCRATCH_DEV_POOL processing actually takes the first
> device out for SCRATCH_DEV and leaves the rest in
> SCRATCH_DEV_POOL.
>
> I'm not totally sold on that behavior, but for now,
> at least don't populate SCRATCH_DEV_POOL with newlines.

>
> Cc: linux-btrfs@vger.kernel.org
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>   common.config |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/common.config b/common.config
> index ed0f44c..5ac58bf 100644
> --- a/common.config
> +++ b/common.config
> @@ -258,7 +258,7 @@ if [ ! -z "$SCRATCH_DEV_POOL" ]; then
>           exit 1
>       fi
>       SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
> -    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ for (i = 2; i <= NF; i++) print $i}'`
> +    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ ORS=" "; for (i = 2; i <= NF; i++) print $i}'`
>   fi
>
>   echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
>

Is the purpose of this patch is so future improvements will be able to 
parse/use SCRATCH_DEV_POOL easier from within bash?

Looks good Eric.

Reviewed-by: <rjohnston@sgi.com>

Regards
--Rich

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
  2013-03-13 17:43     ` Rich Johnston
@ 2013-03-13 17:45       ` Eric Sandeen
  -1 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 17:45 UTC (permalink / raw)
  To: Rich Johnston; +Cc: xfs, linux-btrfs

On 3/13/13 12:43 PM, Rich Johnston wrote:
> On 03/13/2013 09:57 AM, Eric Sandeen wrote:
>> SCRATCH_DEV_POOL processing actually takes the first
>> device out for SCRATCH_DEV and leaves the rest in
>> SCRATCH_DEV_POOL.
>>
>> I'm not totally sold on that behavior, but for now,
>> at least don't populate SCRATCH_DEV_POOL with newlines.
> 
>>
>> Cc: linux-btrfs@vger.kernel.org
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>   common.config |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/common.config b/common.config
>> index ed0f44c..5ac58bf 100644
>> --- a/common.config
>> +++ b/common.config
>> @@ -258,7 +258,7 @@ if [ ! -z "$SCRATCH_DEV_POOL" ]; then
>>           exit 1
>>       fi
>>       SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
>> -    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ for (i = 2; i <= NF; i++) print $i}'`
>> +    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ ORS=" "; for (i = 2; i <= NF; i++) print $i}'`
>>   fi
>>
>>   echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
>>
> 
> Is the purpose of this patch is so future improvements will be able to parse/use SCRATCH_DEV_POOL easier from within bash?

Yep, and just generally since it's used as an argument, feeding a string w/ newlines to any command is just a bit odd.

-Eric

> Looks good Eric.
> 
> Reviewed-by: <rjohnston@sgi.com>
> 
> Regards
> --Rich


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
@ 2013-03-13 17:45       ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 17:45 UTC (permalink / raw)
  To: Rich Johnston; +Cc: linux-btrfs, xfs

On 3/13/13 12:43 PM, Rich Johnston wrote:
> On 03/13/2013 09:57 AM, Eric Sandeen wrote:
>> SCRATCH_DEV_POOL processing actually takes the first
>> device out for SCRATCH_DEV and leaves the rest in
>> SCRATCH_DEV_POOL.
>>
>> I'm not totally sold on that behavior, but for now,
>> at least don't populate SCRATCH_DEV_POOL with newlines.
> 
>>
>> Cc: linux-btrfs@vger.kernel.org
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>>   common.config |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/common.config b/common.config
>> index ed0f44c..5ac58bf 100644
>> --- a/common.config
>> +++ b/common.config
>> @@ -258,7 +258,7 @@ if [ ! -z "$SCRATCH_DEV_POOL" ]; then
>>           exit 1
>>       fi
>>       SCRATCH_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
>> -    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ for (i = 2; i <= NF; i++) print $i}'`
>> +    SCRATCH_DEV_POOL=`echo $SCRATCH_DEV_POOL | awk '{ ORS=" "; for (i = 2; i <= NF; i++) print $i}'`
>>   fi
>>
>>   echo $SCRATCH_DEV | grep -q ":" > /dev/null 2>&1
>>
> 
> Is the purpose of this patch is so future improvements will be able to parse/use SCRATCH_DEV_POOL easier from within bash?

Yep, and just generally since it's used as an argument, feeding a string w/ newlines to any command is just a bit odd.

-Eric

> Looks good Eric.
> 
> Reviewed-by: <rjohnston@sgi.com>
> 
> Regards
> --Rich

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands
  2013-03-13 16:17       ` Eric Sandeen
@ 2013-03-13 17:47         ` Rich Johnston
  -1 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-13 17:47 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Stefan Behrens, linux-btrfs, xfs

Looks good Eric, but I will wait for Stefan to look at this version to 
make sure all his comments have been addressed, then I will commit this 
series.  Thanks for the patchset.

Regards
--Rich


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 17:47         ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-13 17:47 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, Stefan Behrens, xfs

Looks good Eric, but I will wait for Stefan to look at this version to 
make sure all his comments have been addressed, then I will commit this 
series.  Thanks for the patchset.

Regards
--Rich

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 3/3 V3] xfstests: btrfs tests for basic informational commands
  2013-03-13 16:38     ` Eric Sandeen
@ 2013-03-13 18:53       ` Eric Sandeen
  -1 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 18:53 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs, linux-btrfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: sort & uniq device stats output to account for variable
nrs. of devices.  Optionally check that the proper nr. of
devices was returned, as well.

V3: _filter_uuid needs to pay attention to $1, not hope
that the caller has set $UUID.  Oops.

diff --git a/313 b/313
new file mode 100755
index 0000000..579b0d3
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..f513bdd
--- /dev/null
+++ b/313.out
@@ -0,0 +1,41 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..8a749bf
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,60 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+# This eliminates all numbers, and shows only unique lines,
+# to accomodate a varying nr. of devices.
+# If given an argument, make sure we saw that many devices
+# in total.
+_filter_btrfs_device_stats()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		UNIQ_OPT="-c"
+	else
+		NUMDEVS="thiswillnotmatch"
+		UNIQ=""
+	fi
+
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
+	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..c34809f 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,23 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		UUID=$1
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fcbdfb6 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick


^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 3/3 V3] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 18:53       ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 18:53 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, xfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: sort & uniq device stats output to account for variable
nrs. of devices.  Optionally check that the proper nr. of
devices was returned, as well.

V3: _filter_uuid needs to pay attention to $1, not hope
that the caller has set $UUID.  Oops.

diff --git a/313 b/313
new file mode 100755
index 0000000..579b0d3
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..f513bdd
--- /dev/null
+++ b/313.out
@@ -0,0 +1,41 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..8a749bf
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,60 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+# This eliminates all numbers, and shows only unique lines,
+# to accomodate a varying nr. of devices.
+# If given an argument, make sure we saw that many devices
+# in total.
+_filter_btrfs_device_stats()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		UNIQ_OPT="-c"
+	else
+		NUMDEVS="thiswillnotmatch"
+		UNIQ=""
+	fi
+
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
+	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..c34809f 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,23 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		UUID=$1
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fcbdfb6 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick

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

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V3] xfstests: btrfs tests for basic informational commands
  2013-03-13 18:53       ` Eric Sandeen
@ 2013-03-13 19:00         ` Stefan Behrens
  -1 siblings, 0 replies; 44+ messages in thread
From: Stefan Behrens @ 2013-03-13 19:00 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs, linux-btrfs

On Wed, 13 Mar 2013 13:53:51 -0500, Eric Sandeen wrote:
> Run basic btrfs information commands in various ways, performing
> sanity tests of: filesystem show, label, sync, and device stats
> (sync is included just because it's simple).  These are mostly
> just smoke tests, although for example show by label & UUID
> should verify that the correct fs was shown.
> 
> This also adds quite a few new filters to accommodate the output
> of the new commands.
> 
> Cc: linux-btrfs@vger.kernel.org
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> V2: sort & uniq device stats output to account for variable
> nrs. of devices.  Optionally check that the proper nr. of
> devices was returned, as well.
> 
> V3: _filter_uuid needs to pay attention to $1, not hope
> that the caller has set $UUID.  Oops.
> 
> diff --git a/313 b/313
> new file mode 100755
> index 0000000..579b0d3
> --- /dev/null
> +++ b/313
> @@ -0,0 +1,96 @@
> +#! /bin/bash
> +# FS QA Test No. 313
> +#
> +# run basic btrfs information commands in various ways
> +# sanity tests: filesystem show, label, sync, and device stats
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
> +#
> +# 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
> +#-----------------------------------------------------------------------
> +#
> +# creator
> +owner=sandeen@redhat.com
> +
> +seq=`basename $0`
> +echo "== QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +    cd /
> +    rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./btrfs.filter
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs btrfs
> +_supported_os Linux
> +_require_scratch
> +_require_scratch_dev_pool
> +
> +rm -f $seq.full
> +
> +FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
> +LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
> +TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
> +LABEL=TestLabel.$seq
> +
> +echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
> +
> +_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
> +
> +# These have to be done unmounted...?
> +echo "== Set filesystem label to $LABEL"
> +$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
> +echo "== Get filesystem label"
> +$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
> +
> +echo "== Mount."
> +_scratch_mount
> +
> +echo "== Show filesystem by label"
> +$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
> +UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
> +
> +echo "UUID $UUID" >> $seq.full
> +
> +echo "== Show filesystem by UUID"
> +$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
> +
> +echo "== Sync filesystem"
> +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
> +
> +echo "== Show device stats by mountpoint"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
> +echo "== Show device stats by first/scratch dev"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
> +echo "== Show device stats by second dev"
> +$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
> +echo "== Show device stats by last dev"
> +$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/313.out b/313.out
> new file mode 100644
> index 0000000..f513bdd
> --- /dev/null
> +++ b/313.out
> @@ -0,0 +1,41 @@
> +== QA output created by 313
> +== Set filesystem label to TestLabel.313
> +== Get filesystem label
> +TestLabel.313
> +== Mount.
> +== Show filesystem by label
> +Label: 'TestLabel.313'  uuid: <UUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Show filesystem by UUID
> +Label: 'TestLabel.313'  uuid: <EXACTUUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Sync filesystem
> +FSSync 'SCRATCH_MNT'
> +== Show device stats by mountpoint
> +      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
> +== Show device stats by first/scratch dev
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +== Show device stats by second dev
> +[FIRST_POOL_DEV].write_io_errs   0
> +[FIRST_POOL_DEV].read_io_errs    0
> +[FIRST_POOL_DEV].flush_io_errs   0
> +[FIRST_POOL_DEV].corruption_errs 0
> +[FIRST_POOL_DEV].generation_errs 0
> +== Show device stats by last dev
> +[LAST_POOL_DEV].write_io_errs   0
> +[LAST_POOL_DEV].read_io_errs    0
> +[LAST_POOL_DEV].flush_io_errs   0
> +[LAST_POOL_DEV].corruption_errs 0
> +[LAST_POOL_DEV].generation_errs 0
> diff --git a/btrfs.filter b/btrfs.filter
> new file mode 100644
> index 0000000..8a749bf
> --- /dev/null
> +++ b/btrfs.filter
> @@ -0,0 +1,60 @@
> +# Filters for btrfs command output
> +
> +. ./common.filter
> +
> +# Some, but not all, commands emit "Btrfs <version>"
> +_filter_btrfs_version()
> +{
> +	sed -e "s/^Btrfs.*//g"
> +}
> +
> +_filter_devid()
> +{
> +	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
> +}
> +
> +# If passed a number as first arg, filter that number of devices
> +# If passed a UUID as second arg, filter that exact UUID
> +_filter_btrfs_filesystem_show()
> +{
> +	if [ ! -z $1 ]; then
> +		NUMDEVS=$1
> +		NUM_SUBST="<EXACTNUM>"
> +	else
> +		NUMDEVS="[0-9]\+"
> +		NUM_SUBST="<NUM>"
> +	fi
> +
> +	UUID=""
> +	if [ ! -z $2 ]; then
> +		UUID=$2
> +	fi
> +
> +	# the uniq collapses all device lines into 1
> +	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
> +	_filter_size | _filter_btrfs_version | _filter_devid | \
> +	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
> +	uniq
> +}
> +
> +# This eliminates all numbers, and shows only unique lines,
> +# to accomodate a varying nr. of devices.
> +# If given an argument, make sure we saw that many devices
> +# in total.
> +_filter_btrfs_device_stats()
> +{
> +	if [ ! -z $1 ]; then
> +		NUMDEVS=$1
> +		UNIQ_OPT="-c"
> +	else
> +		NUMDEVS="thiswillnotmatch"
> +		UNIQ=""
> +	fi
> +
> +	_filter_scratch | _filter_scratch_pool | \
> +	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
> +	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
> +}
> +
> +# make sure this script returns success
> +/bin/true
> diff --git a/common.filter b/common.filter
> index c854a98..c34809f 100644
> --- a/common.filter
> +++ b/common.filter
> @@ -226,6 +226,13 @@ _filter_scratch()
>  	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
>  }
>  
> +# Turn any device in the scratch pool into SCRATCH_DEV
> +_filter_scratch_pool()
> +{
> +	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
> +	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
> +}
> +
>  _filter_spaces()
>  {
>         sed -e 's/ [ ]*/ /g'
> @@ -238,5 +245,23 @@ _filter_ln()
>  	    -e "s,failed to create,creating,"
>  }
>  
> +# If given an arg, filter *that* UUID string
> +# Otherwise look for something that looks like a generic UUID
> +_filter_uuid()
> +{
> +	if [ ! -z $1 ]; then
> +		UUID=$1
> +		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
> +	else
> +		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
> +	fi
> +}
> +
> +# Filter out sizes like 6.14MB etc
> +_filter_size()
> +{
> +	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
> +}
> +
>  # make sure this script returns success
>  /bin/true
> diff --git a/group b/group
> index 8096968..fcbdfb6 100644
> --- a/group
> +++ b/group
> @@ -429,3 +429,4 @@ stress
>  303 aio dangerous ioctl rw stress
>  304 aio dangerous ioctl rw stress
>  305 aio dangerous enospc rw stress
> +313 auto quick
> 

Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V3] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 19:00         ` Stefan Behrens
  0 siblings, 0 replies; 44+ messages in thread
From: Stefan Behrens @ 2013-03-13 19:00 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, xfs

On Wed, 13 Mar 2013 13:53:51 -0500, Eric Sandeen wrote:
> Run basic btrfs information commands in various ways, performing
> sanity tests of: filesystem show, label, sync, and device stats
> (sync is included just because it's simple).  These are mostly
> just smoke tests, although for example show by label & UUID
> should verify that the correct fs was shown.
> 
> This also adds quite a few new filters to accommodate the output
> of the new commands.
> 
> Cc: linux-btrfs@vger.kernel.org
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> V2: sort & uniq device stats output to account for variable
> nrs. of devices.  Optionally check that the proper nr. of
> devices was returned, as well.
> 
> V3: _filter_uuid needs to pay attention to $1, not hope
> that the caller has set $UUID.  Oops.
> 
> diff --git a/313 b/313
> new file mode 100755
> index 0000000..579b0d3
> --- /dev/null
> +++ b/313
> @@ -0,0 +1,96 @@
> +#! /bin/bash
> +# FS QA Test No. 313
> +#
> +# run basic btrfs information commands in various ways
> +# sanity tests: filesystem show, label, sync, and device stats
> +#
> +#-----------------------------------------------------------------------
> +# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
> +#
> +# 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
> +#-----------------------------------------------------------------------
> +#
> +# creator
> +owner=sandeen@redhat.com
> +
> +seq=`basename $0`
> +echo "== QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1	# failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> +    cd /
> +    rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./btrfs.filter
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs btrfs
> +_supported_os Linux
> +_require_scratch
> +_require_scratch_dev_pool
> +
> +rm -f $seq.full
> +
> +FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
> +LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
> +TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
> +LABEL=TestLabel.$seq
> +
> +echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
> +
> +_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
> +
> +# These have to be done unmounted...?
> +echo "== Set filesystem label to $LABEL"
> +$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
> +echo "== Get filesystem label"
> +$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
> +
> +echo "== Mount."
> +_scratch_mount
> +
> +echo "== Show filesystem by label"
> +$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
> +UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
> +
> +echo "UUID $UUID" >> $seq.full
> +
> +echo "== Show filesystem by UUID"
> +$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
> +
> +echo "== Sync filesystem"
> +$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
> +
> +echo "== Show device stats by mountpoint"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
> +echo "== Show device stats by first/scratch dev"
> +$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
> +echo "== Show device stats by second dev"
> +$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
> +echo "== Show device stats by last dev"
> +$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/313.out b/313.out
> new file mode 100644
> index 0000000..f513bdd
> --- /dev/null
> +++ b/313.out
> @@ -0,0 +1,41 @@
> +== QA output created by 313
> +== Set filesystem label to TestLabel.313
> +== Get filesystem label
> +TestLabel.313
> +== Mount.
> +== Show filesystem by label
> +Label: 'TestLabel.313'  uuid: <UUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Show filesystem by UUID
> +Label: 'TestLabel.313'  uuid: <EXACTUUID>
> +	Total devices <EXACTNUM> FS bytes used <SIZE>
> +	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> +
> +== Sync filesystem
> +FSSync 'SCRATCH_MNT'
> +== Show device stats by mountpoint
> +      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
> +      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
> +== Show device stats by first/scratch dev
> +[SCRATCH_DEV].corruption_errs <NUM>
> +[SCRATCH_DEV].flush_io_errs   <NUM>
> +[SCRATCH_DEV].generation_errs <NUM>
> +[SCRATCH_DEV].read_io_errs    <NUM>
> +[SCRATCH_DEV].write_io_errs   <NUM>
> +== Show device stats by second dev
> +[FIRST_POOL_DEV].write_io_errs   0
> +[FIRST_POOL_DEV].read_io_errs    0
> +[FIRST_POOL_DEV].flush_io_errs   0
> +[FIRST_POOL_DEV].corruption_errs 0
> +[FIRST_POOL_DEV].generation_errs 0
> +== Show device stats by last dev
> +[LAST_POOL_DEV].write_io_errs   0
> +[LAST_POOL_DEV].read_io_errs    0
> +[LAST_POOL_DEV].flush_io_errs   0
> +[LAST_POOL_DEV].corruption_errs 0
> +[LAST_POOL_DEV].generation_errs 0
> diff --git a/btrfs.filter b/btrfs.filter
> new file mode 100644
> index 0000000..8a749bf
> --- /dev/null
> +++ b/btrfs.filter
> @@ -0,0 +1,60 @@
> +# Filters for btrfs command output
> +
> +. ./common.filter
> +
> +# Some, but not all, commands emit "Btrfs <version>"
> +_filter_btrfs_version()
> +{
> +	sed -e "s/^Btrfs.*//g"
> +}
> +
> +_filter_devid()
> +{
> +	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
> +}
> +
> +# If passed a number as first arg, filter that number of devices
> +# If passed a UUID as second arg, filter that exact UUID
> +_filter_btrfs_filesystem_show()
> +{
> +	if [ ! -z $1 ]; then
> +		NUMDEVS=$1
> +		NUM_SUBST="<EXACTNUM>"
> +	else
> +		NUMDEVS="[0-9]\+"
> +		NUM_SUBST="<NUM>"
> +	fi
> +
> +	UUID=""
> +	if [ ! -z $2 ]; then
> +		UUID=$2
> +	fi
> +
> +	# the uniq collapses all device lines into 1
> +	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
> +	_filter_size | _filter_btrfs_version | _filter_devid | \
> +	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
> +	uniq
> +}
> +
> +# This eliminates all numbers, and shows only unique lines,
> +# to accomodate a varying nr. of devices.
> +# If given an argument, make sure we saw that many devices
> +# in total.
> +_filter_btrfs_device_stats()
> +{
> +	if [ ! -z $1 ]; then
> +		NUMDEVS=$1
> +		UNIQ_OPT="-c"
> +	else
> +		NUMDEVS="thiswillnotmatch"
> +		UNIQ=""
> +	fi
> +
> +	_filter_scratch | _filter_scratch_pool | \
> +	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
> +	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
> +}
> +
> +# make sure this script returns success
> +/bin/true
> diff --git a/common.filter b/common.filter
> index c854a98..c34809f 100644
> --- a/common.filter
> +++ b/common.filter
> @@ -226,6 +226,13 @@ _filter_scratch()
>  	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
>  }
>  
> +# Turn any device in the scratch pool into SCRATCH_DEV
> +_filter_scratch_pool()
> +{
> +	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
> +	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
> +}
> +
>  _filter_spaces()
>  {
>         sed -e 's/ [ ]*/ /g'
> @@ -238,5 +245,23 @@ _filter_ln()
>  	    -e "s,failed to create,creating,"
>  }
>  
> +# If given an arg, filter *that* UUID string
> +# Otherwise look for something that looks like a generic UUID
> +_filter_uuid()
> +{
> +	if [ ! -z $1 ]; then
> +		UUID=$1
> +		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
> +	else
> +		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
> +	fi
> +}
> +
> +# Filter out sizes like 6.14MB etc
> +_filter_size()
> +{
> +	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
> +}
> +
>  # make sure this script returns success
>  /bin/true
> diff --git a/group b/group
> index 8096968..fcbdfb6 100644
> --- a/group
> +++ b/group
> @@ -429,3 +429,4 @@ stress
>  303 aio dangerous ioctl rw stress
>  304 aio dangerous ioctl rw stress
>  305 aio dangerous enospc rw stress
> +313 auto quick
> 

Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>


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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-13 18:53       ` Eric Sandeen
@ 2013-03-13 19:01         ` Eric Sandeen
  -1 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 19:01 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, xfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: sort & uniq device stats output to account for variable
nrs. of devices.  Optionally check that the proper nr. of
devices was returned, as well.

V3: _filter_uuid needs to pay attention to $1, not hope
that the caller has set $UUID.  Oops.

V4: fix stats filter to set UNIQ_OPT in both cases, ugh.

diff --git a/313 b/313
new file mode 100755
index 0000000..579b0d3
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..f513bdd
--- /dev/null
+++ b/313.out
@@ -0,0 +1,41 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..8a749bf
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,60 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+# This eliminates all numbers, and shows only unique lines,
+# to accomodate a varying nr. of devices.
+# If given an argument, make sure we saw that many devices
+# in total.
+_filter_btrfs_device_stats()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		UNIQ_OPT="-c"
+	else
+		NUMDEVS="thiswillnotmatch"
+		UNIQ_OPT=""
+	fi
+
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
+	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..c34809f 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,23 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		UUID=$1
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fcbdfb6 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick

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



^ permalink raw reply related	[flat|nested] 44+ messages in thread

* [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-13 19:01         ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-13 19:01 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-btrfs, xfs

Run basic btrfs information commands in various ways, performing
sanity tests of: filesystem show, label, sync, and device stats
(sync is included just because it's simple).  These are mostly
just smoke tests, although for example show by label & UUID
should verify that the correct fs was shown.

This also adds quite a few new filters to accommodate the output
of the new commands.

Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

V2: sort & uniq device stats output to account for variable
nrs. of devices.  Optionally check that the proper nr. of
devices was returned, as well.

V3: _filter_uuid needs to pay attention to $1, not hope
that the caller has set $UUID.  Oops.

V4: fix stats filter to set UNIQ_OPT in both cases, ugh.

diff --git a/313 b/313
new file mode 100755
index 0000000..579b0d3
--- /dev/null
+++ b/313
@@ -0,0 +1,96 @@
+#! /bin/bash
+# FS QA Test No. 313
+#
+# run basic btrfs information commands in various ways
+# sanity tests: filesystem show, label, sync, and device stats
+#
+#-----------------------------------------------------------------------
+# Copyright (c) 2013 Red Hat, Inc.  All Rights Reserved.
+#
+# 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
+#-----------------------------------------------------------------------
+#
+# creator
+owner=sandeen@redhat.com
+
+seq=`basename $0`
+echo "== QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1	# failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+    cd /
+    rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common.rc
+. ./btrfs.filter
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs btrfs
+_supported_os Linux
+_require_scratch
+_require_scratch_dev_pool
+
+rm -f $seq.full
+
+FIRST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $1}'`
+LAST_POOL_DEV=`echo $SCRATCH_DEV_POOL | awk '{print $NF}'`
+TOTAL_DEVS=`echo $SCRATCH_DEV $SCRATCH_DEV_POOL | wc -w`
+LABEL=TestLabel.$seq
+
+echo "Scratch $SCRATCH_DEV First $FIRST_POOL_DEV last $LAST_POOL_DEV Total $TOTAL_DEVS" > $seq.full
+
+_scratch_mkfs $SCRATCH_DEV_POOL >> $seq.full 2>&1 || _fail "mkfs failed"
+
+# These have to be done unmounted...?
+echo "== Set filesystem label to $LABEL"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV $LABEL
+echo "== Get filesystem label"
+$BTRFS_UTIL_PROG filesystem label $SCRATCH_DEV
+
+echo "== Mount."
+_scratch_mount
+
+echo "== Show filesystem by label"
+$BTRFS_UTIL_PROG filesystem show $LABEL | _filter_btrfs_filesystem_show $TOTAL_DEVS
+UUID=`$BTRFS_UTIL_PROG filesystem show $LABEL | grep uuid: | awk '{print $NF}'`
+
+echo "UUID $UUID" >> $seq.full
+
+echo "== Show filesystem by UUID"
+$BTRFS_UTIL_PROG filesystem show $UUID | _filter_btrfs_filesystem_show $TOTAL_DEVS $UUID
+
+echo "== Sync filesystem"
+$BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT | _filter_scratch
+
+echo "== Show device stats by mountpoint"
+$BTRFS_UTIL_PROG device stats $SCRATCH_MNT | _filter_btrfs_device_stats $TOTAL_DEVS
+echo "== Show device stats by first/scratch dev"
+$BTRFS_UTIL_PROG device stats $SCRATCH_DEV | _filter_btrfs_device_stats
+echo "== Show device stats by second dev"
+$BTRFS_UTIL_PROG device stats $FIRST_POOL_DEV | sed -e "s,$FIRST_POOL_DEV,FIRST_POOL_DEV,g"
+echo "== Show device stats by last dev"
+$BTRFS_UTIL_PROG device stats $LAST_POOL_DEV | sed -e "s,$LAST_POOL_DEV,LAST_POOL_DEV,g"
+
+# success, all done
+status=0
+exit
diff --git a/313.out b/313.out
new file mode 100644
index 0000000..f513bdd
--- /dev/null
+++ b/313.out
@@ -0,0 +1,41 @@
+== QA output created by 313
+== Set filesystem label to TestLabel.313
+== Get filesystem label
+TestLabel.313
+== Mount.
+== Show filesystem by label
+Label: 'TestLabel.313'  uuid: <UUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Show filesystem by UUID
+Label: 'TestLabel.313'  uuid: <EXACTUUID>
+	Total devices <EXACTNUM> FS bytes used <SIZE>
+	devid     <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
+
+== Sync filesystem
+FSSync 'SCRATCH_MNT'
+== Show device stats by mountpoint
+      <NUMDEVS> [SCRATCH_DEV].corruption_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].flush_io_errs   <NUM>
+      <NUMDEVS> [SCRATCH_DEV].generation_errs <NUM>
+      <NUMDEVS> [SCRATCH_DEV].read_io_errs    <NUM>
+      <NUMDEVS> [SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by first/scratch dev
+[SCRATCH_DEV].corruption_errs <NUM>
+[SCRATCH_DEV].flush_io_errs   <NUM>
+[SCRATCH_DEV].generation_errs <NUM>
+[SCRATCH_DEV].read_io_errs    <NUM>
+[SCRATCH_DEV].write_io_errs   <NUM>
+== Show device stats by second dev
+[FIRST_POOL_DEV].write_io_errs   0
+[FIRST_POOL_DEV].read_io_errs    0
+[FIRST_POOL_DEV].flush_io_errs   0
+[FIRST_POOL_DEV].corruption_errs 0
+[FIRST_POOL_DEV].generation_errs 0
+== Show device stats by last dev
+[LAST_POOL_DEV].write_io_errs   0
+[LAST_POOL_DEV].read_io_errs    0
+[LAST_POOL_DEV].flush_io_errs   0
+[LAST_POOL_DEV].corruption_errs 0
+[LAST_POOL_DEV].generation_errs 0
diff --git a/btrfs.filter b/btrfs.filter
new file mode 100644
index 0000000..8a749bf
--- /dev/null
+++ b/btrfs.filter
@@ -0,0 +1,60 @@
+# Filters for btrfs command output
+
+. ./common.filter
+
+# Some, but not all, commands emit "Btrfs <version>"
+_filter_btrfs_version()
+{
+	sed -e "s/^Btrfs.*//g"
+}
+
+_filter_devid()
+{
+	sed -e "s/\(devid\s\+\)[0-9]\+/\1 <DEVID>/g"
+}
+
+# If passed a number as first arg, filter that number of devices
+# If passed a UUID as second arg, filter that exact UUID
+_filter_btrfs_filesystem_show()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		NUM_SUBST="<EXACTNUM>"
+	else
+		NUMDEVS="[0-9]\+"
+		NUM_SUBST="<NUM>"
+	fi
+
+	UUID=""
+	if [ ! -z $2 ]; then
+		UUID=$2
+	fi
+
+	# the uniq collapses all device lines into 1
+	_filter_uuid $UUID | _filter_scratch | _filter_scratch_pool | \
+	_filter_size | _filter_btrfs_version | _filter_devid | \
+	sed -e "s/\(Total devices\) $NUMDEVS/\1 $NUM_SUBST/g" | \
+	uniq
+}
+
+# This eliminates all numbers, and shows only unique lines,
+# to accomodate a varying nr. of devices.
+# If given an argument, make sure we saw that many devices
+# in total.
+_filter_btrfs_device_stats()
+{
+	if [ ! -z $1 ]; then
+		NUMDEVS=$1
+		UNIQ_OPT="-c"
+	else
+		NUMDEVS="thiswillnotmatch"
+		UNIQ_OPT=""
+	fi
+
+	_filter_scratch | _filter_scratch_pool | \
+	sed -e "s/[0-9]\+$/<NUM>/g" | sort | uniq $UNIQ_OPT | \
+	sed -e "s/$NUMDEVS /<NUMDEVS> /g"
+}
+
+# make sure this script returns success
+/bin/true
diff --git a/common.filter b/common.filter
index c854a98..c34809f 100644
--- a/common.filter
+++ b/common.filter
@@ -226,6 +226,13 @@ _filter_scratch()
 	sed -e "s,$SCRATCH_DEV,SCRATCH_DEV,g" -e "s,$SCRATCH_MNT,SCRATCH_MNT,g"
 }
 
+# Turn any device in the scratch pool into SCRATCH_DEV
+_filter_scratch_pool()
+{
+	FILTER_STRINGS=`echo $SCRATCH_DEV_POOL | sed -e 's/\s\+/\\\|/g'`
+	sed -e "s,$FILTER_STRINGS,SCRATCH_DEV,g"
+}
+
 _filter_spaces()
 {
        sed -e 's/ [ ]*/ /g'
@@ -238,5 +245,23 @@ _filter_ln()
 	    -e "s,failed to create,creating,"
 }
 
+# If given an arg, filter *that* UUID string
+# Otherwise look for something that looks like a generic UUID
+_filter_uuid()
+{
+	if [ ! -z $1 ]; then
+		UUID=$1
+		sed -e "s/\(uuid:\) $UUID/\1 <EXACTUUID>/i"
+	else
+		sed -e "s/\(uuid:\) *[0-9a-f-][0-9a-f-]*/\1 <UUID>/i"
+	fi
+}
+
+# Filter out sizes like 6.14MB etc
+_filter_size()
+{
+	sed -e "s/[0-9\.]\+\s\?[b|k|m|g|t][b]\?/<SIZE>/ig"
+}
+
 # make sure this script returns success
 /bin/true
diff --git a/group b/group
index 8096968..fcbdfb6 100644
--- a/group
+++ b/group
@@ -429,3 +429,4 @@ stress
 303 aio dangerous ioctl rw stress
 304 aio dangerous ioctl rw stress
 305 aio dangerous enospc rw stress
+313 auto quick

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


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

^ permalink raw reply related	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-13 19:01         ` Eric Sandeen
@ 2013-03-14 13:01           ` Rich Johnston
  -1 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-14 13:01 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, linux-btrfs, xfs, Stefan Behrens

Stefan,

Thanks for reviewing this patch, may I put your Reviewed-by: on this 
version?

Thanks
--Rich


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-14 13:01           ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-14 13:01 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, Stefan Behrens, linux-btrfs, xfs

Stefan,

Thanks for reviewing this patch, may I put your Reviewed-by: on this 
version?

Thanks
--Rich

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-14 13:01           ` Rich Johnston
@ 2013-03-14 13:35             ` Stefan Behrens
  -1 siblings, 0 replies; 44+ messages in thread
From: Stefan Behrens @ 2013-03-14 13:35 UTC (permalink / raw)
  To: Rich Johnston; +Cc: Eric Sandeen, linux-btrfs, xfs

On Thu, 14 Mar 2013 08:01:54 -0500, Rich Johnston wrote:
> Thanks for reviewing this patch, may I put your Reviewed-by: on this
> version?

Yes. Thanks.

Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>


^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-14 13:35             ` Stefan Behrens
  0 siblings, 0 replies; 44+ messages in thread
From: Stefan Behrens @ 2013-03-14 13:35 UTC (permalink / raw)
  To: Rich Johnston; +Cc: Eric Sandeen, linux-btrfs, xfs

On Thu, 14 Mar 2013 08:01:54 -0500, Rich Johnston wrote:
> Thanks for reviewing this patch, may I put your Reviewed-by: on this
> version?

Yes. Thanks.

Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 0/3] xfstests patches
  2013-03-13 14:57 [PATCH 0/3] xfstests patches Eric Sandeen
                   ` (2 preceding siblings ...)
  2013-03-13 14:57   ` Eric Sandeen
@ 2013-03-14 17:16 ` Rich Johnston
  2013-03-15  5:43   ` Dave Chinner
  3 siblings, 1 reply; 44+ messages in thread
From: Rich Johnston @ 2013-03-14 17:16 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs

On 03/13/2013 09:57 AM, Eric Sandeen wrote:
> 2 pretty simple ones, and a new btrfs test
>
> [PATCH 1/3] xfstests: add 274 to the prealloc group
> [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
> [PATCH 3/3] xfstests: btrfs tests for basic informational commands
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>

This series has been committed.

Thanks
--Rich

commit 2730c49a3e80426167e6f9984b070883dc51d4b6
Author: Eric Sandeen <sandeen@sandeen.net>
Date:   Wed Mar 13 19:01:58 2013 +0000

     xfstests: btrfs tests for basic informational commands

     Run basic btrfs information commands in various ways, performing
     sanity tests of: filesystem show, label, sync, and device stats
     (sync is included just because it's simple).  These are mostly
     just smoke tests, although for example show by label & UUID
     should verify that the correct fs was shown.

     This also adds quite a few new filters to accommodate the output
     of the new commands.

     Cc: linux-btrfs@vger.kernel.org
     Signed-off-by: Eric Sandeen <sandeen@redhat.com>
     Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
     Signed-off-by: <rjohnston@sgi.com>

commit d6e352916fbe835432bac2aa835bac440fe44287
Author: Eric Sandeen <sandeen@redhat.com>
Date:   Wed Mar 13 14:57:02 2013 +0000

     xfstests: keep newlines out of SCRATCH_DEV_POOL

     SCRATCH_DEV_POOL processing actually takes the first
     device out for SCRATCH_DEV and leaves the rest in
     SCRATCH_DEV_POOL.

     I'm not totally sold on that behavior, but for now,
     at least don't populate SCRATCH_DEV_POOL with newlines.

     Cc: linux-btrfs@vger.kernel.org
     Signed-off-by: Eric Sandeen <sandeen@redhat.com>
     Reviewed-by: <rjohnston@sgi.com>
     Signed-off-by: <rjohnston@sgi.com>

commit e279134e14800f1d7b34093a93e304b5bed7ec4d
Author: Eric Sandeen <sandeen@redhat.com>
Date:   Wed Mar 13 14:57:01 2013 +0000

     xfstests: add 274 to the prealloc group

     test 274 does preallocation tests but is not in the prealloc group.


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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 0/3] xfstests patches
  2013-03-14 17:16 ` [PATCH 0/3] xfstests patches Rich Johnston
@ 2013-03-15  5:43   ` Dave Chinner
  2013-03-15 13:38     ` Rich Johnston
  0 siblings, 1 reply; 44+ messages in thread
From: Dave Chinner @ 2013-03-15  5:43 UTC (permalink / raw)
  To: Rich Johnston; +Cc: Eric Sandeen, xfs

On Thu, Mar 14, 2013 at 12:16:12PM -0500, Rich Johnston wrote:
> On 03/13/2013 09:57 AM, Eric Sandeen wrote:
> >2 pretty simple ones, and a new btrfs test
> >
> >[PATCH 1/3] xfstests: add 274 to the prealloc group
> >[PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
> >[PATCH 3/3] xfstests: btrfs tests for basic informational commands
> >
> >_______________________________________________
> >xfs mailing list
> >xfs@oss.sgi.com
> >http://oss.sgi.com/mailman/listinfo/xfs
> >
> 
> This series has been committed.

Rich, can you please be careful to check the test numbers being used
in patches that are sent to the list before you commit them?

> >[PATCH 3/3] xfstests: btrfs tests for basic informational commands

This test was numbered 313, and so now we have tests 001-306 and 313
in the repository.  I noticed that Another of Eric's recent patches
is numbered 315, so it will also need renumbering before commit.

-Dave.
-- 
Dave Chinner
david@fromorbit.com

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-13 19:01         ` Eric Sandeen
@ 2013-03-15 10:16           ` Dave Chinner
  -1 siblings, 0 replies; 44+ messages in thread
From: Dave Chinner @ 2013-03-15 10:16 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, linux-btrfs, xfs

On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
> Run basic btrfs information commands in various ways, performing
> sanity tests of: filesystem show, label, sync, and device stats
> (sync is included just because it's simple).  These are mostly
> just smoke tests, although for example show by label & UUID
> should verify that the correct fs was shown.
> 
> This also adds quite a few new filters to accommodate the output
> of the new commands.
> 
> Cc: linux-btrfs@vger.kernel.org
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> V2: sort & uniq device stats output to account for variable
> nrs. of devices.  Optionally check that the proper nr. of
> devices was returned, as well.
> 
> V3: _filter_uuid needs to pay attention to $1, not hope
> that the caller has set $UUID.  Oops.
> 
> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.

Something I just noticed in this commit:

> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./btrfs.filter

That should probably have been named "common.filter.btrfs".
I found this updating my patchset that moves all the common.* files
into a common/ directory....

I'll rename it to common/filter.btrfs....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-15 10:16           ` Dave Chinner
  0 siblings, 0 replies; 44+ messages in thread
From: Dave Chinner @ 2013-03-15 10:16 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, linux-btrfs, xfs

On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
> Run basic btrfs information commands in various ways, performing
> sanity tests of: filesystem show, label, sync, and device stats
> (sync is included just because it's simple).  These are mostly
> just smoke tests, although for example show by label & UUID
> should verify that the correct fs was shown.
> 
> This also adds quite a few new filters to accommodate the output
> of the new commands.
> 
> Cc: linux-btrfs@vger.kernel.org
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> 
> V2: sort & uniq device stats output to account for variable
> nrs. of devices.  Optionally check that the proper nr. of
> devices was returned, as well.
> 
> V3: _filter_uuid needs to pay attention to $1, not hope
> that the caller has set $UUID.  Oops.
> 
> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.

Something I just noticed in this commit:

> +# get standard environment, filters and checks
> +. ./common.rc
> +. ./btrfs.filter

That should probably have been named "common.filter.btrfs".
I found this updating my patchset that moves all the common.* files
into a common/ directory....

I'll rename it to common/filter.btrfs....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 0/3] xfstests patches
  2013-03-15  5:43   ` Dave Chinner
@ 2013-03-15 13:38     ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-15 13:38 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Eric Sandeen, xfs

On 03/15/2013 12:43 AM, Dave Chinner wrote:
> On Thu, Mar 14, 2013 at 12:16:12PM -0500, Rich Johnston wrote:
>> On 03/13/2013 09:57 AM, Eric Sandeen wrote:
>>> 2 pretty simple ones, and a new btrfs test
>>>
>>> [PATCH 1/3] xfstests: add 274 to the prealloc group
>>> [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL
>>> [PATCH 3/3] xfstests: btrfs tests for basic informational commands
>>>
>>> _______________________________________________
>>> xfs mailing list
>>> xfs@oss.sgi.com
>>> http://oss.sgi.com/mailman/listinfo/xfs
>>>
>>
>> This series has been committed.
>
> Rich, can you please be careful to check the test numbers being used
> in patches that are sent to the list before you commit them?
>
>>> [PATCH 3/3] xfstests: btrfs tests for basic informational commands
>
> This test was numbered 313, and so now we have tests 001-306 and 313
> in the repository.  I noticed that Another of Eric's recent patches
> is numbered 315, so it will also need renumbering before commit.
>
> -Dave.
>
Yes I will, sorry it applied so cleanly and I was trying to get it 
committed before I left for the day I overlooked the numbering.  I will 
revert and recommit it with the correct number 306.  Thanks for pointing 
that out.

Regards
--Rich

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-15 10:16           ` Dave Chinner
@ 2013-03-15 13:46             ` Eric Sandeen
  -1 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-15 13:46 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

Yep sorry.  I figure its always a race in numbers do I don't bother with fixing them up.  Should I?

On Mar 15, 2013, at 5:16 AM, Dave Chinner <david@fromorbit.com> wrote:

> On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
>> Run basic btrfs information commands in various ways, performing
>> sanity tests of: filesystem show, label, sync, and device stats
>> (sync is included just because it's simple).  These are mostly
>> just smoke tests, although for example show by label & UUID
>> should verify that the correct fs was shown.
>> 
>> This also adds quite a few new filters to accommodate the output
>> of the new commands.
>> 
>> Cc: linux-btrfs@vger.kernel.org
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>> 
>> V2: sort & uniq device stats output to account for variable
>> nrs. of devices.  Optionally check that the proper nr. of
>> devices was returned, as well.
>> 
>> V3: _filter_uuid needs to pay attention to $1, not hope
>> that the caller has set $UUID.  Oops.
>> 
>> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.
> 
> Something I just noticed in this commit:
> 
>> +# get standard environment, filters and checks
>> +. ./common.rc
>> +. ./btrfs.filter
> 
> That should probably have been named "common.filter.btrfs".
> I found this updating my patchset that moves all the common.* files
> into a common/ directory....
> 
> I'll rename it to common/filter.btrfs....
> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-15 13:46             ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-15 13:46 UTC (permalink / raw)
  To: Dave Chinner; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

Yep sorry.  I figure its always a race in numbers do I don't bother with fixing them up.  Should I?

On Mar 15, 2013, at 5:16 AM, Dave Chinner <david@fromorbit.com> wrote:

> On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
>> Run basic btrfs information commands in various ways, performing
>> sanity tests of: filesystem show, label, sync, and device stats
>> (sync is included just because it's simple).  These are mostly
>> just smoke tests, although for example show by label & UUID
>> should verify that the correct fs was shown.
>> 
>> This also adds quite a few new filters to accommodate the output
>> of the new commands.
>> 
>> Cc: linux-btrfs@vger.kernel.org
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> ---
>> 
>> V2: sort & uniq device stats output to account for variable
>> nrs. of devices.  Optionally check that the proper nr. of
>> devices was returned, as well.
>> 
>> V3: _filter_uuid needs to pay attention to $1, not hope
>> that the caller has set $UUID.  Oops.
>> 
>> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.
> 
> Something I just noticed in this commit:
> 
>> +# get standard environment, filters and checks
>> +. ./common.rc
>> +. ./btrfs.filter
> 
> That should probably have been named "common.filter.btrfs".
> I found this updating my patchset that moves all the common.* files
> into a common/ directory....
> 
> I'll rename it to common/filter.btrfs....
> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> david@fromorbit.com
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-15 13:46             ` Eric Sandeen
@ 2013-03-15 14:23               ` Rich Johnston
  -1 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-15 14:23 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Dave Chinner, Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

On 03/15/2013 08:46 AM, Eric Sandeen wrote:
> Yep sorry.  I figure its always a race in numbers do I don't bother with fixing them up.  Should I?
>

Eric,
I was going to revert and resubmit as test 306, is that OK with you?

> On Mar 15, 2013, at 5:16 AM, Dave Chinner <david@fromorbit.com> wrote:
>
>> On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
>>> Run basic btrfs information commands in various ways, performing
>>> sanity tests of: filesystem show, label, sync, and device stats
>>> (sync is included just because it's simple).  These are mostly
>>> just smoke tests, although for example show by label & UUID
>>> should verify that the correct fs was shown.
>>>
>>> This also add2730c49a3s quite a few new filters to accommodate the output
>>> of the new commands.
>>>
>>> Cc: linux-btrfs@vger.kernel.org
>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>> ---
>>>
>>> V2: sort & uniq device stats output to account for variable
>>> nrs. of devices.  Optionally check that the proper nr. of
>>> devices was returned, as well.
>>>
>>> V3: _filter_uuid needs to pay attention to $1, not hope
>>> that the caller has set $UUID.  Oops.
>>>
>>> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.
>>
>> Something I just noticed in this commit:
>>
>>> +# get standard environment, filters and checks
>>> +. ./common.rc
>>> +. ./btrfs.filter
>>
>> That should probably have been named "common.filter.btrfs".

Dave,
Do you want me to rename btrfs.filter to common.filter.btrfs when I 
resubmit this patch?

Regards
--Rich

>> I found this updating my patchset that moves all the common.* files
>> into a common/ directory....
>>
>> I'll rename it to common/filter.btrfs....
>>
>> Cheers,
>>
>> Dave.
>> --
>> Dave Chinner
>> david@fromorbit.com
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-15 14:23               ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-15 14:23 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, linux-btrfs, xfs

On 03/15/2013 08:46 AM, Eric Sandeen wrote:
> Yep sorry.  I figure its always a race in numbers do I don't bother with fixing them up.  Should I?
>

Eric,
I was going to revert and resubmit as test 306, is that OK with you?

> On Mar 15, 2013, at 5:16 AM, Dave Chinner <david@fromorbit.com> wrote:
>
>> On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
>>> Run basic btrfs information commands in various ways, performing
>>> sanity tests of: filesystem show, label, sync, and device stats
>>> (sync is included just because it's simple).  These are mostly
>>> just smoke tests, although for example show by label & UUID
>>> should verify that the correct fs was shown.
>>>
>>> This also add2730c49a3s quite a few new filters to accommodate the output
>>> of the new commands.
>>>
>>> Cc: linux-btrfs@vger.kernel.org
>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>> ---
>>>
>>> V2: sort & uniq device stats output to account for variable
>>> nrs. of devices.  Optionally check that the proper nr. of
>>> devices was returned, as well.
>>>
>>> V3: _filter_uuid needs to pay attention to $1, not hope
>>> that the caller has set $UUID.  Oops.
>>>
>>> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.
>>
>> Something I just noticed in this commit:
>>
>>> +# get standard environment, filters and checks
>>> +. ./common.rc
>>> +. ./btrfs.filter
>>
>> That should probably have been named "common.filter.btrfs".

Dave,
Do you want me to rename btrfs.filter to common.filter.btrfs when I 
resubmit this patch?

Regards
--Rich

>> I found this updating my patchset that moves all the common.* files
>> into a common/ directory....
>>
>> I'll rename it to common/filter.btrfs....
>>
>> Cheers,
>>
>> Dave.
>> --
>> Dave Chinner
>> david@fromorbit.com
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
>


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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-15 14:23               ` Rich Johnston
@ 2013-03-15 14:36                 ` Eric Sandeen
  -1 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-15 14:36 UTC (permalink / raw)
  To: Rich Johnston; +Cc: Eric Sandeen, Dave Chinner, Eric Sandeen, linux-btrfs, xfs

On Mar 15, 2013, at 9:23 AM, Rich Johnston <rjohnston@sgi.com> wrote:

> On 03/15/2013 08:46 AM, Eric Sandeen wrote:
>> Yep sorry.  I figure its always a race in numbers do I don't bother with fixing them up.  Should I?
> 
> Eric,
> I was going to revert and resubmit as test 306, is that OK with you?
> 
Sure, of course.

Thanks,
Eric

>> On Mar 15, 2013, at 5:16 AM, Dave Chinner <david@fromorbit.com> wrote:
>> 
>>> On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
>>>> Run basic btrfs information commands in various ways, performing
>>>> sanity tests of: filesystem show, label, sync, and device stats
>>>> (sync is included just because it's simple).  These are mostly
>>>> just smoke tests, although for example show by label & UUID
>>>> should verify that the correct fs was shown.
>>>> 
>>>> This also add2730c49a3s quite a few new filters to accommodate the output
>>>> of the new commands.
>>>> 
>>>> Cc: linux-btrfs@vger.kernel.org
>>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>>> ---
>>>> 
>>>> V2: sort & uniq device stats output to account for variable
>>>> nrs. of devices.  Optionally check that the proper nr. of
>>>> devices was returned, as well.
>>>> 
>>>> V3: _filter_uuid needs to pay attention to $1, not hope
>>>> that the caller has set $UUID.  Oops.
>>>> 
>>>> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.
>>> 
>>> Something I just noticed in this commit:
>>> 
>>>> +# get standard environment, filters and checks
>>>> +. ./common.rc
>>>> +. ./btrfs.filter
>>> 
>>> That should probably have been named "common.filter.btrfs".
> 
> Dave,
> Do you want me to rename btrfs.filter to common.filter.btrfs when I resubmit this patch?
> 
> Regards
> --Rich
> 
>>> I found this updating my patchset that moves all the common.* files
>>> into a common/ directory....
>>> 
>>> I'll rename it to common/filter.btrfs....
>>> 
>>> Cheers,
>>> 
>>> Dave.
>>> --
>>> Dave Chinner
>>> david@fromorbit.com
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
>> _______________________________________________
>> xfs mailing list
>> xfs@oss.sgi.com
>> http://oss.sgi.com/mailman/listinfo/xfs
> 
> 

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-15 14:36                 ` Eric Sandeen
  0 siblings, 0 replies; 44+ messages in thread
From: Eric Sandeen @ 2013-03-15 14:36 UTC (permalink / raw)
  To: Rich Johnston; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

On Mar 15, 2013, at 9:23 AM, Rich Johnston <rjohnston@sgi.com> wrote:

> On 03/15/2013 08:46 AM, Eric Sandeen wrote:
>> Yep sorry.  I figure its always a race in numbers do I don't bother with fixing them up.  Should I?
> 
> Eric,
> I was going to revert and resubmit as test 306, is that OK with you?
> 
Sure, of course.

Thanks,
Eric

>> On Mar 15, 2013, at 5:16 AM, Dave Chinner <david@fromorbit.com> wrote:
>> 
>>> On Wed, Mar 13, 2013 at 02:01:58PM -0500, Eric Sandeen wrote:
>>>> Run basic btrfs information commands in various ways, performing
>>>> sanity tests of: filesystem show, label, sync, and device stats
>>>> (sync is included just because it's simple).  These are mostly
>>>> just smoke tests, although for example show by label & UUID
>>>> should verify that the correct fs was shown.
>>>> 
>>>> This also add2730c49a3s quite a few new filters to accommodate the output
>>>> of the new commands.
>>>> 
>>>> Cc: linux-btrfs@vger.kernel.org
>>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>>> ---
>>>> 
>>>> V2: sort & uniq device stats output to account for variable
>>>> nrs. of devices.  Optionally check that the proper nr. of
>>>> devices was returned, as well.
>>>> 
>>>> V3: _filter_uuid needs to pay attention to $1, not hope
>>>> that the caller has set $UUID.  Oops.
>>>> 
>>>> V4: fix stats filter to set UNIQ_OPT in both cases, ugh.
>>> 
>>> Something I just noticed in this commit:
>>> 
>>>> +# get standard environment, filters and checks
>>>> +. ./common.rc
>>>> +. ./btrfs.filter
>>> 
>>> That should probably have been named "common.filter.btrfs".
> 
> Dave,
> Do you want me to rename btrfs.filter to common.filter.btrfs when I resubmit this patch?
> 
> Regards
> --Rich
> 
>>> I found this updating my patchset that moves all the common.* files
>>> into a common/ directory....
>>> 
>>> I'll rename it to common/filter.btrfs....
>>> 
>>> Cheers,
>>> 
>>> Dave.
>>> --
>>> Dave Chinner
>>> david@fromorbit.com
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
>> _______________________________________________
>> xfs mailing list
>> xfs@oss.sgi.com
>> http://oss.sgi.com/mailman/listinfo/xfs
> 
> 

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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-15 14:36                 ` Eric Sandeen
@ 2013-03-18 13:30                   ` Rich Johnston
  -1 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-18 13:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, Dave Chinner, Eric Sandeen, linux-btrfs, xfs

Dave,

Sorry for skipping test numbers,  I was going to revert, correct the 
test number and resubmit this patch.
Do you want me to rename btrfs.filter to common.filter.btrfs when I
resubmit this patch?

Regards
--Rich



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-18 13:30                   ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-18 13:30 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs

Dave,

Sorry for skipping test numbers,  I was going to revert, correct the 
test number and resubmit this patch.
Do you want me to rename btrfs.filter to common.filter.btrfs when I
resubmit this patch?

Regards
--Rich


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

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
  2013-03-15 14:36                 ` Eric Sandeen
@ 2013-03-19 14:15                   ` Rich Johnston
  -1 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-19 14:15 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, Dave Chinner, Eric Sandeen, linux-btrfs, xfs


This has been reverted and recommitted as test 307.

Thanks
--Rich

commit 4f092a2e681c57394a0055a0735b8208bf83ec5f
Author: Eric Sandeen <sandeen@sandeen.net>
Date:   Wed Mar 13 19:01:58 2013 +0000

     xfstests: btrfs tests for basic informational commands

     Run basic btrfs information commands in various ways, performing
     sanity tests of: filesystem show, label, sync, and device stats
     (sync is included just because it's simple).  These are mostly
     just smoke tests, although for example show by label & UUID
     should verify that the correct fs was shown.

     This also adds quite a few new filters to accommodate the output
     of the new commands.

     Cc: linux-btrfs@vger.kernel.org
     Signed-off-by: Eric Sandeen <sandeen@redhat.com>
     Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
     Signed-off-by: Rich Johnston <rjohnston@sgi.com>

commit 609b6f18b87bc19c5251c45342e0678cfbf0618c
Author: Rich Johnston <rjohnston@sgi.com>
Date:   Tue Mar 19 08:13:12 2013 -0500

     Revert "xfstests: btrfs tests for basic informational commands"

     This reverts commit 2730c49a3e80426167e6f9984b070883dc51d4b6.

     Test number was not sequential.

     Conflicts:

         group



^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 3/3 V4] xfstests: btrfs tests for basic informational commands
@ 2013-03-19 14:15                   ` Rich Johnston
  0 siblings, 0 replies; 44+ messages in thread
From: Rich Johnston @ 2013-03-19 14:15 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Eric Sandeen, Eric Sandeen, linux-btrfs, xfs


This has been reverted and recommitted as test 307.

Thanks
--Rich

commit 4f092a2e681c57394a0055a0735b8208bf83ec5f
Author: Eric Sandeen <sandeen@sandeen.net>
Date:   Wed Mar 13 19:01:58 2013 +0000

     xfstests: btrfs tests for basic informational commands

     Run basic btrfs information commands in various ways, performing
     sanity tests of: filesystem show, label, sync, and device stats
     (sync is included just because it's simple).  These are mostly
     just smoke tests, although for example show by label & UUID
     should verify that the correct fs was shown.

     This also adds quite a few new filters to accommodate the output
     of the new commands.

     Cc: linux-btrfs@vger.kernel.org
     Signed-off-by: Eric Sandeen <sandeen@redhat.com>
     Reviewed-by: Stefan Behrens <sbehrens@giantdisaster.de>
     Signed-off-by: Rich Johnston <rjohnston@sgi.com>

commit 609b6f18b87bc19c5251c45342e0678cfbf0618c
Author: Rich Johnston <rjohnston@sgi.com>
Date:   Tue Mar 19 08:13:12 2013 -0500

     Revert "xfstests: btrfs tests for basic informational commands"

     This reverts commit 2730c49a3e80426167e6f9984b070883dc51d4b6.

     Test number was not sequential.

     Conflicts:

         group


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

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2013-03-19 14:15 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-13 14:57 [PATCH 0/3] xfstests patches Eric Sandeen
2013-03-13 14:57 ` [PATCH 1/3] xfstests: add 274 to the prealloc group Eric Sandeen
2013-03-13 17:36   ` Rich Johnston
2013-03-13 14:57 ` [PATCH 2/3] xfstests: keep newlines out of SCRATCH_DEV_POOL Eric Sandeen
2013-03-13 14:57   ` Eric Sandeen
2013-03-13 17:43   ` Rich Johnston
2013-03-13 17:43     ` Rich Johnston
2013-03-13 17:45     ` Eric Sandeen
2013-03-13 17:45       ` Eric Sandeen
2013-03-13 14:57 ` [PATCH 3/3] xfstests: btrfs tests for basic informational commands Eric Sandeen
2013-03-13 14:57   ` Eric Sandeen
2013-03-13 15:32   ` Stefan Behrens
2013-03-13 15:32     ` Stefan Behrens
2013-03-13 16:17     ` Eric Sandeen
2013-03-13 16:17       ` Eric Sandeen
2013-03-13 17:47       ` Rich Johnston
2013-03-13 17:47         ` Rich Johnston
2013-03-13 16:38   ` [PATCH 3/3 V2] " Eric Sandeen
2013-03-13 16:38     ` Eric Sandeen
2013-03-13 18:53     ` [PATCH 3/3 V3] " Eric Sandeen
2013-03-13 18:53       ` Eric Sandeen
2013-03-13 19:00       ` Stefan Behrens
2013-03-13 19:00         ` Stefan Behrens
2013-03-13 19:01       ` [PATCH 3/3 V4] " Eric Sandeen
2013-03-13 19:01         ` Eric Sandeen
2013-03-14 13:01         ` Rich Johnston
2013-03-14 13:01           ` Rich Johnston
2013-03-14 13:35           ` Stefan Behrens
2013-03-14 13:35             ` Stefan Behrens
2013-03-15 10:16         ` Dave Chinner
2013-03-15 10:16           ` Dave Chinner
2013-03-15 13:46           ` Eric Sandeen
2013-03-15 13:46             ` Eric Sandeen
2013-03-15 14:23             ` Rich Johnston
2013-03-15 14:23               ` Rich Johnston
2013-03-15 14:36               ` Eric Sandeen
2013-03-15 14:36                 ` Eric Sandeen
2013-03-18 13:30                 ` Rich Johnston
2013-03-18 13:30                   ` Rich Johnston
2013-03-19 14:15                 ` Rich Johnston
2013-03-19 14:15                   ` Rich Johnston
2013-03-14 17:16 ` [PATCH 0/3] xfstests patches Rich Johnston
2013-03-15  5:43   ` Dave Chinner
2013-03-15 13:38     ` Rich Johnston

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.