Add a skeleton tempest plugin

Partial-Bug: #1501792
Change-Id: I987f86c626c7c1b335b3376fc2bc83a3d1feddf3
This commit is contained in:
YAMAMOTO Takashi 2015-11-12 07:40:17 +09:00
parent 1bf75298ea
commit f195a82dc4
10 changed files with 149 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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