From f8d5b3451726530a864b172c556c311370c244e1 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 17 May 2013 19:53:25 +1000 Subject: [PATCH] - (dtucker) [regress/stderr-after-eof.sh regress/test-exec.sh] Move the md5 helper function to the portable part of test-exec.sh. --- ChangeLog | 2 ++ regress/stderr-after-eof.sh | 14 +------------- regress/test-exec.sh | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index f998c301c..ec9ab1229 100644 --- a/ChangeLog +++ b/ChangeLog @@ -82,6 +82,8 @@ Move the jot helper function to portable-specific part of test-exec.sh. - (dtucker) [regress/test-exec.sh] Move the portable-specific functions together and add a couple of missing lines from openbsd. + - (dtucker) [regress/stderr-after-eof.sh regress/test-exec.sh] Move the md5 + helper function to the portable part of test-exec.sh. 20130516 - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be diff --git a/regress/stderr-after-eof.sh b/regress/stderr-after-eof.sh index 9072db282..218ac6b68 100644 --- a/regress/stderr-after-eof.sh +++ b/regress/stderr-after-eof.sh @@ -3,23 +3,11 @@ tid="stderr data after eof" -if have_prog md5sum; then - CHECKSUM=md5sum -elif have_prog openssl; then - CHECKSUM="openssl md5" -elif have_prog cksum; then - CHECKSUM=cksum -elif have_prog sum; then - CHECKSUM=sum -else - fatal "No checksum program available, aborting $tid test" -fi - # setup data rm -f ${DATA} ${COPY} cp /dev/null ${DATA} for i in 1 2 3 4 5 6; do - (date;echo $i) | $CHECKSUM >> ${DATA} + (date;echo $i) | md5 >> ${DATA} done ${SSH} -2 -F $OBJ/ssh_proxy otherhost \ diff --git a/regress/test-exec.sh b/regress/test-exec.sh index 69e5042ba..d336e6193 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh @@ -207,6 +207,20 @@ config_defined () done egrep "^#define.*($str)" ${BUILDDIR}/config.h >/dev/null 2>&1 } + +md5 () { + if have_prog md5sum; then + md5sum + elif have_prog openssl; then + openssl md5 + elif have_prog cksum; then + cksum + elif have_prog sum; then + sum + else + wc -c + fi +} # End of portable specific functions # helper