patch more_set_prog_path

This commit is contained in:
Eric Sandeen
2009-04-19 15:48:48 -05:00
parent 1525236a3b
commit b2fcff900d
11 changed files with 91 additions and 84 deletions
+7 -7
View File
@@ -35,7 +35,7 @@ _filter()
_attr()
{
attr $* 2>$tmp.err >$tmp.out
$ATTR_PROG $* 2>$tmp.err >$tmp.out
exit=$?
_filter $tmp.out
_filter $tmp.err 1>&2
@@ -44,7 +44,7 @@ _attr()
_getfattr()
{
getfattr $* 2>$tmp.err >$tmp.out
$GETFATTR_PROG $* 2>$tmp.err >$tmp.out
exit=$?
_filter $tmp.out
_filter $tmp.err 1>&2
@@ -68,8 +68,8 @@ _attr_list()
_supported_fs xfs udf
_supported_os Linux
[ -x /usr/bin/attr ] || _notrun "attr is not installed"
[ -x /usr/bin/getfattr ] || _notrun "getfattr is not installed"
[ -x $ATTR_PROG ] || _notrun "attr is not installed"
[ -x $GETFATTR_PROG ] || _notrun "getfattr is not installed"
_setup_testdir
@@ -107,7 +107,7 @@ echo "*** add lots of attributes"
v=0
while [ $v -lt 1000 ]
do
echo "value_$v" | attr -s "attribute_$v" $testfile >>$seq.full
echo "value_$v" | $ATTR_PROG -s "attribute_$v" $testfile >>$seq.full
if [ $? -ne 0 ]
then
echo "!!! failed to add \"attribute_$v\""
@@ -119,7 +119,7 @@ done
echo "*** check"
# don't print it all out...
getfattr --absolute-names $testfile \
$GETFATTR_PROG --absolute-names $testfile \
| tee -a $seq.full \
| $AWK_PROG '
/^#/ { next }
@@ -131,7 +131,7 @@ echo "*** remove lots of attributes"
v=0
while [ $v -lt 1000 ]
do
if ! attr -r "attribute_$v" $testfile >>$seq.full
if ! $ATTR_PROG -r "attribute_$v" $testfile >>$seq.full
then
echo "!!! failed to remove \"attribute_$v\""
exit 1
+4 -4
View File
@@ -30,7 +30,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_attr()
{
attr $* 2>$tmp.err >$tmp.out
$ATTR_PROG $* 2>$tmp.err >$tmp.out
exit=$?
sed \
-e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
@@ -45,7 +45,7 @@ _attr()
_getfattr()
{
getfattr $* 2>$tmp.err >$tmp.out
$GETFATTR_PROG $* 2>$tmp.err >$tmp.out
exit=$?
sed \
-e "s#$SCRATCH_MNT[^ .:]*#<TESTFILE>#g" \
@@ -62,8 +62,8 @@ _getfattr()
_supported_fs xfs
_supported_os Linux
[ -x /usr/bin/attr ] || _notrun "attr is not installed"
[ -x /usr/bin/getfattr ] || _notrun "getfattr is not installed"
[ -x $ATTR_PROG ] || _notrun "attr is not installed"
[ -x $GETFATTR_PROG ] || _notrun "getfattr is not installed"
_require_scratch
+55 -55
View File
@@ -59,7 +59,7 @@ _cleanup()
_supported_fs xfs udf
_supported_os Linux
[ -x /usr/bin/chacl ] || _notrun "chacl executable not found"
[ -x $CHACL_PROG ] || _notrun "chacl executable not found"
[ -x $runas ] || _notrun "$runas executable not found"
rm -f $seq.full
@@ -98,25 +98,25 @@ _acl_ls file1
echo ""
echo "--- Test get and set of ACL ---"
echo "Note: Old interface gave an empty ACL - now output an ACL"
chacl -l file1 | _acl_filter_id
$CHACL_PROG -l file1 | _acl_filter_id
echo "Try using single colon separator"
echo "Note: Old interface FAILed because of single colon - new one allows it"
chacl u::r--,g::rwx,o:rw- file1 2>&1
$CHACL_PROG u::r--,g::rwx,o:rw- file1 2>&1
echo "Expect to PASS"
chacl u::r--,g::rwx,o::rw- file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG u::r--,g::rwx,o::rw- file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
echo ""
echo "--- Test sync of ACL with std permissions ---"
_acl_ls file1
chmod u+w file1
_acl_ls file1
chacl -l file1 | _acl_filter_id
$CHACL_PROG -l file1 | _acl_filter_id
echo ""
echo "--- Test owner permissions ---"
chacl u::r-x,g::---,o::--- file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG u::r-x,g::---,o::--- file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
# change to owner
echo "Expect to PASS"
$runas -u $acl1 -g $acl1 ./file1 2>&1
@@ -125,8 +125,8 @@ $runas -u $acl2 -g $acl2 ./file1 2>&1
echo ""
echo "--- Test group permissions ---"
chacl u::---,g::r-x,o::--- file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG u::---,g::r-x,o::--- file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
echo "Expect to FAIL - acl1 is owner"
$runas -u $acl1 -g $acl1 ./file1 2>&1
echo "Expect to PASS - acl2 matches group"
@@ -138,8 +138,8 @@ $runas -u $acl3 -g $acl3 ./file1 2>&1
echo ""
echo "--- Test other permissions ---"
chacl u::---,g::---,o::r-x file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG u::---,g::---,o::r-x file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
echo "Expect to FAIL - acl1 is owner"
$runas -u $acl1 -g $acl1 ./file1 2>&1
echo "Expect to FAIL - acl2 is in group"
@@ -157,12 +157,12 @@ echo "=== Test Extended ACLs ==="
echo ""
echo "--- Test adding a USER ACE ---"
echo "Expect to FAIL as no MASK provided"
chacl u::---,g::---,o::---,u:$acl2:r-x file1 2>&1 | _acl_filter_id
$CHACL_PROG u::---,g::---,o::---,u:$acl2:r-x file1 2>&1 | _acl_filter_id
echo "Ensure that ACL has not been changed"
chacl -l file1 | _acl_filter_id
$CHACL_PROG -l file1 | _acl_filter_id
echo "Expect to PASS - USER ACE matches user"
chacl u::---,g::---,o::---,u:$acl2:r-x,m::rwx file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG u::---,g::---,o::---,u:$acl2:r-x,m::rwx file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
$runas -u $acl2 -g $acl2 ./file1 2>&1
echo "Expect to FAIL - USER ACE does not match user"
$runas -u $acl3 -g $acl3 ./file1 2>&1
@@ -170,11 +170,11 @@ $runas -u $acl3 -g $acl3 ./file1 2>&1
echo ""
echo "--- Test adding a GROUP ACE ---"
echo "Expect to FAIL as no MASK provided"
chacl u::---,g::---,o::---,g:$acl2:r-x file1 2>&1 | _acl_filter_id
$CHACL_PROG u::---,g::---,o::---,g:$acl2:r-x file1 2>&1 | _acl_filter_id
echo "Ensure that ACL has not been changed"
chacl -l file1 | _acl_filter_id
chacl u::---,g::---,o::---,g:$acl2:r-x,m::rwx file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG -l file1 | _acl_filter_id
$CHACL_PROG u::---,g::---,o::---,g:$acl2:r-x,m::rwx file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
echo "Expect to PASS - GROUP ACE matches group"
$runas -u $acl2 -g $acl2 ./file1 2>&1
echo "Expect to PASS - GROUP ACE matches sup group"
@@ -188,18 +188,18 @@ echo ""
echo "--- Test MASK ---"
# group
chacl u::---,g::---,o::---,g:$acl2:r-x,m::-w- file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG u::---,g::---,o::---,g:$acl2:r-x,m::-w- file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
echo "Expect to FAIL as MASK prohibits execution"
$runas -u $acl2 -g $acl2 ./file1 2>&1
# user
chacl u::---,g::---,o::---,u:$acl2:r-x,m::-w- file1 2>&1
$CHACL_PROG u::---,g::---,o::---,u:$acl2:r-x,m::-w- file1 2>&1
echo "Expect to FAIL as MASK prohibits execution"
$runas -u $acl2 -g $acl2 ./file1 2>&1
# user
chacl u::---,g::---,o::---,u:$acl2:r-x,m::r-x file1 2>&1
$CHACL_PROG u::---,g::---,o::---,u:$acl2:r-x,m::r-x file1 2>&1
echo "Expect to PASS as MASK allows execution"
$runas -u $acl2 -g $acl2 ./file1 2>&1
@@ -208,11 +208,11 @@ $runas -u $acl2 -g $acl2 ./file1 2>&1
echo ""
echo "--- Test ACE priority ---"
chacl o::rwx,g::rwx,u:$acl1:rwx,u::---,m::rwx file1 2>&1
$CHACL_PROG o::rwx,g::rwx,u:$acl1:rwx,u::---,m::rwx file1 2>&1
echo "Expect to FAIL as should match on owner"
$runas -u $acl1 -g $acl2 ./file1 2>&1
chacl o::---,g::---,u:$acl2:rwx,u::---,m::rwx file1 2>&1
$CHACL_PROG o::---,g::---,u:$acl2:rwx,u::---,m::rwx file1 2>&1
echo "Expect to PASS as should match on user"
$runas -u $acl2 -g $acl2 ./file1 2>&1
@@ -223,8 +223,8 @@ echo ""
echo "=== Test can read ACLs without access permissions ==="
# This was a bug in kernel code where syscred wasn't being used
# to override the capabilities
chacl o::---,g::---,u::--- file1 2>&1
chacl -l file1 | _acl_filter_id
$CHACL_PROG o::---,g::---,u::--- file1 2>&1
$CHACL_PROG -l file1 | _acl_filter_id
#-------------------------------------------------------
@@ -234,20 +234,20 @@ echo "=== Test Default ACLs ==="
umask 0
mkdir acldir
chacl -b "u::rwx,g::rwx,o::rwx" "u::r-x,g::r--,o::---" acldir 2>&1
chacl -l acldir | _acl_filter_id
$CHACL_PROG -b "u::rwx,g::rwx,o::rwx" "u::r-x,g::r--,o::---" acldir 2>&1
$CHACL_PROG -l acldir | _acl_filter_id
cd acldir
touch file2
_acl_ls file2
chacl -l file2 | _acl_filter_id
$CHACL_PROG -l file2 | _acl_filter_id
#ensure that umask is not having an effect
#so set it and see
umask 722
touch file3
_acl_ls file3
chacl -l file3 | _acl_filter_id
$CHACL_PROG -l file3 | _acl_filter_id
cd ..
umask 022
@@ -257,17 +257,17 @@ umask 022
echo ""
echo "=== Removing ACLs ==="
chacl -l file1 | _acl_filter_id
chacl -l acldir | _acl_filter_id
chacl -l acldir/file2 | _acl_filter_id
$CHACL_PROG -l file1 | _acl_filter_id
$CHACL_PROG -l acldir | _acl_filter_id
$CHACL_PROG -l acldir/file2 | _acl_filter_id
echo "Remove ACLs..."
chacl -R file1
chacl -B acldir
chacl -R acldir/file2
$CHACL_PROG -R file1
$CHACL_PROG -B acldir
$CHACL_PROG -R acldir/file2
echo "Note: Old interface would mean empty ACLs - now we show mode ACLs"
chacl -l file1 | _acl_filter_id
chacl -l acldir | _acl_filter_id
chacl -l acldir/file2 | _acl_filter_id
$CHACL_PROG -l file1 | _acl_filter_id
$CHACL_PROG -l acldir | _acl_filter_id
$CHACL_PROG -l acldir/file2 | _acl_filter_id
#-------------------------------------------------------
@@ -302,15 +302,15 @@ echo "Note: Old interface gave more informative error msgs"
touch file1
set -x
chacl u file1
chacl u: file1
chacl u:rumpledumpleunknownuser file1
chacl u:rumpledumpleunknownuser: file1
chacl g:rumpledumpleunknowngrp file1
chacl g:rumpledumpleunknowngrp: file1
chacl o:user1:rwx file1
chacl m:user1:rwx file1
chacl a::rwx file1
$CHACL_PROG u file1
$CHACL_PROG u: file1
$CHACL_PROG u:rumpledumpleunknownuser file1
$CHACL_PROG u:rumpledumpleunknownuser: file1
$CHACL_PROG g:rumpledumpleunknowngrp file1
$CHACL_PROG g:rumpledumpleunknowngrp: file1
$CHACL_PROG o:user1:rwx file1
$CHACL_PROG m:user1:rwx file1
$CHACL_PROG a::rwx file1
set +x
#-------------------------------------------------------
@@ -329,23 +329,23 @@ acl4=`_create_n_aces 16` # Andreas G. libacl size for initial get
acl5=`_create_n_aces 17` # 1 over A.G. libacl initial size
echo "1 below xfs acl max"
chacl $acl1 largeaclfile
$CHACL_PROG $acl1 largeaclfile
getfacl largeaclfile | _filter_aces
echo "xfs acl max"
chacl $acl2 largeaclfile
$CHACL_PROG $acl2 largeaclfile
getfacl largeaclfile | _filter_aces
echo "1 above xfs acl max"
chacl $acl3 largeaclfile
$CHACL_PROG $acl3 largeaclfile
getfacl largeaclfile | _filter_aces
echo "use 16 aces"
chacl $acl4 largeaclfile
$CHACL_PROG $acl4 largeaclfile
getfacl largeaclfile | _filter_aces
echo "use 17 aces"
chacl $acl5 largeaclfile
$CHACL_PROG $acl5 largeaclfile
getfacl largeaclfile | _filter_aces
#-------------------------------------------------------
+5 -5
View File
@@ -27,7 +27,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
_supported_fs xfs
_supported_os Linux
[ -x /usr/bin/chacl ] || _notrun "chacl executable not found"
[ -x $CHACL_PROG ] || _notrun "chacl executable not found"
_need_to_be_root
_acl_requirements
@@ -59,19 +59,19 @@ acl20=`_create_n_aces 20`
acl21=`_create_n_aces 21`
echo "try 20 aces for access acl"
chacl $acl20 largeacldir
$CHACL_PROG $acl20 largeacldir
getfacl largeacldir | _filter_aces
echo "try 20 aces for default acl"
chacl -d $acl20 largeacldir
$CHACL_PROG -d $acl20 largeacldir
getfacl largeacldir | _filter_aces
echo "try 21 aces for access acl"
chacl $acl21 largeacldir
$CHACL_PROG $acl21 largeacldir
getfacl largeacldir | _filter_aces
echo "try 21 aces for default acl"
chacl -d $acl21 largeacldir
$CHACL_PROG -d $acl21 largeacldir
getfacl largeacldir | _filter_aces
# success, all done
+5 -5
View File
@@ -125,7 +125,7 @@ _supported_fs xfs
_supported_os Linux
[ "$USE_EXTERNAL" = yes ] && _notrun "Cannot xfs_copy with external devices"
[ -x /usr/sbin/xfs_copy ] || _notrun "xfs_copy binary not yet installed"
[ -x $XFS_COPY_PROG ] || _notrun "xfs_copy binary not yet installed"
_require_scratch
_require_loop
@@ -140,12 +140,12 @@ umount $SCRATCH_MNT 2>/dev/null
echo
echo === copying scratch device to single target
xfs_copy $SCRATCH_DEV $imgs.image | _filter_copy '#' $imgs.image '#' '#'
$XFS_COPY_PROG $SCRATCH_DEV $imgs.image | _filter_copy '#' $imgs.image '#' '#'
_verify_copy $imgs.image $SCRATCH_DEV $SCRATCH_MNT
echo
echo === copying scratch device to single target, duplicate UUID
xfs_copy -d $SCRATCH_DEV $imgs.image | _filter_copy '#' $imgs.image '#' '#'
$XFS_COPY_PROG -d $SCRATCH_DEV $imgs.image | _filter_copy '#' $imgs.image '#' '#'
_verify_copy $imgs.image $SCRATCH_DEV $SCRATCH_MNT
echo
@@ -158,7 +158,7 @@ mount -t xfs -o loop $imgs.source $imgs.source_dir
loop2=`mount | grep $imgs.source | grep -o -e 'loop=.*[^),]' | grep -o -e '/.*$'`
cp -a $here $imgs.source_dir
mount -t xfs -o remount,ro $imgs.source $imgs.source_dir
xfs_copy $imgs.source $imgs.image | _filter_copy '#' $imgs.image '#' '#'
$XFS_COPY_PROG $imgs.source $imgs.image | _filter_copy '#' $imgs.image '#' '#'
_verify_copy $imgs.image $imgs.source $imgs.source_dir
# HACK WARNING:
@@ -169,7 +169,7 @@ losetup -d $loop2 > /dev/null 2>&1
echo
echo === copying scratch device to multiple targets
xfs_copy -L$imgs.log -b $SCRATCH_DEV $imgs.image1 $imgs.image2 \
$XFS_COPY_PROG -L$imgs.log -b $SCRATCH_DEV $imgs.image1 $imgs.image2 \
| _filter_copy '#' $imgs.image1 '#' $imgs.image2
_verify_copy $imgs.image1 $SCRATCH_DEV $SCRATCH_MNT
_verify_copy $imgs.image2 $SCRATCH_DEV $SCRATCH_MNT
+1 -1
View File
@@ -33,7 +33,7 @@ _supported_fs xfs
_supported_os IRIX Linux
_require_realtime
_require_scratch
_require_command /usr/sbin/xfs_io
_require_command $XFS_IO_PROG
_filter_realtime_flag()
{
+1 -2
View File
@@ -64,7 +64,7 @@ _filter_noymlinks_flag()
# real QA test starts here
_supported_os Linux IRIX
_supported_fs xfs
_require_command /usr/sbin/xfs_io
_require_command $XFS_IO_PROG
_require_scratch
_create_scratch
@@ -80,7 +80,6 @@ touch $SCRATCH_MNT/nosymlink/source
ln -s $SCRATCH_MNT/nosymlink/source $SCRATCH_MNT/nosymlink/target 2>&1 \
| _filter_scratch | _filter_ln
ln $SCRATCH_MNT/nosymlink/source $SCRATCH_MNT/nosymlink/hardlinksareok
echo "*** 1st listing..."
find $SCRATCH_MNT | _filter_scratch
+1 -1
View File
@@ -26,7 +26,7 @@ trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
# real QA test starts here
_supported_fs xfs
_supported_os Linux
_require_command /usr/bin/indent
_require_command $INDENT_PROG
# filter out known changes to xfs type sizes
_type_size_filter()
+2 -3
View File
@@ -13,7 +13,6 @@ owner=dgc@sgi.com
seq=`basename $0`
echo "QA output created by $seq"
killall="/usr/bin/killall"
here=`pwd`
tmp=/tmp/$$
rm -f $seq.full
@@ -22,7 +21,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
killall -r -q -TERM fsstress 2> /dev/null
$KILLALL_PROG -r -q -TERM fsstress 2> /dev/null
sync # ensures all fsstress processes died
_cleanup_testdir
}
@@ -44,7 +43,7 @@ workout()
_supported_fs xfs
_supported_os Linux
[ -x $killall ] || _notrun "$killall executable not found"
[ -x $KILLALL_PROG ] || _notrun "killall executable not found"
_setup_testdir
_require_scratch
+9
View File
@@ -121,6 +121,13 @@ export SED_PROG="`set_prog_path sed`"
export BC_PROG="`set_prog_path bc`"
[ "$BC_PROG" = "" ] && _fatal "bc not found"
# Tests handle these if missing
export ATTR_PROG="`set_prog_path attr`"
export GETFATTR_PROG="`set_prog_path getfattr`"
export CHACL_PROG="`set_prog_path chacl`"
export KILLALL_PROG="`set_prog_path killall`"
export INDENT_PROG="`set_prog_path indent`"
export PS_ALL_FLAGS="-ef"
export DF_PROG="`set_prog_path df`"
@@ -133,11 +140,13 @@ export XFS_CHECK_PROG="`set_prog_path xfs_check`"
export XFS_DB_PROG="`set_prog_path xfs_db`"
export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
export XFS_IO_PROG="`set_prog_path xfs_io`"
export XFS_COPY_PROG="`set_prog_path xfs_copy`"
export XFS_PARALLEL_REPAIR_PROG="`set_prog_path xfs_prepair`"
export XFS_PARALLEL_REPAIR64_PROG="`set_prog_path xfs_prepair64`"
export XFSDUMP_PROG="`set_prog_path xfsdump`"
export XFSRESTORE_PROG="`set_prog_path xfsrestore`"
export XFSINVUTIL_PROG="`set_prog_path xfsinvutil`"
export XFS_QUOTA_PROG="`set_prog_path xfs_quota`"
# Generate a comparable xfsprogs version number in the form of
# major * 10000 + minor * 100 + release
+1 -1
View File
@@ -14,7 +14,7 @@ _require_quota()
{
src/feature -q $TEST_DEV
[ $? -ne 0 ] && _notrun "Installed kernel does not support XFS quota"
[ -x /usr/sbin/xfs_quota ] || _notrun "Quota user tools not installed"
[ -x $XFS_QUOTA_PROG ] || _notrun "Quota user tools not installed"
}
#