Merge "Add the Tricircle tempest plugin with a sample test case"
This commit is contained in:
commit
38cb40776d
@ -2,6 +2,6 @@
|
||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
|
||||
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
|
||||
${PYTHON:-python} -m subunit.run discover $TRICIRCLE_TEST_DIRECTORY $LISTOPT $IDOPTION
|
||||
test_id_option=--load-list $IDFILE
|
||||
test_list_option=--list
|
||||
|
@ -257,6 +257,8 @@ if [[ "$Q_ENABLE_TRICIRCLE" == "True" ]]; then
|
||||
|
||||
echo export PYTHONPATH=\$PYTHONPATH:$TRICIRCLE_DIR >> $RC_DIR/.localrc.auto
|
||||
|
||||
setup_package $TRICIRCLE_DIR -e
|
||||
|
||||
recreate_database tricircle
|
||||
python "$TRICIRCLE_DIR/cmd/manage.py" "$TRICIRCLE_API_CONF"
|
||||
|
||||
|
@ -55,3 +55,6 @@ oslo.config.opts =
|
||||
tricircle.nova_apigw = tricircle.nova_apigw.opts:list_opts
|
||||
tricircle.cinder_apigw = tricircle.cinder_apigw.opts:list_opts
|
||||
tricircle.xjob = tricircle.xjob.opts:list_opts
|
||||
|
||||
tempest.test_plugins =
|
||||
tricircle_tests = tricircle.tempestplugin.plugin:TricircleTempestPlugin
|
||||
|
3
tox.ini
3
tox.ini
@ -9,10 +9,11 @@ usedevelop = True
|
||||
install_command = pip install -U --force-reinstall {opts} {packages}
|
||||
setenv =
|
||||
VIRTUAL_ENV={envdir}
|
||||
TRICIRCLE_TEST_DIRECTORY=tricircle/tests
|
||||
deps =
|
||||
-r{toxinidir}/test-requirements.txt
|
||||
-egit+https://git.openstack.org/openstack/neutron@master#egg=neutron
|
||||
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
||||
commands = python setup.py testr --slowest --testr-args='{posargs}'
|
||||
whitelist_externals = rm
|
||||
|
||||
[testenv:pep8]
|
||||
|
6
tricircle/tempestplugin/README.rst
Normal file
6
tricircle/tempestplugin/README.rst
Normal file
@ -0,0 +1,6 @@
|
||||
===============================================
|
||||
Tempest Integration of Tricircle
|
||||
===============================================
|
||||
|
||||
This directory contains Tempest tests to cover the Tricircle project.
|
||||
|
0
tricircle/tempestplugin/__init__.py
Normal file
0
tricircle/tempestplugin/__init__.py
Normal file
16
tricircle/tempestplugin/config.py
Normal file
16
tricircle/tempestplugin/config.py
Normal file
@ -0,0 +1,16 @@
|
||||
# Copyright 2016 Huawei Technologies Co., Ltd.
|
||||
# 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.
|
||||
|
||||
from tricircle.common import config as t_config # noqa
|
38
tricircle/tempestplugin/plugin.py
Normal file
38
tricircle/tempestplugin/plugin.py
Normal file
@ -0,0 +1,38 @@
|
||||
# Copyright 2015
|
||||
# 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 os
|
||||
|
||||
from tempest import config # noqa
|
||||
from tempest.test_discover import plugins
|
||||
|
||||
from tricircle.tests.tempestplugin import config as project_config # noqa
|
||||
|
||||
|
||||
class TricircleTempestPlugin(plugins.TempestPlugin):
|
||||
|
||||
def load_tests(self):
|
||||
base_path = os.path.split(os.path.dirname(
|
||||
os.path.abspath(__file__)))[0]
|
||||
test_dir = "tempestplugin/tests"
|
||||
full_test_dir = os.path.join(base_path, test_dir)
|
||||
return full_test_dir, base_path
|
||||
|
||||
def register_opts(self, conf):
|
||||
pass
|
||||
|
||||
def get_opt_lists(self):
|
||||
pass
|
0
tricircle/tempestplugin/services/__init__.py
Normal file
0
tricircle/tempestplugin/services/__init__.py
Normal file
0
tricircle/tempestplugin/tests/__init__.py
Normal file
0
tricircle/tempestplugin/tests/__init__.py
Normal file
0
tricircle/tempestplugin/tests/api/__init__.py
Normal file
0
tricircle/tempestplugin/tests/api/__init__.py
Normal file
29
tricircle/tempestplugin/tests/api/base.py
Normal file
29
tricircle/tempestplugin/tests/api/base.py
Normal file
@ -0,0 +1,29 @@
|
||||
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
|
||||
# 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.
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from tempest import config
|
||||
from tempest import test
|
||||
|
||||
CONF = config.CONF
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BaseTricircleTest(test.BaseTestCase):
|
||||
|
||||
@classmethod
|
||||
def skip_checks(cls):
|
||||
pass
|
32
tricircle/tempestplugin/tests/api/test_sample.py
Normal file
32
tricircle/tempestplugin/tests/api/test_sample.py
Normal file
@ -0,0 +1,32 @@
|
||||
# Copyright (c) 2016 Huawei Technologies Co., Ltd.
|
||||
# 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.
|
||||
|
||||
from tempest import test
|
||||
from tricircle.tempestplugin.tests.api import base
|
||||
|
||||
|
||||
class TestTricircleSample(base.BaseTricircleTest):
|
||||
|
||||
@classmethod
|
||||
def resource_setup(cls):
|
||||
super(TestTricircleSample, cls).resource_setup()
|
||||
|
||||
@test.attr(type="smoke")
|
||||
def test_sample(self):
|
||||
self.assertEqual('Tricircle Sample Test!', 'Tricircle Sample Test!')
|
||||
|
||||
@classmethod
|
||||
def resource_cleanup(cls):
|
||||
super(TestTricircleSample, cls).resource_cleanup()
|
0
tricircle/tempestplugin/tests/scenario/__init__.py
Normal file
0
tricircle/tempestplugin/tests/scenario/__init__.py
Normal file
Loading…
x
Reference in New Issue
Block a user