xfstests: include test subdirectory support
[xfstests-dev.git] / 246
1 #! /bin/bash
2 # FS QA Test No. 246
3 #
4 # Check that truncation after failed writes does not zero too much data.
5 #
6 # Based on a bug report and testcase from
7 # Marius Tolzmann <tolzmann@molgen.mpg.de>
8 #
9 #-----------------------------------------------------------------------
10 # Copyright (c) 2010 Christoph Hellwig.  All Rights Reserved.
11 #
12 # This program is free software; you can redistribute it and/or
13 # modify it under the terms of the GNU General Public License as
14 # published by the Free Software Foundation.
15 #
16 # This program is distributed in the hope that it would be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 # GNU General Public License for more details.
20 #
21 # You should have received a copy of the GNU General Public License
22 # along with this program; if not, write the Free Software Foundation,
23 # Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
24 #
25 #-----------------------------------------------------------------------
26 #
27
28 seq=`basename $0`
29 echo "QA output created by $seq"
30
31 here=`pwd`
32 tmp=/tmp/$$
33 status=1        # failure is the default!
34
35 # get standard environment, filters and checks
36 . ./common.rc
37 . ./common.filter
38
39 # real QA test starts here
40 _supported_fs generic
41 _supported_os Linux
42
43 file=$TEST_DIR/mmap-writev
44
45 _cleanup()
46 {
47         rm -rf $file
48         rm -rf $file.NEW
49 }
50
51 trap "_cleanup ; exit \$status" 0 1 2 3 15
52
53 echo -n "cccccccccc" > $file
54 $here/src/t_mmap_writev $file $file.NEW
55 od -t x2 $file.NEW
56
57 status=0
58 exit $status