Fix the file_as_id routine so it works for test 050.

Merge of master-melb:xfs-cmds:26811a by kenmcd.
This commit is contained in:
Nathan Scott
2006-08-18 06:13:04 +00:00
parent 50392473ff
commit 50031179a1
3 changed files with 14 additions and 10 deletions
+2 -2
View File
@@ -152,11 +152,11 @@ realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
*** push past the hard inode limit (expect EDQUOT)
[ROOT] 0 0 0 00 [--------] 3 0 0 00 [--------] 0 0 0 00 [--------]
[NAME] 140 100 500 00 [7 days] 10 4 10 00 [7 days] 0 0 0 00 [--------]
[NAME] 140 100 500 00 [7 days] 9 4 10 00 [7 days] 0 0 0 00 [--------]
*** push past the hard block limit (expect EDQUOT)
[ROOT] 0 0 0 00 [--------] 3 0 0 00 [--------] 0 0 0 00 [--------]
[NAME] =OK= 100 500 00 [7 days] 10 4 10 00 [7 days] 0 0 0 00 [--------]
[NAME] =OK= 100 500 00 [7 days] 9 4 10 00 [7 days] 0 0 0 00 [--------]
*** unmount
*** pqnoenforce
+2 -2
View File
@@ -174,11 +174,11 @@ known_hosts()
SCRATCH_MNT=/mnt/scratch
SCRATCH_DEV=/dev/sdb5
SCRATCH_RTDEV=/dev/sdc1
SCRATCH_LOGDEV=/dev/sda11
SCRATCH_LOGDEV=/dev/ram0
TEST_DIR=/mnt/test
TEST_DEV=/dev/sdc3
TEST_RTDEV=/dev/sdb6
TEST_LOGDEV=/dev/sda9
TEST_LOGDEV=/dev/ram1
#TAPE_DEV=/dev/st0
#RMT_TAPE_DEV=bruce:/dev/st0
#RMT_IRIXTAPE_DEV=snort:/dev/tape
+10 -6
View File
@@ -39,18 +39,17 @@ _require_nobody()
}
# create a file as a specific user (uid)
# takes filename, id, type (u/g), blocksize, blockcount
# takes filename, id, type (u/g/p), blocksize, blockcount
#
_file_as_id()
{
[ $# != 5 ] && _notrun "broken call to _file_as_id in test $seq"
parent=`dirname $1`
if [ $3 = p ]; then
size=`expr $4 \* $5`;
echo xfs_io -f -c "chproj $2" -c "pwrite -b $4 0 $size" $1 >>$seq.full
$XFS_IO_PROG -f -c "chproj $2" -c "pwrite -b $4 0 $size" $1 \
>>$seq.full 2>&1
return
echo PARENT: xfs_io -r -c "chproj $2" -c "chattr +P" $parent >>$seq.full
$XFS_IO_PROG -r -c "chproj $2" -c "chattr +P" $parent >>$seq.full 2>&1
magik='$>' # (irrelevent, above set projid-inherit-on-parent)
elif [ $3 = u ]; then
magik='$>' # perlspeak for effective uid
elif [ $3 = g ]; then
@@ -72,6 +71,11 @@ _file_as_id()
EOF
# for debugging the above euid change, try... [need write in cwd]
# exec "dd if=/dev/zero of=$1 bs=$4 count=$5 >>$seq.full 2>&1";
if [ $3 = p ]; then
echo PARENT: xfs_io -r -c "chproj 0" -c "chattr -P" $parent >>$seq.full
$XFS_IO_PROG -r -c "chproj 0" -c "chattr -P" $parent >>$seq.full 2>&1
fi
}
_choose_uid()