xfstests: ENOSPC Punch Hole: Move su routines in 123 to common.rc

This patch moves the su routines in test 123 to common.rc so that
they can also be used in the new test 256

Signed-off-by: Allison Henderson <achender@linux.vnet.ibm.com>
Signed-off-by: Alex Elder <aelder@sgi.com>
This commit is contained in:
Allison Henderson
2011-06-28 14:45:00 +00:00
committed by Alex Elder
parent ced9681ea4
commit 5c6a8cb5af
2 changed files with 20 additions and 24 deletions
-24
View File
@@ -42,30 +42,6 @@ _cleanup()
_cleanup_testdir
}
_filter_user_do()
{
perl -ne "
s,.*Permission\sdenied.*,Permission denied,;
s,.*no\saccess\sto\stty.*,,;
s,.*no\sjob\scontrol\sin\sthis\sshell.*,,;
s,^\s*$,,;
print;"
}
_user_do()
{
if [ "$HOSTOS" == "IRIX" ]
then
echo $1 | /bin/bash "su $qa_user 2>&1" | _filter_user_do
else
echo $1 | su $qa_user 2>&1 | _filter_user_do
fi
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
+20
View File
@@ -867,6 +867,26 @@ _require_user()
[ "$?" == "0" ] || _notrun "$qa_user user not defined."
}
_filter_user_do()
{
perl -ne "
s,.*Permission\sdenied.*,Permission denied,;
s,.*no\saccess\sto\stty.*,,;
s,.*no\sjob\scontrol\sin\sthis\sshell.*,,;
s,^\s*$,,;
print;"
}
_user_do()
{
if [ "$HOSTOS" == "IRIX" ]
then
echo $1 | /bin/bash "su $qa_user 2>&1" | _filter_user_do
else
echo $1 | su $qa_user 2>&1 | _filter_user_do
fi
}
# check that xfs_io, glibc, kernel, and filesystem all (!) support
# fallocate
#