summaryrefslogtreecommitdiff
path: root/test/run_test.sh
diff options
context:
space:
mode:
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