4 # Create file/dir over whiteout by another user, uid/gid of the file/dir should
5 # be current fsuid/fsgid, not the mounter's.
7 # This upstream kernel patch fixed the issue
8 # d0e13f5 ovl: fix uid/gid when creating over whiteout
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
43 # get standard environment, filters and checks
49 # real QA test starts here
55 # Remove all files from previous tests
58 # Create test file on lower dir, and chown to fsgqa user
59 lowerdir=$SCRATCH_DEV/$OVERLAY_LOWER_DIR
61 touch $lowerdir/testfile
62 chown fsgqa:fsgqa $lowerdir/testfile
64 # chown upperdir to fsgqa user, so new file/dir can be created by the user
65 upperdir=$SCRATCH_DEV/$OVERLAY_UPPER_DIR
67 chown fsgqa:fsgqa $upperdir
71 # Remove testfile, whiteout created in lowerdir
72 rm -f $SCRATCH_MNT/testfile
74 # Create new file over whiteout and check the file ownership
75 _user_do "touch $SCRATCH_MNT/testfile"
76 stat -c %U:%G-%F $SCRATCH_MNT/testfile
78 # Create new dir over whiteout and check ownership again
79 rm -f $SCRATCH_MNT/testfile
80 _user_do "mkdir $SCRATCH_MNT/testfile"
81 stat -c %U:%G-%F $SCRATCH_MNT/testfile