summaryrefslogtreecommitdiff
path: root/tests/generic/127
blob: f931badd5e2062b61ad060e4bfd949b0707f2713 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2006 Silicon Graphics, Inc.  All Rights Reserved.
#
# FSQA Test No. 127
#
# fsx tests modified from CXFSQA tests
#   - fsx_00_lite
#   - fsx_05_lite_mmap
#   - fsx_10_std,
#   - fsx_15_std_mmap
#
. ./common/preamble
_begin_fstest rw auto

# Override the default cleanup function.
_cleanup()
{
    rm -f $tmp.output
}

# Import common functions.
. ./common/filter

FSX_FILE_SIZE=262144
FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"

_fsx_lite_nommap()
{
    echo "=== FSX Light Mode, No Memory Mapping ==="
    dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
    if ! ltp/fsx $FSX_ARGS -L -R -W $FSX_AVOID $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
    then
        echo "ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
        cat $tmp.output
        return 1
    fi
    cat $tmp.output
    return 0
}

_fsx_lite_mmap()
{
    echo "=== FSX Light Mode, Memory Mapping ==="
    dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
    if ! ltp/fsx $FSX_ARGS -L $FSX_AVOID $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
    then
    	echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
	cat $tmp.output
	return 1
    fi
    cat $tmp.output
    return 0
}

_fsx_std_nommap()
{
    echo "=== FSX Standard Mode, No Memory Mapping ==="
    if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1
    then
        echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
        cat $tmp.output
        return 1
    fi
    cat $tmp.output
    return 0
}

_fsx_std_mmap()
{
    echo "=== FSX Standard Mode, Memory Mapping ==="
    if ! ltp/fsx $FSX_ARGS $FSX_AVOID $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1
    then
    	echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
	cat $tmp.output
	return 1
    fi
    cat $tmp.output
    return 0
}

# real QA test starts here
_supported_fs generic
_require_test

_fsx_lite_nommap || exit
_fsx_lite_mmap || exit

_fsx_std_nommap || exit
_fsx_std_mmap || exit

#flush cache after write
FSX_ARGS="-f $FSX_ARGS"
_fsx_std_nommap || exit
_fsx_std_mmap || exit

status=0
_cleanup
exit