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
+3 -11
View File
@@ -40,14 +40,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 generic
_supported_os Linux #IRIX
@@ -96,19 +88,19 @@ test_enforcement()
setquota -$type $qa_user 0 0 3 5 $SCRATCH_MNT
echo "Touch 3+4"
su $qa_user -c "touch $SCRATCH_MNT/file3 $SCRATCH_MNT/file4" \
2>&1 >>$seq.full | filter_scratch | tee -a $seq.full
2>&1 >>$seq.full | _filter_scratch | tee -a $seq.full
repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seq.full 2>&1
# Try to exceed inode hardlimit
echo "Touch 5+6"
su $qa_user -c "touch $SCRATCH_MNT/file5 $SCRATCH_MNT/file6" \
2>&1 >>$seq.full | filter_scratch | tee -a $seq.full
2>&1 >>$seq.full | _filter_scratch | tee -a $seq.full
repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seq.full 2>&1
# Wait and check grace time enforcement
rm -f $SCRATCH_MNT/file5 >>$seq.full 2>&1
sleep $((grace+1))
echo "Touch 5"
su $qa_user -c "touch $SCRATCH_MNT/file5" 2>&1 >>$seq.full |
filter_scratch | tee -a $seq.full
_filter_scratch | tee -a $seq.full
repquota -$type $SCRATCH_MNT | grep -v "^root" >>$seq.full 2>&1
echo "--- completed IO ($type)" >>$seq.full
}