fstests: move test group info to test files
[xfstests-dev.git] / tests / generic / 127
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5 # FSQA Test No. 127
6 #
7 # fsx tests modified from CXFSQA tests
8 #   - fsx_00_lite
9 #   - fsx_05_lite_mmap
10 #   - fsx_10_std,
11 #   - fsx_15_std_mmap
12 #
13 . ./common/preamble
14 _begin_fstest rw auto
15
16 # Override the default cleanup function.
17 _cleanup()
18 {
19     rm -f $tmp.output
20 }
21
22 # Import common functions.
23 . ./common/filter
24
25 FSX_FILE_SIZE=262144
26 FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
27
28 _fsx_lite_nommap()
29 {
30     echo "=== FSX Light Mode, No Memory Mapping ==="
31     dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
32     if ! ltp/fsx $FSX_ARGS -L -R -W $FSX_AVOID $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
33     then
34         echo "ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
35         cat $tmp.output
36         return 1
37     fi
38     cat $tmp.output
39     return 0
40 }
41
42 _fsx_lite_mmap()
43 {
44     echo "=== FSX Light Mode, Memory Mapping ==="
45     dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
46     if ! ltp/fsx $FSX_ARGS -L $FSX_AVOID $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
47     then
48         echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
49         cat $tmp.output
50         return 1
51     fi
52     cat $tmp.output
53     return 0
54 }
55
56 _fsx_std_nommap()
57 {
58     echo "=== FSX Standard Mode, No Memory Mapping ==="
59     if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1
60     then
61         echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
62         cat $tmp.output
63         return 1
64     fi
65     cat $tmp.output
66     return 0
67 }
68
69 _fsx_std_mmap()
70 {
71     echo "=== FSX Standard Mode, Memory Mapping ==="
72     if ! ltp/fsx $FSX_ARGS $FSX_AVOID $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1
73     then
74         echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
75         cat $tmp.output
76         return 1
77     fi
78     cat $tmp.output
79     return 0
80 }
81
82 # real QA test starts here
83 _supported_fs generic
84 _require_test
85
86 _fsx_lite_nommap || exit
87 _fsx_lite_mmap || exit
88
89 _fsx_std_nommap || exit
90 _fsx_std_mmap || exit
91
92 #flush cache after write
93 FSX_ARGS="-f $FSX_ARGS"
94 _fsx_std_nommap || exit
95 _fsx_std_mmap || exit
96
97 status=0
98 _cleanup
99 exit