4 # Test the database upgrades in gcm_daemon.
5 # Create an old, version 1, database and run gcm_daemon to perform
6 # an upgrade to the latest version.
7 # Then, create a latest-version database and compare dumps of these
8 # database. They should be essentially the same.
13 if psql gnucomo_test <create_v1.sql -q >/dev/null
15 cd ../src/gcm_daemon; ln -f -s ../../test/gnucomo_test.conf .; ./gcm_daemon.php -c gnucomo_test ; cd ../../test
16 pg_dump gnucomo_test |grep -v '^--' | sort >dump.upgraded.sql
17 psql gnucomo_test -f ../src/database/destroy.sql -q
18 psql gnucomo_test <../src/database/create.sql -q >/dev/null
19 pg_dump gnucomo_test |grep -v '^--' | sort >dump.latest.sql
20 psql gnucomo_test -f ../src/database/destroy.sql -q
22 # Expect 28 lines of diff output (character varying vs. text types)
23 echo Comparing dump.latest.sql with dump.upgraded.sql
24 diff dump.latest.sql dump.upgraded.sql
30 echo Can not create test database