mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
27d077ec0b
Replace every explicit mount/umount of scratch or test devices with helper functions. This allows the next patch to add in hooks to these functions in order to set up & tear down overlayfs on every mount/umount (also adds _test_unmount(), which didn't exist prior) [Eryu Guan rebased the patch agains latest master and replaced more mount/umount with helpers] Signed-off-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eric Sandeen <esandeen@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
99 lines
2.3 KiB
Bash
Executable File
99 lines
2.3 KiB
Bash
Executable File
#! /bin/bash
|
|
# FS QA Test No. 196
|
|
#
|
|
# Make sure renames accross project boundaries are properly rejected
|
|
# and that we don't use the wrong lock flags internally.
|
|
#
|
|
# Based on a report and testcase from Arkadiusz Miskiewicz <arekm@maven.pl>
|
|
#
|
|
#-----------------------------------------------------------------------
|
|
# Copyright (c) 2008 Christoph Hellwig.
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License as
|
|
# published by the Free Software Foundation.
|
|
#
|
|
# This program is distributed in the hope that it would be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write the Free Software Foundation,
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
#-----------------------------------------------------------------------
|
|
#
|
|
|
|
seq=`basename $0`
|
|
seqres=$RESULT_DIR/$seq
|
|
echo "QA output created by $seq"
|
|
|
|
here=`pwd`
|
|
tmp=/tmp/$$
|
|
status=1 # failure is the default!
|
|
|
|
_cleanup()
|
|
{
|
|
cd /
|
|
_scratch_unmount
|
|
rm -f $tmp.*
|
|
}
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
# get standard environment, filters and checks
|
|
. ./common/rc
|
|
. ./common/filter
|
|
. ./common/quota
|
|
|
|
# real QA test starts here
|
|
_supported_fs xfs
|
|
_supported_os Linux
|
|
|
|
_require_scratch
|
|
_require_xfs_quota
|
|
|
|
#
|
|
# Setup temporary replacements for /etc/projects and /etc/projid
|
|
#
|
|
cat >$tmp.projects <<EOF
|
|
42:$SCRATCH_MNT/t
|
|
EOF
|
|
|
|
cat >$tmp.projid <<EOF
|
|
answer:42
|
|
EOF
|
|
|
|
#
|
|
# And make sure we always use our replacements
|
|
#
|
|
quota_cmd="xfs_quota -D $tmp.projects -P $tmp.projid"
|
|
|
|
_scratch_mkfs_xfs >/dev/null 2>&1
|
|
_qmount_option "pquota"
|
|
_qmount
|
|
|
|
#
|
|
# Create the project root
|
|
#
|
|
mkdir $SCRATCH_MNT/t
|
|
|
|
$quota_cmd -x -c 'project -s answer' $SCRATCH_MNT >/dev/null 2>&1
|
|
$quota_cmd -x -c 'limit -p bhard=100m answer' $SCRATCH_MNT
|
|
|
|
touch $SCRATCH_MNT/test
|
|
|
|
#
|
|
# Try renaming a file into the project. This should fail.
|
|
#
|
|
# We repeat this a couple thousand times as a single rename couldn't
|
|
# always trigger the wrong unlock flags bug we had in older kernels.
|
|
#
|
|
for i in `seq 1 2000`; do
|
|
src/rename test t/test
|
|
done
|
|
|
|
# success, all done
|
|
echo "*** done"
|
|
rm -f $seqres.full
|
|
status=0
|