From 9775d40fff67087f277a1aa9c33aa65b26041c4a Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 8 Dec 2008 12:36:07 +0100 Subject: [PATCH] tests: add md5 regression test Signed-off-by: Karel Zak --- tests/commands.sh.in | 1 + tests/expected/ts-md5 | 7 +++++++ tests/input/ts-md5 | 7 +++++++ tests/ts-md5 | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 tests/expected/ts-md5 create mode 100644 tests/input/ts-md5 create mode 100755 tests/ts-md5 diff --git a/tests/commands.sh.in b/tests/commands.sh.in index bc4dbbde..25b3c3a5 100644 --- a/tests/commands.sh.in +++ b/tests/commands.sh.in @@ -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 index 00000000..6ca300b3 --- /dev/null +++ b/tests/expected/ts-md5 @@ -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 index 00000000..1eed05a0 --- /dev/null +++ b/tests/input/ts-md5 @@ -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 index 00000000..6c04c9cb --- /dev/null +++ b/tests/ts-md5 @@ -0,0 +1,36 @@ +#!/bin/bash + +# +# Copyright (C) 2007 Karel Zak +# +# 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 + -- 2.39.5