summaryrefslogtreecommitdiff
path: root/test/run_test.sh
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2004-06-25 22:54:33 +0000
committerIan C <ianc@noddybox.co.uk>2004-06-25 22:54:33 +0000
commit225ea435762b45016242332d665ee97bbb3313e2 (patch)
treea6f8663ae093a9ff19deeb84765273f080ee8300 /test/run_test.sh
parent4a6391ce910b5f71574e20b31f1e9429d756b96d (diff)
Fixed bug where trusted users weren't. Also a couple of memory bugs in the
database.
Diffstat (limited to 'test/run_test.sh')
-rwxr-xr-xtest/run_test.sh55
1 files changed, 55 insertions, 0 deletions
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