Merge "Split functional tests apart"
This commit is contained in:
commit
016351b367
|
@ -0,0 +1,44 @@
|
||||||
|
# Copyright 2015 OpenStack Foundation
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||||
|
# not use this file except in compliance with the License. You may obtain
|
||||||
|
# a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
|
# License for the specific language governing permissions and limitations
|
||||||
|
# under the License.
|
||||||
|
|
||||||
|
|
||||||
|
import logging
|
||||||
|
import shutil
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
from oslo_config import cfg
|
||||||
|
|
||||||
|
from glance_store.tests.functional import base
|
||||||
|
|
||||||
|
CONF = cfg.CONF
|
||||||
|
|
||||||
|
logging.basicConfig()
|
||||||
|
|
||||||
|
|
||||||
|
class TestFilesystem(base.BaseFunctionalTests):
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super(TestFilesystem, self).__init__('file', *args, **kwargs)
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
self.tmp_image_dir = tempfile.mkdtemp(prefix='glance_store_')
|
||||||
|
CONF.set_override('filesystem_store_datadir',
|
||||||
|
self.tmp_image_dir,
|
||||||
|
group='glance_store')
|
||||||
|
super(TestFilesystem, self).setUp()
|
||||||
|
|
||||||
|
def tearDown(self):
|
||||||
|
shutil.rmtree(self.tmp_image_dir)
|
||||||
|
super(TestFilesystem, self).tearDown()
|
|
@ -14,10 +14,9 @@
|
||||||
|
|
||||||
# This script is executed inside gate_hook function in devstack gate.
|
# This script is executed inside gate_hook function in devstack gate.
|
||||||
|
|
||||||
# NOTE(NiallBunting) In future these tests should be split up. This means
|
# NOTE(NiallBunting) The store to test is passed in here from the
|
||||||
# based on the store passed to this script in $1, particular services can
|
# project config.
|
||||||
# be enabled.
|
GLANCE_STORE_DRIVER=${1:-swift}
|
||||||
GLANCE_STORE_DRIVER=swift
|
|
||||||
|
|
||||||
ENABLED_SERVICES+=",key,glance"
|
ENABLED_SERVICES+=",key,glance"
|
||||||
|
|
||||||
|
@ -27,10 +26,6 @@ case $GLANCE_STORE_DRIVER in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
export DEVSTACK_LOCAL_CONFIG
|
|
||||||
export DEVSTACK_GATE_INSTALL_TESTONLY=1
|
|
||||||
export DEVSTACK_GATE_NO_SERVICES=1
|
|
||||||
export KEEP_LOCALRC=1
|
|
||||||
export GLANCE_STORE_DRIVER
|
export GLANCE_STORE_DRIVER
|
||||||
|
|
||||||
export ENABLED_SERVICES
|
export ENABLED_SERVICES
|
||||||
|
|
|
@ -18,7 +18,7 @@ set -xe
|
||||||
|
|
||||||
export GLANCE_STORE_DIR="$BASE/new/glance_store"
|
export GLANCE_STORE_DIR="$BASE/new/glance_store"
|
||||||
SCRIPTS_DIR="/usr/os-testr-env/bin/"
|
SCRIPTS_DIR="/usr/os-testr-env/bin/"
|
||||||
venv=${1:-"dsvm-functional"}
|
GLANCE_STORE_DRIVER=${1:-swift}
|
||||||
|
|
||||||
function generate_test_logs {
|
function generate_test_logs {
|
||||||
local path="$1"
|
local path="$1"
|
||||||
|
@ -47,10 +47,6 @@ function generate_testr_results {
|
||||||
sudo mv ./*.gz /opt/stack/logs/
|
sudo mv ./*.gz /opt/stack/logs/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$venv" == dsvm-functional* ]] ; then
|
|
||||||
generate_test_logs "/tmp/${venv}-logs"
|
|
||||||
fi
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,7 +70,7 @@ iniset $GLANCE_STORE_DIR/functional_testing.conf admin key $ADMIN_PASSWORD
|
||||||
echo "Running glance_store functional test suite"
|
echo "Running glance_store functional test suite"
|
||||||
set +e
|
set +e
|
||||||
# Preserve env for OS_ credentials
|
# Preserve env for OS_ credentials
|
||||||
sudo -E -H -u jenkins tox -e functional
|
sudo -E -H -u jenkins tox -e functional-$GLANCE_STORE_DRIVER
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import random
|
import random
|
||||||
import shutil
|
|
||||||
import tempfile
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
|
@ -30,23 +28,6 @@ CONF = cfg.CONF
|
||||||
logging.basicConfig()
|
logging.basicConfig()
|
||||||
|
|
||||||
|
|
||||||
class TestFilesystem(base.BaseFunctionalTests):
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
super(TestFilesystem, self).__init__('file', *args, **kwargs)
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
self.tmp_image_dir = tempfile.mkdtemp(prefix='glance_store_')
|
|
||||||
CONF.set_override('filesystem_store_datadir',
|
|
||||||
self.tmp_image_dir,
|
|
||||||
group='glance_store')
|
|
||||||
super(TestFilesystem, self).setUp()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
shutil.rmtree(self.tmp_image_dir)
|
|
||||||
super(TestFilesystem, self).tearDown()
|
|
||||||
|
|
||||||
|
|
||||||
class TestSwift(base.BaseFunctionalTests):
|
class TestSwift(base.BaseFunctionalTests):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
11
tox.ini
11
tox.ini
|
@ -54,10 +54,15 @@ commands = python setup.py testr --coverage --testr-args='^(?!.*test.*coverage).
|
||||||
install_command = pip install --allow-all-external --allow-insecure netaddr -U {opts} {packages}
|
install_command = pip install --allow-all-external --allow-insecure netaddr -U {opts} {packages}
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional-swift]
|
||||||
sitepackages = True
|
sitepackages = True
|
||||||
setenv = OS_TEST_PATH=./glance_store/tests/functional
|
setenv = OS_TEST_PATH=./glance_store/tests/functional/swift
|
||||||
commands = python setup.py testr --slowest --testr-args='glance_store.tests.functional'
|
commands = python setup.py testr --slowest --testr-args='glance_store.tests.functional.swift'
|
||||||
|
|
||||||
|
[testenv:functional-filesystem]
|
||||||
|
sitepackages = True
|
||||||
|
setenv = OS_TEST_PATH=./glance_store/tests/functional/filesystem
|
||||||
|
commands = python setup.py testr --slowest --testr-args='glance_store.tests.functional.filesystem'
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# TODO(dmllr): Analyze or fix the warnings blacklisted below
|
# TODO(dmllr): Analyze or fix the warnings blacklisted below
|
||||||
|
|
Loading…
Reference in New Issue