Files
apfstests/tests/generic/554
T
Vladimir Zapolskiy 98c3ec6048 generic: reorder output to stderr and stdout from _scratch_mkfs
The change fixes false positives from generic/554 and generic/565 tests,
when supplementary output of an mkfs utility to stderr apprears to be mixed
into the test output, which results into non-empty diff with the expected
output found in *.out files.

The change unifies _scratch_mkfs redirections among all generic tests, these
two modified tests are the only ones with the swapped order of output
redirections.

Signed-off-by: Vladimir Zapolskiy <vladimir@tuxera.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
2020-07-20 01:15:47 +08:00

57 lines
1.1 KiB
Bash
Executable File

#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Red Hat, Inc. All Rights Reserved.
#
# FS QA Test No. 554
#
# Check that we cannot copy_file_range() to a swapfile
#
# This is a regression test for kernel commit:
# 96e6e8f4a68d ("vfs: add missing checks to copy_file_range")
#
seq=`basename $0`
seqres=$RESULT_DIR/$seq
echo "QA output created by $seq"
here=`pwd`
tmp=/tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 7 15
_cleanup()
{
cd /
rm -f $tmp.*
}
# get standard environment, filters and checks
. ./common/rc
. ./common/filter
# real QA test starts here
_supported_os Linux
_supported_fs generic
rm -f $seqres.full
_require_scratch
_require_xfs_io_command "copy_range"
_require_scratch_swapfile
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount
rm -f $seqres.full
$XFS_IO_PROG -f -c "pwrite -S 0x61 0 128k" $SCRATCH_MNT/file >> $seqres.full 2>&1
echo swap files return ETXTBUSY
_format_swapfile $SCRATCH_MNT/swapfile 16m
swapon $SCRATCH_MNT/swapfile
$XFS_IO_PROG -f -c "copy_range -l 32k $SCRATCH_MNT/file" $SCRATCH_MNT/swapfile
swapoff $SCRATCH_MNT/swapfile
# success, all done
status=0
exit