summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/commands.sh1
-rw-r--r--tests/expected/misc/fallocate1
-rwxr-xr-xtests/ts/misc/fallocate25
3 files changed, 27 insertions, 0 deletions
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