00e13b1d67
understood by Perl's Test::Harness module and prove(1) commands. Update README to describe the new protocol. The work's broken down into two main sets of changes. First, update the existing test programs (shell scripts and C programs) to produce output in the ok/not ok format, and to, where possible, also produce a header describing the number of tests that are expected to be run. Second, provide the .t files that actually run the tests. In some cases these are copies of, or very similar too, scripts that already existed. I've kept the old scripts around so that it's possible to verify that behaviour under this new system (in terms of whether or not a test fails) is identical to the behaviour under the old system. Add a TODO file.
35 lines
747 B
Bash
35 lines
747 B
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
|
|
base=`basename $0`
|
|
us=45
|
|
work="/dev/md${us}"
|
|
src="/dev/md`expr $us + 1`"
|
|
|
|
mdconfig -a -t malloc -s 1M -u $us || exit 1
|
|
mdconfig -a -t malloc -s 1M -u `expr $us + 1` || exit 1
|
|
dd if=/dev/random of=$work bs=1m count=1 >/dev/null 2>&1
|
|
dd if=/dev/random of=$src bs=1m count=1 >/dev/null 2>&1
|
|
sum=`cat $src | md5 -q`
|
|
|
|
ggatel create -u $us $work
|
|
|
|
dd if=${src} of=/dev/ggate${us} bs=1m count=1 >/dev/null 2>&1
|
|
|
|
echo '1..2'
|
|
|
|
if [ `cat $work | md5 -q` != $sum ]; then
|
|
echo 'not ok 1 - md5 checksum'
|
|
else
|
|
echo 'ok 1 - md5 checksum'
|
|
if [ `cat /dev/ggate${us} | md5 -q` != $sum ]; then
|
|
echo 'not ok 2 - md5 checksum'
|
|
else
|
|
echo 'ok 2 - md5 checksum'
|
|
fi
|
|
fi
|
|
|
|
ggatel destroy -u $us
|
|
mdconfig -d -u $us
|
|
mdconfig -d -u `expr $us + 1`
|