fstests: use _require_symlinks on all necessary tests
[xfstests-dev.git] / tests / generic / 246
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2010 Christoph Hellwig.  All Rights Reserved.
4 #
5 # FS QA Test No. 246
6 #
7 # Check that truncation after failed writes does not zero too much data.
8 #
9 # Based on a bug report and testcase from
10 # Marius Tolzmann <tolzmann@molgen.mpg.de>
11 #
12 seq=`basename $0`
13 seqres=$RESULT_DIR/$seq
14 echo "QA output created by $seq"
15
16 here=`pwd`
17 tmp=/tmp/$$
18 status=1        # failure is the default!
19
20 # get standard environment, filters and checks
21 . ./common/rc
22 . ./common/filter
23
24 # real QA test starts here
25 _supported_fs generic
26 _supported_os Linux
27 _require_test
28
29 file=$TEST_DIR/mmap-writev
30
31 _cleanup()
32 {
33         rm -rf $file
34         rm -rf $file.NEW
35 }
36
37 trap "_cleanup ; exit \$status" 0 1 2 3 15
38
39 echo -n "cccccccccc" > $file
40 $here/src/t_mmap_writev $file $file.NEW
41 od -t x2 $file.NEW
42
43 status=0
44 exit $status