tests: remove udf/101
[xfstests-dev.git] / tests / generic / 384
1 #! /bin/bash
2 # FS QA Test No. 384
3 #
4 # test to reproduce PV951636:
5 #   project quotas not updated if a file is mv'd into that directory
6 #
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
9 #
10 # This program is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU General Public License as
12 # published by the Free Software Foundation.
13 #
14 # This program is distributed in the hope that it would be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
18 #
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write the Free Software Foundation,
21 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
22 #
23 #-----------------------------------------------------------------------
24 #
25
26 seq=`basename $0`
27 seqres=$RESULT_DIR/$seq
28 echo "QA output created by $seq"
29
30 here=`pwd`
31 tmp=/tmp/$$
32 status=1        # failure is the default!
33
34 # get standard environment, filters and checks
35 . ./common/rc
36 . ./common/filter
37 . ./common/quota
38
39 _cleanup()
40 {
41         cd /
42         _scratch_unmount 2>/dev/null
43         rm -f $tmp.*
44 }
45 trap "_cleanup; exit \$status" 0 1 2 3 15
46
47 # real QA test starts here
48 _supported_fs generic
49 _supported_os Linux IRIX
50
51 _require_test
52 _require_quota
53 _require_xfs_quota_foreign
54 _require_xfs_io_command "chproj"
55
56 # we can't run with group quotas
57 _exclude_scratch_mount_option "gquota" "grpquota"
58
59 dir=$SCRATCH_MNT/project
60
61 #project quota files
62 cat >$tmp.projects <<EOF
63 1:$dir
64 EOF
65
66 cat >$tmp.projid <<EOF
67 test:1
68 EOF
69
70 cp /dev/null $seqres.full
71 chmod a+rwx $seqres.full        # arbitrary users will write here
72
73 _require_scratch
74 _scratch_mkfs >/dev/null 2>&1
75 _scratch_enable_pquota
76
77 _qmount_option "prjquota"
78 _qmount
79 _require_prjquota $SCRATCH_DEV
80
81 report_quota()
82 {
83     $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
84                     -c "repquota -inN -p" $SCRATCH_DEV | \
85                     tr -s '[:space:]' | _filter_project_quota
86 }
87
88 mkdir $dir
89 $XFS_IO_PROG -r -c "chproj -R 1" -c "chattr -R +P" $dir
90
91 $XFS_QUOTA_PROG -D $tmp.projects -P $tmp.projid -x \
92     -c "limit -p bsoft=100m bhard=100m 1" $SCRATCH_DEV
93 report_quota
94
95 touch $dir/1
96 touch $dir/2
97 cp $dir/2 $dir/3
98 report_quota
99
100 if [ "$HOSTOS" == "IRIX" ] ; then
101     mkfile 1M $TEST_DIR/6
102 else
103     xfs_mkfile 1M $TEST_DIR/6
104 fi
105
106 #try cp to dir
107 cp $TEST_DIR/6 $dir/6
108 report_quota
109
110 #try mv to dir
111 mv $TEST_DIR/6 $dir/7
112 report_quota
113
114 # success, all done
115 status=0
116 exit