- (dtucker) [regress/stderr-after-eof.sh regress/test-exec.sh] Move the md5

helper function to the portable part of test-exec.sh.
This commit is contained in:
Darren Tucker 2013-05-17 19:53:25 +10:00
parent 6f66981ed3
commit f8d5b34517
3 changed files with 17 additions and 13 deletions

View File

@ -82,6 +82,8 @@
Move the jot helper function to portable-specific part of test-exec.sh. Move the jot helper function to portable-specific part of test-exec.sh.
- (dtucker) [regress/test-exec.sh] Move the portable-specific functions - (dtucker) [regress/test-exec.sh] Move the portable-specific functions
together and add a couple of missing lines from openbsd. 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 20130516
- (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be

View File

@ -3,23 +3,11 @@
tid="stderr data after eof" 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 # setup data
rm -f ${DATA} ${COPY} rm -f ${DATA} ${COPY}
cp /dev/null ${DATA} cp /dev/null ${DATA}
for i in 1 2 3 4 5 6; do for i in 1 2 3 4 5 6; do
(date;echo $i) | $CHECKSUM >> ${DATA} (date;echo $i) | md5 >> ${DATA}
done done
${SSH} -2 -F $OBJ/ssh_proxy otherhost \ ${SSH} -2 -F $OBJ/ssh_proxy otherhost \

View File

@ -207,6 +207,20 @@ config_defined ()
done done
egrep "^#define.*($str)" ${BUILDDIR}/config.h >/dev/null 2>&1 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 # End of portable specific functions
# helper # helper