xfstests: introduce a common directory

Introduce a top level common directory and move all the common.*
files into it.  Because there is now a directory named common, the
prefix can be dropped from all the files. Convert all the tests to
use this new directory for including common files.

for f in common.*; do \
	git mv `echo -n "$f " ; echo $f | sed -e 's;n\.;n/;'` \
done

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Phil White <pwhite@sgi.com>
[rjohnston@sgi.com reworked for TOT changes]
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
Dave Chinner
2013-03-15 12:28:04 +00:00
committed by Rich Johnston
parent 401680a11c
commit 8c4905a42e
322 changed files with 727 additions and 727 deletions
+60
View File
@@ -0,0 +1,60 @@
# Filters for btrfs command output
. ./common.filter.btrfs
# 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