]> err.no Git - util-linux/commitdiff
tests: add md5 regression test
authorKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2008 11:36:07 +0000 (12:36 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Dec 2008 11:36:07 +0000 (12:36 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/commands.sh.in
tests/expected/ts-md5 [new file with mode: 0644]
tests/input/ts-md5 [new file with mode: 0644]
tests/ts-md5 [new file with mode: 0755]

index bc4dbbde75e46a596a337c71520f4c1ad31f7d61..25b3c3a5a3124b4c48e640b6d727e25eb0ccf9ba 100644 (file)
@@ -10,6 +10,7 @@ TS_TESTUSER=${TS_TESTUSER:-"test"}
 TS_HELPER_SYSINFO="$TS_TOPDIR/helpers/test_sysinfo"
 TS_HELPER_PATHS="$TS_TOPDIR/helpers/test_pathnames"
 TS_HELPER_BYTESWAP="$TS_TOPDIR/helpers/test_byteswap"
+TS_HELPER_MD5="$TS_TOPDIR/helpers/test_md5"
 
 # external commands
 TS_ECMD_BLKID="@BLKID@"
diff --git a/tests/expected/ts-md5 b/tests/expected/ts-md5
new file mode 100644 (file)
index 0000000..6ca300b
--- /dev/null
@@ -0,0 +1,7 @@
+d41d8cd98f00b204e9800998ecf8427e  -
+900150983cd24fb0d6963f7d28e17f72  -
+5eb6d580e5f68fde65c3778afb8826ff  -
+bd1e13bdaab82581d4dc299eb9a3da0f  -
+d81ee4f567972a18f9326540b5d8aeaf  -
+9561bd208c0041c673080ed744919b85  -
+d98d58d5562ca4dd47f0f0fe86b2d48f  -
diff --git a/tests/input/ts-md5 b/tests/input/ts-md5
new file mode 100644 (file)
index 0000000..1eed05a
--- /dev/null
@@ -0,0 +1,7 @@
+
+abc
+qazxswedc
+1qazxsw23edc
+a a a a a a a a a a
+KUWIOJDNWQKLFDHQUWEDAYCNAUIWSYDUQUICBSKLBCLUWIGDF
+EASC6545642432132SDECSESCEACSJKDWIOUDOIWIDOQPWUDQWIOSNXCSASCA
diff --git a/tests/ts-md5 b/tests/ts-md5
new file mode 100755 (executable)
index 0000000..6c04c9c
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+#
+# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
+#
+# This file is part of util-linux-ng.
+#
+# 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.
+#
+. ./commands.sh
+. ./functions.sh
+
+TS_COMPONENT="md5"
+TS_DESC=""
+
+ts_init "$*"
+> $TS_OUTPUT
+
+MY_MD5_UTIL="$TS_HELPER_MD5"
+#MY_MD5_UTIL="md5sum"
+
+cat $TS_INPUT | while read data
+do
+       echo -n $data | $MY_MD5_UTIL >> $TS_OUTPUT
+done
+
+ts_finalize
+