summaryrefslogtreecommitdiff
path: root/tests/generic/514
blob: 5b83771817fd2ed4e064be6f43113552d54f50b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2018 Oracle, Inc.  All Rights Reserved.
#
# FS QA Test No. 514
#
# Ensure that file size resource limits are respected when reflinking.
#
. ./common/preamble
_begin_fstest auto quick clone

# Import common functions.
. ./common/filter
. ./common/reflink

# real QA test starts here
_supported_fs generic
_require_scratch_reflink
_require_user

_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount

chmod a+rwx $SCRATCH_MNT
$XFS_IO_PROG -f -c "pwrite -S 0x18 0 1m" $SCRATCH_MNT/foo >>$seqres.full
su -s/bin/bash - $qa_user -c "ulimit -f 64 ; $XFS_IO_PROG -f -c \"reflink $SCRATCH_MNT/foo\" $SCRATCH_MNT/bar" >> $seqres.full 2>&1

sz="$(_get_filesize $SCRATCH_MNT/bar)"
if [ "$sz" -ne 0 ] && [ "$sz" -ne 65536 ]; then
	echo "Oddball file size $sz??"
fi

echo Silence is golden.
status=0
exit