diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-09-28 16:38:01 +0200 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-10-06 16:27:25 +0200 |
commit | 5646e39248d9ac2bade491dc99c88a10b3dfbc34 (patch) | |
tree | a330a10aa0979d00b3449205c95cf484af6d03b2 /autotest.sh | |
parent | bb4246c9a8dc40d844ad94492cb40ece5bd35ef6 (diff) | |
download | nextcloud-server-5646e39248d9ac2bade491dc99c88a10b3dfbc34.tar.gz nextcloud-server-5646e39248d9ac2bade491dc99c88a10b3dfbc34.zip |
test objectstore with ceph docker
use default config for swift primary storage test config
allow testsuite to complete
fix timeout, script cleanup, enable debug for now
use btrfs loopback device, requires privileged container and absolute path
throw exception when storage has problems
debug by echo ...
sleep more, more debug
Diffstat (limited to 'autotest.sh')
-rwxr-xr-x | autotest.sh | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/autotest.sh b/autotest.sh index f69a9b34a48..42807b83e11 100755 --- a/autotest.sh +++ b/autotest.sh @@ -9,6 +9,7 @@ # @author Andreas Fischer # @author Joas Schilling # @author Lukas Reschke +# @author Jörn Friedrich Dreyer # @copyright 2012-2015 Thomas Müller thomas.mueller@tmit.eu # @@ -21,6 +22,7 @@ DATABASEHOST=localhost ADMINLOGIN=admin$EXECUTOR_NUMBER BASEDIR=$PWD +PRIMARY_STORAGE_CONFIGS="local swift" DBCONFIGS="sqlite mysql mariadb pgsql oci" # $PHP_EXE is run through 'which' and as such e.g. 'php' or 'hhvm' is usually @@ -91,6 +93,22 @@ if [ "$1" ]; then exit 2 fi fi +if [ "$PRIMARY_STORAGE_CONFIG" ]; then + FOUND=0 + for PSC in $PRIMARY_STORAGE_CONFIGS; do + if [ "$PRIMARY_STORAGE_CONFIG" = "$PSC" ]; then + FOUND=1 + break + fi + done + if [ $FOUND = 0 ]; then + echo -e "Unknown primary storage config name \"$PRIMARY_STORAGE_CONFIG\"\n" >&2 + print_syntax + exit 2 + fi +else + PRIMARY_STORAGE_CONFIG="local" +fi # check for the presence of @since in all OCP methods $PHP build/OCPSinceChecker.php @@ -101,12 +119,17 @@ if [ -f config/config.php ] && [ ! -f config/config-autotest-backup.php ]; then fi function cleanup_config { + if [ ! -z "$DOCKER_CONTAINER_ID" ]; then echo "Kill the docker $DOCKER_CONTAINER_ID" docker rm -f "$DOCKER_CONTAINER_ID" fi cd "$BASEDIR" + if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then + echo "Kill the swift docker" + tests/objectstore/stop-swift-ceph.sh + fi # Restore existing config if [ -f config/config-autotest-backup.php ]; then mv config/config-autotest-backup.php config/config.php @@ -115,6 +138,10 @@ function cleanup_config { if [ -f config/autoconfig.php ]; then rm config/autoconfig.php fi + # Remove autotest swift storage config + if [ -f config/autotest-storage-swift.config.php ]; then + rm config/autotest-storage-swift.config.php + fi } # restore config on exit @@ -131,7 +158,7 @@ echo "Using database $DATABASENAME" function execute_tests { DB=$1 - echo "Setup environment for $DB testing ..." + echo "Setup environment for $DB testing on $PRIMARY_STORAGE_CONFIG storage ..." # back to root folder cd "$BASEDIR" @@ -142,6 +169,10 @@ function execute_tests { rm -rf "$DATADIR" mkdir "$DATADIR" + if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then + tests/objectstore/start-swift-ceph.sh + cp tests/objectstore/swift.config.php config/autotest-storage-swift.config.php + fi cp tests/preseed-config.php config/config.php _DB=$DB @@ -238,6 +269,11 @@ function execute_tests { RESULT=$? fi + if [ "$PRIMARY_STORAGE_CONFIG" == "swift" ] ; then + echo "Kill the swift docker" + tests/objectstore/stop-swift-ceph.sh + fi + if [ ! -z "$DOCKER_CONTAINER_ID" ] ; then echo "Kill the docker $DOCKER_CONTAINER_ID" docker rm -f $DOCKER_CONTAINER_ID |