diff options
author | Mark Wells <mark@freeside.biz> | 2015-08-06 23:15:26 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-08-06 23:15:26 -0700 |
commit | 3e2c2ad8aff1bd361ca07495b2255538c8231079 (patch) | |
tree | 9a398e455a7767372588077470685d25ef8d82b3 /FS-Test/bin | |
parent | 3d8d713877e0cdc91fd413539510b5a457f264bb (diff) |
update tests to keep in sync with v4
Diffstat (limited to 'FS-Test/bin')
-rw-r--r-- | FS-Test/bin/freeside-test-run | 2 | ||||
-rwxr-xr-x | FS-Test/bin/freeside-test-start | 7 | ||||
-rwxr-xr-x | FS-Test/bin/freeside-test-stop | 7 |
3 files changed, 9 insertions, 7 deletions
diff --git a/FS-Test/bin/freeside-test-run b/FS-Test/bin/freeside-test-run index e709641c1..add1e9b25 100644 --- a/FS-Test/bin/freeside-test-run +++ b/FS-Test/bin/freeside-test-run @@ -14,6 +14,6 @@ freeside-test-stop || true diffname=freeside-test.`date +%Y%m%d`.diff echo "Writing diff to $diffname." -diff -urb "$tempdir" "$sharedir/output" > $diffname +diff -urb "$sharedir/output" "$tempdir" > $diffname diffstat -C $diffname diff --git a/FS-Test/bin/freeside-test-start b/FS-Test/bin/freeside-test-start index 197a84702..cfa1adbc5 100755 --- a/FS-Test/bin/freeside-test-start +++ b/FS-Test/bin/freeside-test-start @@ -49,8 +49,9 @@ sudo cp $sharedir/htpasswd /usr/local/etc/freeside/htpasswd newtime=$(sudo -u freeside \ psql -tc 'SELECT to_timestamp(max(_date) + 86400) FROM cust_bill' \ ) -echo "Setting clock to $newtime." -sudo date -s "$newtime" +# no longer needed since we don't run LaTeX in the test script +#echo "Setting clock to $newtime." +#sudo date -s "$newtime" #echo "Applying upgrades." #sudo -u freeside freeside-upgrade test @@ -58,6 +59,6 @@ sudo date -s "$newtime" # start Apache on a future date when all of the invoice dates are in the past echo "Restarting Apache." -sudo service apache2 start +sudo faketime "$newtime" apache2ctl start echo "Done." diff --git a/FS-Test/bin/freeside-test-stop b/FS-Test/bin/freeside-test-stop index 50668907c..08485f796 100755 --- a/FS-Test/bin/freeside-test-stop +++ b/FS-Test/bin/freeside-test-stop @@ -5,11 +5,12 @@ set -ae echo "Stopping Apache." sudo service apache2 stop -echo "Resetting clock." -sudo hwclock --hctosys - newname=freeside_test_`date +%Y%m%d` if psql -l |grep -q '^ *freeside '; then + if psql -l |grep -q $newname; then + echo "Deleting old test database $newname." + dropdb "$newname" + fi echo "Renaming test database to $newname." psql postgres -c "ALTER DATABASE freeside RENAME TO $newname" fi |