From 225ea435762b45016242332d665ee97bbb3313e2 Mon Sep 17 00:00:00 2001 From: Ian C Date: Fri, 25 Jun 2004 22:54:33 +0000 Subject: Fixed bug where trusted users weren't. Also a couple of memory bugs in the database. --- test/run_test.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 test/run_test.sh (limited to 'test/run_test.sh') diff --git a/test/run_test.sh b/test/run_test.sh new file mode 100755 index 0000000..de78860 --- /dev/null +++ b/test/run_test.sh @@ -0,0 +1,55 @@ +#!/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 -- cgit v1.2.3