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.
10 # This program is free software; you can redistribute it and/or modify it
11 # under the terms of version 2 of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 # Further, this software is distributed without any warranty that it is
19 # free of the rightful claim of any third person regarding infringement
20 # or the like. Any license provided herein, whether implied or
21 # otherwise, applies only to this software file. Patent licenses, if
22 # any, provided herein do not apply to combinations of this program with
23 # other software, or any other product whatsoever.
25 # You should have received a copy of the GNU General Public License along
26 # with this program; if not, write the Free Software Foundation, Inc., 59
27 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
29 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
30 # Mountain View, CA 94043, or:
34 # For further information regarding this notice, see:
36 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
37 #-----------------------------------------------------------------------
43 echo "QA output created by $seq"
47 status=1 # failure is the default!
49 # get standard environment, filters and checks
56 umount $SCRATCH_MNT 2>/dev/null
59 trap "_cleanup; exit \$status" 0 1 2 3 15
61 # real QA test starts here
63 _supported_os Linux IRIX
65 cp /dev/null $seq.full
66 chmod ugo+rwx $seq.full
76 s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
77 s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
78 s,$SCRATCH_MNT,<MOUNT>,;
84 _scratch_mkfs_xfs >/dev/null 2>&1
88 touch $SCRATCH_MNT/testfile
89 if src/feature -c $SCRATCH_MNT/testfile; then
92 _notrun "Installed fileutils doesn't support 32 bit uids/gids"
95 chown 12345 $SCRATCH_MNT/testfile
96 chgrp 54321 $SCRATCH_MNT/testfile
97 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
99 chown 34567 $SCRATCH_MNT/testfile
100 chgrp 76543 $SCRATCH_MNT/testfile
101 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
103 chown 56789 $SCRATCH_MNT/testfile
104 chgrp 98765 $SCRATCH_MNT/testfile
105 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
107 # finally give back to original owners
108 chown 12345 $SCRATCH_MNT/testfile
109 chgrp 54321 $SCRATCH_MNT/testfile
110 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
113 umount $SCRATCH_MNT 2>/dev/null
116 _scratch_mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1
117 export MOUNT_OPTIONS="-o uquota,gquota"
119 if src/feature -G $SCRATCH_DEV ; then
122 _notrun "No quota support at mount time"
124 umount $SCRATCH_MNT 2>/dev/null
126 export MOUNT_OPTIONS=""
127 echo "*** Default mount options"
130 export MOUNT_OPTIONS="-o uquota"
131 echo "*** User quota mount option"
134 export MOUNT_OPTIONS="-o gquota"
135 echo "*** Group quota mount option"
138 export MOUNT_OPTIONS="-o uquota,gquota"
139 echo "*** User and Group quota mount options"