#!/bin/bash # Check the environment # if [ ! -x ../src/kbs ] ; then echo kbs not built! exit fi rm -f log ../src/kbs test-config OK=1 function fail() { echo "BAD: " $* OK=0 } function good() { echo GOOD: $* } if [ "`wc -l log | awk '{print $1}'`" != 8 ] ; then fail Incorrect number of lines in log file - expected 8 else good Correct number of lines in log file - expected 8 fi for i in trusted@ freebsd.org good_user ; do if [ "`egrep $i log`" != "" ] ; then fail Item $i incorrectly deleted else good Item $i correctly not deleted fi done for i in bad_user@ microsoft.com bad_user2@ bad_user_uname@ bad_user_hname@ ; do if [ "`egrep $i log`" == "" ] ; then fail Item $i incorrectly not deleted else good Item $i correctly deleted fi done if [ $OK == 1 ] ; then echo '**** TEST OK' else echo '**** TEST FAILED' fi rm -f log