--- /dev/null
+#!/bin/sh
+
+#
+# Create an object 'example1.gnucomo.test' in the database and
+# parse a piece of an apache error log file.
+# This tests normal operation in which gcm_input reads a error log file
+# directly.
+
+
+rm -f gcm_input.log
+
+createdb gnucomo_test
+
+if psql gnucomo_test -q <../src/database/create.sql >/dev/null
+then
+ psql gnucomo_test -q -c "insert into object (objectname) values ('example1.gnucomo.test')"
+ ../src/gcm_input/gcm_input -v -c gnucomo_test -h example1.gnucomo.test -d 'dec 5 2007 15:30:45' <apache_error.1.log
+ ../src/gcm_input/gcm_input -v -c gnucomo_test -h example1.gnucomo.test -d 'sep 5 2002 20:30:45' <apache_error.2.log
+ ../src/gcm_input/gcm_input -v -c gnucomo_test -h example1.gnucomo.test -d 'sep 9 2020 17:30:45' <apache_error.3.log
+ psql gnucomo_test -q -t -c "select * from log" -o log.tbl
+ diff read_apache_error.log.expect log.tbl
+ result=$?
+ psql gnucomo_test -f ../src/database/destroy.sql -q
+ dropdb gnucomo_test
+ exit $result
+else
+ echo Can not create test database
+ dropdb gnucomo_test
+ exit 1
+fi