--- /dev/null
+#!/bin/bash
+
+#
+# Create an object 'test.gnucomo.org' in the database and
+# and read several filesystems report created by df.
+
+rm -f gcm_input.log
+
+createdb gnucomo_test
+result=1
+
+if psql gnucomo_test -q <../src/database/create.sql >/dev/null
+then
+ psql gnucomo_test -q -c "insert into object (objectname) values ('test.gnucomo.org')"
+
+ # read the output from 'df -k'
+ echo "Read output from 'df -k'"
+ ../src/gcm_input/gcm_input -v -c gnucomo_test -h test.gnucomo.org -d 'sep 7 2007 13:20:45' <df-k.out
+ result=$?
+ if [[ $result -eq 0 ]]
+ then
+ NR_PARS=`psql gnucomo_test -q -t -c "select count(*) from parameter"`
+ echo $NR_PARS parameters in the datebase
+ NR_PROP=`psql gnucomo_test -q -t -c "select count(*) from property"`
+ echo $NR_PROP parameter properties in the datebase
+ if [[ $NR_PARS -ne 7 ]]
+ then
+ result=2
+ fi
+ if [[ $NR_PROP -ne 28 ]]
+ then
+ result=3
+ fi
+ fi
+
+ psql gnucomo_test -f ../src/database/destroy.sql -q
+else
+ echo Can not create test database
+ result=1
+fi
+
+dropdb gnucomo_test
+exit $result