summaryrefslogtreecommitdiffstats
path: root/tests/ts/colcrt
diff options
context:
space:
mode:
authorSami Kerola2015-08-10 23:12:03 +0200
committerSami Kerola2015-08-10 23:12:03 +0200
commitcdf6406ddea76c7d8c4a8ed9d827f622bb919341 (patch)
treeef9e9ed3d34e9aaa4b45402cb02511f46a89da30 /tests/ts/colcrt
parentcolcrt: allocate enough space for data moves [afl & asan] (diff)
downloadkernel-qcow2-util-linux-cdf6406ddea76c7d8c4a8ed9d827f622bb919341.tar.gz
kernel-qcow2-util-linux-cdf6406ddea76c7d8c4a8ed9d827f622bb919341.tar.xz
kernel-qcow2-util-linux-cdf6406ddea76c7d8c4a8ed9d827f622bb919341.zip
tests: add colcrt regression tests
Thanks to Alaa Mubaied for providing crash1 input file making colcrt to crash. The crash2 was generated using American Fuzzy Lop. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'tests/ts/colcrt')
-rw-r--r--tests/ts/colcrt/crash1bin0 -> 314 bytes
-rw-r--r--tests/ts/colcrt/crash2bin0 -> 776 bytes
-rwxr-xr-xtests/ts/colcrt/regressions34
3 files changed, 34 insertions, 0 deletions
diff --git a/tests/ts/colcrt/crash1 b/tests/ts/colcrt/crash1
new file mode 100644
index 000000000..668118134
--- /dev/null
+++ b/tests/ts/colcrt/crash1
Binary files differ
diff --git a/tests/ts/colcrt/crash2 b/tests/ts/colcrt/crash2
new file mode 100644
index 000000000..0843cb677
--- /dev/null
+++ b/tests/ts/colcrt/crash2
Binary files differ
diff --git a/tests/ts/colcrt/regressions b/tests/ts/colcrt/regressions
new file mode 100755
index 000000000..067523f08
--- /dev/null
+++ b/tests/ts/colcrt/regressions
@@ -0,0 +1,34 @@
+#!/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="${0%/*}/../.."
+TS_DESC="regressions"
+
+. $TS_TOPDIR/functions.sh
+ts_init "$*"
+
+ts_check_test_command "$TS_CMD_COLCRT"
+
+check_input_file() {
+ ts_init_subtest ${1##*/}
+ $TS_CMD_COLCRT < $1 > $TS_OUTPUT 2>&1
+ echo "return value: $?" >> $TS_OUTPUT
+ ts_finalize_subtest
+}
+
+check_input_file "$TS_SELF/crash1"
+check_input_file "$TS_SELF/crash2"
+
+ts_finalize