xfstests: use a common _filter_scratch function

There are a number of tests that use a shell function called
"filter_scratch" or "_filter_scratch" in order to have the actual
scratch device or mount point show up in test output with a symbolic
name.  There are two sets, each following a slightly different
convention.  Put a common _filter_scratch function definition in
"common.filter" and have all test scripts use that instead.
Choosing one of the two conventions meant that a few test output
files had to be changed.

In addition, add a call to _filter_scratch to test 185, and update
its output accordingly.

Signed-off-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Alex Elder
2010-10-21 19:00:08 +00:00
parent bd77e7c5bf
commit 580b0a9386
19 changed files with 90 additions and 162 deletions
+5 -13
View File
@@ -37,14 +37,6 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
. ./common.filter
. ./common.quota
filter_scratch()
{
perl -ne "
s,$SCRATCH_MNT,[SCR_MNT],;
s,$SCRATCH_DEV,[SCR_DEV],;
print;"
}
# real QA test starts here
_supported_fs xfs
_supported_os Linux #IRIX
@@ -59,7 +51,7 @@ test_files()
chown $uid $SCRATCH_MNT/{buffer,direct,mmap}
chgrp $gid $SCRATCH_MNT/{buffer,direct,mmap}
for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
$here/src/lstat64 $file | head -3 | filter_scratch
$here/src/lstat64 $file | head -3 | _filter_scratch
$XFS_IO_PROG -c lsproj $file
done
}
@@ -78,11 +70,11 @@ test_accounting()
echo "--- completed parallel IO ($type)" >>$seq.full
for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
$here/src/lstat64 $file | head -3 | filter_scratch
$here/src/lstat64 $file | head -3 | _filter_scratch
done
xfs_quota -c "quota -hnb -$type $id" $QARGS | filter_scratch
xfs_quota -c "quota -hni -$type $id" $QARGS | filter_scratch
xfs_quota -c "quota -hnr -$type $id" $QARGS | filter_scratch
xfs_quota -c "quota -hnb -$type $id" $QARGS | _filter_scratch
xfs_quota -c "quota -hni -$type $id" $QARGS | _filter_scratch
xfs_quota -c "quota -hnr -$type $id" $QARGS | _filter_scratch
}
export MOUNT_OPTIONS="-opquota"