]>
Commit | Line | Data |
---|---|---|
72445482 SK |
1 | #!/bin/bash |
2 | ||
3 | # This file is part of util-linux. | |
4 | # | |
5 | # This file is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2 of the License, or | |
8 | # (at your option) any later version. | |
9 | # | |
10 | # This file is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | ||
e130ce53 | 15 | TS_TOPDIR="${0%/*}/../.." |
72445482 SK |
16 | TS_DESC="fallocate" |
17 | ||
18 | . $TS_TOPDIR/functions.sh | |
19 | ts_init "$*" | |
20 | ||
2f791546 | 21 | ts_check_test_command "$TS_CMD_FALLOCATE" |
62b07018 | 22 | ts_check_test_command "$TS_CMD_FINDMNT" |
2f791546 | 23 | |
ef5b971c KZ |
24 | IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file |
25 | rm -f $IMAGE | |
26 | ||
cbf858aa KZ |
27 | if $TS_CMD_FALLOCATE -o 128 -l 256 $IMAGE >> $TS_OUTPUT 2>> $TS_ERRLOG; then |
28 | stat -c "%s" $IMAGE >> $TS_OUTPUT 2>> $TS_ERRLOG | |
fd25dcf4 | 29 | else |
62b07018 KZ |
30 | # fs type of $TS_OUTDIR, could be used to skip this test early |
31 | fs_type=$(${TS_CMD_FINDMNT} -n -o FSTYPE -T ${TS_OUTDIR}) | |
32 | ||
4cb6d04a RM |
33 | grep -qi "fallocate: fallocate failed:.*not supported" $TS_OUTPUT \ |
34 | && ts_skip "'${fs_type}' not supported" | |
fd25dcf4 | 35 | fi |
ef5b971c KZ |
36 | |
37 | rm -f $IMAGE | |
72445482 SK |
38 | |
39 | ts_finalize |