freebsd-dev/sbin/md5/tests/self-test.SH
Stefan Eßer 884fc5527a sbin/md5: add tests
While the correctness of the supported hash algorithms can be tested
with the built-in self-test feature, these test cases are meant to
detect changes in the output format.

A follow-up commit will	improve	the compatibility with the coreutils
versions of the hash programs, and these tests should detect any
unintended side-effects	of such	a change on existing functionality.
2021-06-25 08:51:40 +02:00

9 lines
233 B
Bash

#!/bin/sh
while read algorithm; do
$algorithm -x > self-test.$algorithm.out || exitcode=$?
diff %%TESTSBASE%%/sbin/md5/self-test.$algorithm.chk self-test.$algorithm.out
done < %%TESTSBASE%%/sbin/md5/algorithms.txt
exit $exitcode