]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tests/ts/misc/fallocate
tests: split stdout and stderr
[thirdparty/util-linux.git] / tests / ts / misc / fallocate
CommitLineData
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 15TS_TOPDIR="${0%/*}/../.."
72445482
SK
16TS_DESC="fallocate"
17
18. $TS_TOPDIR/functions.sh
19ts_init "$*"
20
2f791546 21ts_check_test_command "$TS_CMD_FALLOCATE"
62b07018 22ts_check_test_command "$TS_CMD_FINDMNT"
2f791546 23
ef5b971c
KZ
24IMAGE=${TS_OUTDIR}/${TS_TESTNAME}.file
25rm -f $IMAGE
26
cbf858aa
KZ
27if $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 29else
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 35fi
ef5b971c
KZ
36
37rm -f $IMAGE
72445482
SK
38
39ts_finalize