generic/448: define BASE_TEST_FILE before _cleanup
[xfstests-dev.git] / tests / generic / 448
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017, Oracle and/or its affiliates.  All Rights Reserved.
4 #
5 # FS QA Test No. 448
6 #
7 # Check what happens when SEEK_HOLE/SEEK_DATA are fed negative offsets.
8 #
9 seq=`basename "$0"`
10 seqres="$RESULT_DIR/$seq"
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 status=1    # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
17
18 BASE_TEST_FILE=$TEST_DIR/seek_sanity_testfile_$seq
19
20 _cleanup()
21 {
22         cd /
23         rm -f $tmp.* $BASE_TEST_FILE
24 }
25
26 # get standard environment, filters and checks
27 . ./common/rc
28 . ./common/filter
29
30 _supported_fs generic
31 _supported_os Linux
32
33 _require_test
34 _require_seek_data_hole
35
36 _require_test_program "seek_sanity_test"
37
38 _run_seek_sanity_test -s 18 -e 18 $BASE_TEST_FILE > $seqres.full 2>&1 ||
39         _fail "seek sanity check failed!"
40
41 _check_dmesg
42 # success, all done
43 echo "Silence is golden"
44 status=0
45 exit