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
48 s/Device: *[0-9][0-9]*,[0-9][0-9]*/Device: <DEVICE>/;
49 s/Inode: *[0-9][0-9]*/Inode: <INODE>/;
50 s,$SCRATCH_MNT,<MOUNT>,;
56 _scratch_mkfs_xfs >/dev/null 2>&1
60 touch $SCRATCH_MNT/testfile
61 if src/feature -c $SCRATCH_MNT/testfile; then
64 _notrun "Installed fileutils doesn't support 32 bit uids/gids"
67 chown 12345 $SCRATCH_MNT/testfile
68 chgrp 54321 $SCRATCH_MNT/testfile
69 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
71 chown 34567 $SCRATCH_MNT/testfile
72 chgrp 76543 $SCRATCH_MNT/testfile
73 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
75 chown 56789 $SCRATCH_MNT/testfile
76 chgrp 98765 $SCRATCH_MNT/testfile
77 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
79 # finally give back to original owners
80 chown 12345 $SCRATCH_MNT/testfile
81 chgrp 54321 $SCRATCH_MNT/testfile
82 src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
85 umount $SCRATCH_MNT 2>/dev/null
88 _scratch_mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1
89 export MOUNT_OPTIONS="-o uquota,gquota"
91 if src/feature -G $SCRATCH_DEV ; then
94 _notrun "No quota support at mount time"
96 umount $SCRATCH_MNT 2>/dev/null
98 export MOUNT_OPTIONS=""
99 echo "*** Default mount options"
102 export MOUNT_OPTIONS="-o uquota"
103 echo "*** User quota mount option"
106 export MOUNT_OPTIONS="-o gquota"
107 echo "*** Group quota mount option"
110 export MOUNT_OPTIONS="-o uquota,gquota"
111 echo "*** User and Group quota mount options"