Skip to content

Commit

Permalink
xfstests: Use qa_user and qa_group for test 219
Browse files Browse the repository at this point in the history
Test 219 requires a special user. Use $qa_user and $qa_group (added in this
patch) for that purpose instead of hardcoded uid & gid. This also fixes
a false failure when repquota does not report quota for users not in passwd.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
  • Loading branch information
jankara authored and Ben Myers committed Jan 4, 2013
1 parent 3c27024 commit 09584ac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 22 deletions.
19 changes: 9 additions & 10 deletions 219
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,18 @@ _supported_fs generic
_supported_os Linux #IRIX
_require_scratch
_require_quota
_require_user
_require_group

test_files()
{
echo; echo "### create files, setting up ownership (type=$type)"
rm -f $SCRATCH_MNT/{buffer,direct,mmap}
touch $SCRATCH_MNT/{buffer,direct,mmap}
chown $uid $SCRATCH_MNT/{buffer,direct,mmap}
chgrp $gid $SCRATCH_MNT/{buffer,direct,mmap}
chown $qa_user $SCRATCH_MNT/{buffer,direct,mmap}
chgrp $qa_group $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 -2 | _filter_scratch
done
}

Expand Down Expand Up @@ -91,23 +93,20 @@ 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 -2 | _filter_scratch
done

if [ $type == 'u' ]; then
id=$uid
id=$qa_user
else
id=$gid
id=$qa_group
fi
repquota -$type -n $SCRATCH_MNT | grep "^#$id" | check_usage 144 3
repquota -$type $SCRATCH_MNT | grep "^$id" | check_usage 144 3
}

# real QA test starts here
rm -f $seq.full

uid=1
gid=2

umount $SCRATCH_DEV 2>/dev/null
_scratch_mkfs >> $seq.full 2>&1
_scratch_mount "-o usrquota,grpquota"
Expand Down
12 changes: 0 additions & 12 deletions 219.out
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,33 @@ QA output created by 219
### create files, setting up ownership (type=u)
File: "SCRATCH_MNT/buffer"
Size: 0 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/direct"
Size: 0 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/mmap"
Size: 0 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
### some controlled buffered, direct and mmapd IO (type=u)
File: "SCRATCH_MNT/buffer"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/direct"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/mmap"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
Usage OK (type=u)

### test group accounting

### create files, setting up ownership (type=g)
File: "SCRATCH_MNT/buffer"
Size: 0 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/direct"
Size: 0 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/mmap"
Size: 0 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
### some controlled buffered, direct and mmapd IO (type=g)
File: "SCRATCH_MNT/buffer"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/direct"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
File: "SCRATCH_MNT/mmap"
Size: 49152 Filetype: Regular File
Mode: (0644/-rw-r--r--) Uid: (1) Gid: (2)
Usage OK (type=g)
9 changes: 9 additions & 0 deletions common.rc
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,15 @@ _require_user()
[ "$?" == "0" ] || _notrun "$qa_user cannot execute commands."
}

# check for the fsgqa group on the machine
#
_require_group()
{
qa_group=fsgqa
_cat_group | grep -q $qa_group
[ "$?" == "0" ] || _notrun "$qa_group user not defined."
}

_filter_user_do()
{
perl -ne "
Expand Down

0 comments on commit 09584ac

Please sign in to comment.