blob: 2fd2a3d40edb58bd3c5fc46bac67753581522239 [file] [log] [blame] [raw]
#!/bin/sh
testitem=$1
TESTMODE=$2
todo=`expr ${testitem} : '.*\/\(.*\)$'`
resdir=`expr ${testitem} : '\(.*\)\/.*$'`
args=`awk "/^${todo} / { print; } " test.format`
set $args
if [ ${TESTMODE} != user ] ; then
exit 0
fi
. ./setup_test.sh
echo "${todo}...";
input=`expr ${todo} : 'bpf-\(.*\)'`
/bin/cp /dev/null ${results}
( while read rule; do
echo "$rule" | ../ipftest -Rbr - -i input/$input >> ${results};
if [ $? -ne 0 ] ; then
exit 1;
fi
echo "--------" >> ${results};
done ) < ${regress}
cmp ${expected} ${results};
status=$?
if [ $status = 0 ] ; then
$TOUCH ${resdir}/${todo}
fi
exit $status