Tempest plugin initial commit
This patch contains tempest plugin interface which are generated by tempest-plugin-cookiecutter[1]. Also empty test manager and basic test was added. [1] https://github.com/openstack/tempest-plugin-cookiecutter Change-Id: I333462987bb6cdd1933fbb3550f527364c74ba07
This commit is contained in:
parent
2a12cff641
commit
50783c14f1
18
ironic_inspector/test/inspector_tempest_plugin/README.rst
Normal file
18
ironic_inspector/test/inspector_tempest_plugin/README.rst
Normal file
@ -0,0 +1,18 @@
|
||||
=======================================
|
||||
Tempest Integration of ironic-inspector
|
||||
=======================================
|
||||
|
||||
This directory contains Tempest tests to cover the ironic-inspector project.
|
||||
|
||||
It uses tempest plugin to automatically load these tests into tempest. More
|
||||
information about tempest plugin could be found here:
|
||||
`Plugin <http://docs.openstack.org/developer/tempest/plugin.html>`_
|
||||
|
||||
The legacy method of running Tempest is to just treat the Tempest source code
|
||||
as a python unittest:
|
||||
`Run tests <http://docs.openstack.org/developer/tempest/overview.html#legacy-run-method>`_
|
||||
|
||||
There is also tox configuration for tempest, use following regex for running
|
||||
introspection tests::
|
||||
|
||||
$ tox -e all-plugin -- inspector_tempest_plugin
|
13
ironic_inspector/test/inspector_tempest_plugin/config.py
Normal file
13
ironic_inspector/test/inspector_tempest_plugin/config.py
Normal file
@ -0,0 +1,13 @@
|
||||
# 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 config # noqa
|
34
ironic_inspector/test/inspector_tempest_plugin/plugin.py
Normal file
34
ironic_inspector/test/inspector_tempest_plugin/plugin.py
Normal file
@ -0,0 +1,34 @@
|
||||
# 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 ironic_inspector.test.inspector_tempest_plugin import config # noqa
|
||||
|
||||
|
||||
class InspectorTempestPlugin(plugins.TempestPlugin):
|
||||
def load_tests(self):
|
||||
base_path = os.path.split(os.path.dirname(
|
||||
os.path.abspath(__file__)))[0]
|
||||
test_dir = "inspector_tempest_plugin/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,0 +1,26 @@
|
||||
# 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.scenario import manager
|
||||
|
||||
|
||||
class InspectorScenarioTest(manager.BaremetalScenarioTest):
|
||||
"""Provide harness to do Inspector scenario tests."""
|
||||
|
||||
credentials = ['primary', 'admin']
|
||||
|
||||
@classmethod
|
||||
def setup_clients(cls):
|
||||
super(InspectorScenarioTest, cls).setup_clients()
|
||||
|
||||
def setUp(self):
|
||||
super(InspectorScenarioTest, self).setUp()
|
@ -0,0 +1,27 @@
|
||||
# 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 # noqa
|
||||
|
||||
from ironic_inspector.test.inspector_tempest_plugin.tests.scenario \
|
||||
import manager
|
||||
|
||||
|
||||
class InspectorBasicTest(manager.InspectorScenarioTest):
|
||||
@test.idempotent_id('03bf7990-bee0-4dd7-bf74-b97ad7b52a4b')
|
||||
@test.services('baremetal', 'compute', 'image',
|
||||
'network', 'object_storage')
|
||||
def test_berametal_introspection_ops(self):
|
||||
"""This smoke test case follows this basic set of operations:
|
||||
|
||||
"""
|
||||
pass
|
@ -61,6 +61,9 @@ oslo.config.opts =
|
||||
oslo.config.opts.defaults =
|
||||
ironic_inspector = ironic_inspector.conf:set_config_defaults
|
||||
|
||||
tempest.test_plugins =
|
||||
ironic_inspector_tests = ironic_inspector.test.inspector_tempest_plugin.plugin:InspectorTempestPlugin
|
||||
|
||||
[compile_catalog]
|
||||
directory = ironic_inspector/locale
|
||||
domain = ironic_inspector
|
||||
|
Loading…
Reference in New Issue
Block a user