diff --git a/neutron_taas/tests/tempest_plugin/__init__.py b/neutron_taas/tests/tempest_plugin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/neutron_taas/tests/tempest_plugin/plugin.py b/neutron_taas/tests/tempest_plugin/plugin.py new file mode 100644 index 0000000..da7e225 --- /dev/null +++ b/neutron_taas/tests/tempest_plugin/plugin.py @@ -0,0 +1,36 @@ +# Copyright (c) 2015 Midokura SARL +# 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.test_discover import plugins + + +class NeutronTaaSPlugin(plugins.TempestPlugin): + def get_opt_lists(self): + return [] + + def load_tests(self): + this_dir = os.path.dirname(os.path.abspath(__file__)) + # top_level_dir = $(this_dir)/../../.. + d = os.path.split(this_dir)[0] + d = os.path.split(d)[0] + top_level_dir = os.path.split(d)[0] + test_dir = os.path.join(top_level_dir, + 'neutron_taas/tests/tempest_plugin/tests') + return (test_dir, top_level_dir) + + def register_opts(self): + return diff --git a/neutron_taas/tests/tempest_plugin/tests/__init__.py b/neutron_taas/tests/tempest_plugin/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/neutron_taas/tests/tempest_plugin/tests/api/__init__.py b/neutron_taas/tests/tempest_plugin/tests/api/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/neutron_taas/tests/tempest_plugin/tests/api/base.py b/neutron_taas/tests/tempest_plugin/tests/api/base.py new file mode 100644 index 0000000..107d527 --- /dev/null +++ b/neutron_taas/tests/tempest_plugin/tests/api/base.py @@ -0,0 +1,20 @@ +# Copyright (c) 2015 Midokura SARL +# 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.api.network import base + + +class BaseTaaSTest(base.BaseNetworkTest): + pass diff --git a/neutron_taas/tests/tempest_plugin/tests/api/test_taas.py b/neutron_taas/tests/tempest_plugin/tests/api/test_taas.py new file mode 100644 index 0000000..967c9f1 --- /dev/null +++ b/neutron_taas/tests/tempest_plugin/tests/api/test_taas.py @@ -0,0 +1,35 @@ +# Copyright (c) 2015 Midokura SARL +# 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 config +from tempest import test + +from neutron_taas.tests.tempest_plugin.tests.api import base + +CONF = config.CONF + + +class TaaSExtensionTestJSON(base.BaseTaaSTest): + + @classmethod + def resource_setup(cls): + super(TaaSExtensionTestJSON, cls).resource_setup() + if not test.is_extension_enabled('taas', 'network'): + msg = "TaaS Extension not enabled." + raise cls.skipException(msg) + + @test.idempotent_id('b993c14e-797a-4c91-b4da-8cb1a450aa2f') + def test_dummy(self): + pass diff --git a/neutron_taas/tests/tempest_plugin/tests/scenario/__init__.py b/neutron_taas/tests/tempest_plugin/tests/scenario/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/neutron_taas/tests/tempest_plugin/tests/scenario/base.py b/neutron_taas/tests/tempest_plugin/tests/scenario/base.py new file mode 100644 index 0000000..1b9af73 --- /dev/null +++ b/neutron_taas/tests/tempest_plugin/tests/scenario/base.py @@ -0,0 +1,20 @@ +# Copyright (c) 2015 Midokura SARL +# 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.scenario import manager + + +class TaaSScenarioTest(manager.NetworkScenarioTest): + pass diff --git a/neutron_taas/tests/tempest_plugin/tests/scenario/test_taas.py b/neutron_taas/tests/tempest_plugin/tests/scenario/test_taas.py new file mode 100644 index 0000000..a531a9f --- /dev/null +++ b/neutron_taas/tests/tempest_plugin/tests/scenario/test_taas.py @@ -0,0 +1,36 @@ +# Copyright (c) 2015 Midokura SARL +# 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 config +from tempest import test + +from neutron_taas.tests.tempest_plugin.tests.scenario import base + +CONF = config.CONF + + +class TestTaaS(base.TaaSScenarioTest): + + @classmethod + def resource_setup(cls): + super(TestTaaS, cls).resource_setup() + for ext in ['taas']: + if not test.is_extension_enabled(ext, 'network'): + msg = "%s Extension not enabled." % ext + raise cls.skipException(msg) + + @test.idempotent_id('40903cbd-0e3c-464d-b311-dc77d3894e65') + def test_dummy(self): + pass diff --git a/setup.cfg b/setup.cfg index d7a4726..eb32d91 100644 --- a/setup.cfg +++ b/setup.cfg @@ -52,3 +52,5 @@ neutron.service_plugins = taas = neutron_taas.services.taas.taas_plugin:TaasPlugin neutron.db.alembic_migrations = tap-as-a-service = neutron_taas.db.migration:alembic_migration +tempest.test_plugins = + tap-as-a-service = neutron_taas.tests.tempest_plugin.plugin:NeutronTaaSPlugin