diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-06-04 23:08:20 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-06-04 23:08:20 +0000 |
commit | 8646ec68ba24f185a1a106726e009229c5917414 (patch) | |
tree | 876d7552bb5895ec2f799f72848c2f14a93a91db /regress/bin/md5 | |
parent | 0c8d3eee99348f3f0f51689a7d880c5af0fe05e7 (diff) |
trivial regression tests for md5/sha1/rmd160 driver
Diffstat (limited to 'regress/bin/md5')
-rw-r--r-- | regress/bin/md5/Makefile | 54 | ||||
-rw-r--r-- | regress/bin/md5/pipe_test.md5 | 2 | ||||
-rw-r--r-- | regress/bin/md5/testsuite.md5 | 10 | ||||
-rw-r--r-- | regress/bin/md5/testsuite.rmd160 | 10 | ||||
-rw-r--r-- | regress/bin/md5/testsuite.sha1 | 10 |
5 files changed, 86 insertions, 0 deletions
diff --git a/regress/bin/md5/Makefile b/regress/bin/md5/Makefile new file mode 100644 index 00000000000..71b4adec00e --- /dev/null +++ b/regress/bin/md5/Makefile @@ -0,0 +1,54 @@ +# $OpenBSD: Makefile,v 1.1 2001/06/04 23:08:18 millert Exp $ + +NOMAN= +NOPROG= + +regress: t1 t2 t3 t4 t5 t6 t7 + +t1: t1.out + @cmp -s ${.CURDIR}/testsuite.md5 t1.out || \ + echo 'MD5 test suite output does not match expected output' + +t2: t2.out + @cmp -s ${.CURDIR}/testsuite.sha1 t2.out || \ + echo 'SHA1 test suite output does not match expected output' + +t3: t3.out + @cmp -s ${.CURDIR}/testsuite.rmd160 t3.out || \ + echo 'RMD160 test suite output does not match expected output' + +t4: + @if md5 -s "" /dev/null >/dev/null 2>&1; then \ + echo "FAILED: md5 should not allow a string on the command line along with a filename"; \ + fi + +t5: t5.out + @cmp -s ${.CURDIR}/pipe_test.md5 t5.out || \ + echo '"echo hi | md5 -p" does not match expected output' + +t6: + @if echo hi | md5 -p /dev/null >/dev/null 2>&1; then \ + echo "FAILED: md5 should not allow a filename on the command line in -p mode"; \ + fi + +t7: + @if [ `md5 /dev/null /dev/null | wc -l` != 2 ]; then \ + echo "FAILED: md5 doesn't handle multiple files"; \ + fi + +t1.out: + md5 -x >$@ + +t2.out: + sha1 -x >$@ + +t3.out: + rmd160 -x >$@ + +t5.out: + echo hi | md5 -p >$@ + +.PHONY: t1 t2 t3 t4 t5 t6 t7 regress +CLEANFILES+=t1.out t2.out t3.out t5.out + +.include <bsd.prog.mk> diff --git a/regress/bin/md5/pipe_test.md5 b/regress/bin/md5/pipe_test.md5 new file mode 100644 index 00000000000..c6ad17d997d --- /dev/null +++ b/regress/bin/md5/pipe_test.md5 @@ -0,0 +1,2 @@ +hi +764efa883dda1e11db47671c4a3bbd9e diff --git a/regress/bin/md5/testsuite.md5 b/regress/bin/md5/testsuite.md5 new file mode 100644 index 00000000000..96ec9270fcc --- /dev/null +++ b/regress/bin/md5/testsuite.md5 @@ -0,0 +1,10 @@ +MD5 test suite: +MD5 ("") = d41d8cd98f00b204e9800998ecf8427e +MD5 ("a") = 0cc175b9c0f1b6a831c399e269772661 +MD5 ("abc") = 900150983cd24fb0d6963f7d28e17f72 +MD5 ("message digest") = f96b697d7cb7938d525a2f31aaf161d0 +MD5 ("abcdefghijklmnopqrstuvwxyz") = c3fcd3d76192e4007dfb496cca67e13b +MD5 ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = 8215ef0796a20bcaaae116d3876c664a +MD5 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = d174ab98d277d9f5a5611c2c9f419d9f +MD5 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = 57edf4a22be3c955ac49da2e2107b67a +MD5 (one million 'a' characters) = 7707d6ae4e027c70eea2a935c2296f21 diff --git a/regress/bin/md5/testsuite.rmd160 b/regress/bin/md5/testsuite.rmd160 new file mode 100644 index 00000000000..4a3f111813e --- /dev/null +++ b/regress/bin/md5/testsuite.rmd160 @@ -0,0 +1,10 @@ +RMD160 test suite: +RMD160 ("") = 9c1185a5c5e9fc54612808977ee8f548b2258d31 +RMD160 ("a") = 0bdc9d2d256b3ee9daae347be6f4dc835a467ffe +RMD160 ("abc") = 8eb208f7e05d987a9b044a8e98c6b087f15a0bfc +RMD160 ("message digest") = 5d0689ef49d2fae572b881b123a85ffa21595f36 +RMD160 ("abcdefghijklmnopqrstuvwxyz") = f71c27109c692c1b56bbdceb5b9d2865b3708dbc +RMD160 ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = 12a053384a9c0c88e405a06c27dcf49ada62eb2b +RMD160 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = b0e20b6e3116640286ed3a87a5713079b21f5189 +RMD160 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = 9b752e45573d4b39f4dbd3323cab82bf63326bfb +RMD160 (one million 'a' characters) = 52783243c1697bdbe16d37f97f68f08325dc1528 diff --git a/regress/bin/md5/testsuite.sha1 b/regress/bin/md5/testsuite.sha1 new file mode 100644 index 00000000000..8ee49b4d76a --- /dev/null +++ b/regress/bin/md5/testsuite.sha1 @@ -0,0 +1,10 @@ +SHA1 test suite: +SHA1 ("") = da39a3ee5e6b4b0d3255bfef95601890afd80709 +SHA1 ("a") = 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 +SHA1 ("abc") = a9993e364706816aba3e25717850c26c9cd0d89d +SHA1 ("message digest") = c12252ceda8be8994d5fa0290a47231c1d16aae3 +SHA1 ("abcdefghijklmnopqrstuvwxyz") = 32d10c7b8cf96570ca04ce37f2a19d84240d3a89 +SHA1 ("abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq") = 84983e441c3bd26ebaae4aa1f95129e5e54670f1 +SHA1 ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789") = 761c457bf73b14d27e9e9265c46f4b4dda11f940 +SHA1 ("12345678901234567890123456789012345678901234567890123456789012345678901234567890") = 50abf5706a150990a08b2c5ea40fa0e585554732 +SHA1 (one million 'a' characters) = 34aa973cd4c4daa4f61eeb2bdbad27316534016f |