From 724454828f5ed05f2fcf63691b06d978bc46e790 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 19 Jan 2013 00:09:05 +0000 Subject: tests: add fallocate(1) check Signed-off-by: Sami Kerola --- tests/commands.sh | 1 + tests/expected/misc/fallocate | 1 + tests/ts/misc/fallocate | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 tests/expected/misc/fallocate create mode 100755 tests/ts/misc/fallocate diff --git a/tests/commands.sh b/tests/commands.sh index 0a6c68aa4..366695b8d 100644 --- a/tests/commands.sh +++ b/tests/commands.sh @@ -78,3 +78,4 @@ TS_CMD_LINE=${TS_CMD_LINE-"$top_builddir/line"} TS_CMD_DMESG=${TS_CMD_DMESG-"$top_builddir/dmesg"} TS_CMD_SETSID=${TS_CMD_SETSID-"$top_builddir/setsid"} TS_CMD_SETARCH=${TS_CMD_SETARCH-"$top_builddir/setarch"} +TS_CMD_FALLOCATE=${TS_CMD_FALLOCATE-"$top_builddir/fallocate"} diff --git a/tests/expected/misc/fallocate b/tests/expected/misc/fallocate new file mode 100644 index 000000000..e45b99e95 --- /dev/null +++ b/tests/expected/misc/fallocate @@ -0,0 +1 @@ +384 diff --git a/tests/ts/misc/fallocate b/tests/ts/misc/fallocate new file mode 100755 index 000000000..4b9db706a --- /dev/null +++ b/tests/ts/misc/fallocate @@ -0,0 +1,25 @@ +#!/bin/bash + +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +TS_TOPDIR="$(dirname $0)/../.." +TS_DESC="fallocate" + +. $TS_TOPDIR/functions.sh +ts_init "$*" + +$TS_CMD_FALLOCATE -o 128 -l 256 $TS_SELF/fallocate_test > $TS_OUTPUT 2>&1 +stat -c "%s" $TS_SELF/fallocate_test > $TS_OUTPUT 2>&1 +rm -f $TS_SELF/fallocate_test + +ts_finalize -- cgit v1.2.3-55-g7522