2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
7 # Make sure fs honors file size resource limit.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
25 # get standard environment, filters and checks
29 # remove previous $seqres.full before test
32 # need a wrapper function so "File size limit exceeded" message can be filtered
35 $XFS_IO_PROG -fc "truncate $1" $2
38 # real QA test starts here
42 # set max file size to 1G (in block number of 1k blocks), so it should be big
43 # enough to let test run without bringing any trouble to test harness
44 ulimit -f $((1024 * 1024))
45 # default action to SIGXFSZ is coredump, limit core file size to 0 to avoid
46 # such core files after each test run
49 # exercise file size limit boundaries
50 do_truncate $((1024 * 1024 * 1024 - 1)) $TEST_DIR/$seq.$$-1
51 do_truncate $((1024 * 1024 * 1024)) $TEST_DIR/$seq.$$
52 do_truncate $((1024 * 1024 * 1024 + 1)) $TEST_DIR/$seq.$$+1 2>&1 | \
53 grep -o "File size limit exceeded"