aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-08-20 09:45:07 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-08-20 09:45:07 +0200
commite3c0db1026dba1fdec24096a76c59e99d5512a3a (patch)
tree8a43509cfe81a2099a5b7205cc6f1c145d72f00f
parentea8c0bce088b938617cda5fa9fb92914e4836bd3 (diff)
parent6ed174d0e41bc01d9f6b854e634ab6132788bf85 (diff)
downloadnextcloud-server-e3c0db1026dba1fdec24096a76c59e99d5512a3a.tar.gz
nextcloud-server-e3c0db1026dba1fdec24096a76c59e99d5512a3a.zip
Merge pull request #10534 from owncloud/autotest-cleanuponinterrupt
Restore autotest config on SIGINT or SIGTERM
-rwxr-xr-xautotest.sh16
1 files changed, 11 insertions, 5 deletions
diff --git a/autotest.sh b/autotest.sh
index 4030fc0250e..d359aed91e7 100755
--- a/autotest.sh
+++ b/autotest.sh
@@ -63,6 +63,16 @@ if [ -f config/config.php ]; then
mv config/config.php config/config-autotest-backup.php
fi
+function restore_config {
+ # Restore existing config
+ if [ -f config/config-autotest-backup.php ]; then
+ mv config/config-autotest-backup.php config/config.php
+ fi
+}
+
+# restore config on exit, even when killed
+trap restore_config SIGINT SIGTERM
+
# use tmpfs for datadir - should speedup unit test execution
if [ -d /dev/shm ]; then
DATADIR=/dev/shm/data-autotest$EXECUTOR_NUMBER
@@ -220,11 +230,7 @@ fi
cd $BASEDIR
-# Restore existing config
-if [ -f config/config-autotest-backup.php ]; then
- mv config/config-autotest-backup.php config/config.php
-fi
-
+restore_config
#
# NOTES on mysql:
# - CREATE DATABASE oc_autotest;