diff --git a/networking_l2gw/tests/tempest/config.py b/networking_l2gw/tests/tempest/config.py index 4a57745..f87b49f 100644 --- a/networking_l2gw/tests/tempest/config.py +++ b/networking_l2gw/tests/tempest/config.py @@ -44,3 +44,7 @@ L2GW_OPTS = [ def register_options(): cfg.CONF.register_opts(L2GW_OPTS, "L2GW") + + +l2gw_group = cfg.OptGroup(name='l2gw', + title='Neutron L2GW Options') diff --git a/networking_l2gw/tests/tempest/plugin.py b/networking_l2gw/tests/tempest/plugin.py new file mode 100644 index 0000000..7e0f321 --- /dev/null +++ b/networking_l2gw/tests/tempest/plugin.py @@ -0,0 +1,39 @@ +# Copyright 2017 +# 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 networking_l2gw +import os +from tempest.test_discover import plugins + +from networking_l2gw.tests.tempest import config as l2gw_config + + +class NeutronL2gwTempestPlugin(plugins.TempestPlugin): + def load_tests(self): + base_path = os.path.split(os.path.dirname( + os.path.abspath(networking_l2gw.__file__)))[0] + test_dir = "networking_l2gw/tests/api" + full_test_dir = os.path.join(base_path, test_dir) + return full_test_dir, base_path + + def register_opts(self, conf): + conf.register_group(l2gw_config.l2gw_group) + conf.register_opts(l2gw_config.L2GW_OPTS, + group=l2gw_config.l2gw_group) + + def get_opt_lists(self): + return [ + (l2gw_config.l2gw_group.name, l2gw_config.L2GW_OPTS), + ] diff --git a/setup.cfg b/setup.cfg index f10e075..fa0e3a3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -36,6 +36,9 @@ neutronclient.extension = l2_gateway_connection = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway_connection l2_gateway = networking_l2gw.l2gatewayclient.l2gw_client_ext._l2_gateway +tempest.test_plugins = + networking_l2gw = networking_l2gw.tests.tempest.plugin:NeutronL2gwTempestPlugin + [build_sphinx] source-dir = doc/source build-dir = doc/build diff --git a/test-requirements.txt b/test-requirements.txt index affb317..4a6db81 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -17,3 +17,4 @@ testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT tempest>=14.0.0 # Apache-2.0 mock>=2.0 # BSD +ddt>=1.0.1 # MIT