4 # Try to read a syslog file and store in a database that does not exist.
5 # gcm_input should return an error and save the input in an XML file.
14 if psql gnucomo_test -q <../src/database/create.sql >/dev/null
16 psql gnucomo_test -q -c "insert into object (objectname) values ('example1.gnucomo.test')"
17 ../src/gcm_input/gcm_input -c gnucomo_nodb -h example1.gnucomo.test -d 'sep 5 2002 20:30:45' <messages
19 echo "gcm_input returned $result"
21 if [[ $result -eq 1 ]]
23 # check if nothing was stored in the (existing) database
24 NR_LOGS=`psql gnucomo_test -q -t -c "select count(*) from log"`
25 if [[ $NR_LOGS -eq 0 ]]
27 echo "No log entries in database"
30 # check if the saved XML file exists
31 SAVEDFILE=`grep 'XML content stored' gcm_input.log |cut -d ' ' -f 12`
32 echo "Saved file is $SAVEDFILE"
33 if [[ ! -e $SAVEDFILE ]]
35 echo $SAVEDFILE does not exist.
38 rm $SAVEDFILE # cleanup
40 echo "gcm_input did not return an error"
43 psql gnucomo_test -f ../src/database/destroy.sql -q
45 echo Can not create test database