4 # Check behavior of chown with both user and group quota enabled,
5 # and changing both user and group together via chown(2).
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 #-----------------------------------------------------------------------
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
21 # get standard environment, filters and checks
28 umount $SCRATCH_MNT 2>/dev/null
31 trap "_cleanup; exit \$status" 0 1 2 3 15
33 # real QA test starts here
35 _supported_os Linux IRIX
37 cp /dev/null $seq.full
38 chmod ugo+rwx $seq.full
49 s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
50 s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
51 s,$SCRATCH_MNT,<MOUNT>,;
57 _scratch_mkfs_xfs >/dev/null 2>&1
61 touch $SCRATCH_MNT/testfile
62 if src/feature -c $SCRATCH_MNT/testfile; then
65 _notrun "Installed fileutils doesn't support 32 bit uids/gids"
68 chown 12345 $SCRATCH_MNT/testfile
69 chgrp 54321 $SCRATCH_MNT/testfile
70 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
72 chown 34567 $SCRATCH_MNT/testfile
73 chgrp 76543 $SCRATCH_MNT/testfile
74 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
76 chown 56789 $SCRATCH_MNT/testfile
77 chgrp 98765 $SCRATCH_MNT/testfile
78 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
80 # finally give back to original owners
81 chown 12345 $SCRATCH_MNT/testfile
82 chgrp 54321 $SCRATCH_MNT/testfile
83 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
86 umount $SCRATCH_MNT 2>/dev/null
89 _scratch_mkfs_xfs >> $seq.full 2>&1 || _fail "mkfs failed!"
91 _qmount_option "uquota,gquota"
93 if src/feature -G $SCRATCH_DEV ; then
96 _notrun "No quota support at mount time"
98 umount $SCRATCH_MNT 2>/dev/null
100 _qmount_option "rw" # no quota options
101 echo "*** Default mount options"
104 _qmount_option "uquota"
105 echo "*** User quota mount option"
108 export MOUNT_OPTIONS="-o gquota"
109 _qmount_option "gquota"
110 echo "*** Group quota mount option"
113 _qmount_option "uquota,gquota"
114 echo "*** User and Group quota mount options"