]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add ionice(1) check
authorSami Kerola <kerolasa@iki.fi>
Sat, 19 Jan 2013 00:08:57 +0000 (00:08 +0000)
committerKarel Zak <kzak@redhat.com>
Thu, 24 Jan 2013 15:49:34 +0000 (16:49 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
tests/commands.sh
tests/expected/misc/ionice [new file with mode: 0644]
tests/ts/misc/ionice [new file with mode: 0755]

index fe79cf41923edd26f9458fca619227a5cfb25ecb..c5f714094f431f91a4a7b11cd35c75147de3bbeb 100644 (file)
@@ -70,3 +70,4 @@ TS_CMD_GETOPT=${TS_CMD_GETOPT-"$top_builddir/getopt"}
 TS_CMD_MCOOKIE=${TS_CMD_MCOOKIE-"$top_builddir/mcookie"}
 TS_CMD_TAILF=${TS_CMD_TAILF-"$top_builddir/tailf"}
 TS_CMD_UL=${TS_CMD_UL-"$top_builddir/ul"}
+TS_CMD_IONICE=${TS_CMD_IONICE-"$top_builddir/ionice"}
diff --git a/tests/expected/misc/ionice b/tests/expected/misc/ionice
new file mode 100644 (file)
index 0000000..39cfb60
--- /dev/null
@@ -0,0 +1,9 @@
+ionice: ignoring given class data for none class
+ionice: unknown prio class 7
+ionice: ioprio_set failed: Invalid argument
+ionice: unknown prio class 7
+ionice: ioprio_set failed: Invalid argument
+ionice: unknown prio class 8
+ionice: ioprio_set failed: Invalid argument
+/etc/passwd
+unknown: prio 0
diff --git a/tests/ts/misc/ionice b/tests/ts/misc/ionice
new file mode 100755 (executable)
index 0000000..d0cca8e
--- /dev/null
@@ -0,0 +1,28 @@
+#!/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="ionice"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+$TS_CMD_IONICE -p $$ -n 0 -c 0 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ -n 3 -c 7 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ -n 4 -c 7 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ -n 1 -c 8 >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -n 3 ls /etc/passwd >> $TS_OUTPUT 2>&1
+$TS_CMD_IONICE -p $$ >> $TS_OUTPUT 2>&1
+
+ts_finalize