#!/bin/sh

if [ ! -c /dev/random ]; then
	echo "*** NOTICE: Skipping test -- no /dev/random found"
	exit 0
fi

dd if=/dev/random of=./test-file-1.bin bs=1024 count=1024 2> /dev/null
if [ "$?" -ne 0 ]; then exit 1; fi
cat ./test-file-1.bin | ./bar 2> log.test-003.txt > ./test-file-2.bin
if [ "$?" -ne 0 ]; then exit 1; fi
cmp ./test-file-1.bin ./test-file-2.bin > /dev/null 2>&1
if [ "$?" -ne 0 ]; then exit 1; fi
# rm -f ./test-file-1.bin ./test-file-2.bin
exit 0
