Browse Source

Fixed networking-l2gw tempest plugin

* Added tempest plugin entry point to discover l2gw tempest tests

Change-Id: Ia0eaf6958460e09a9fa5992356c85452166987e8
(cherry picked from commit 9ec7ae4ddf)
stable/ocata
Chandan Kumar 4 years ago
parent
commit
f0f3dc6075
  1. 4
      networking_l2gw/tests/tempest/config.py
  2. 41
      networking_l2gw/tests/tempest/plugin.py
  3. 3
      setup.cfg
  4. 1
      test-requirements.txt

4
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')

41
networking_l2gw/tests/tempest/plugin.py

@ -0,0 +1,41 @@
# 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),
]

3
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

1
test-requirements.txt

@ -17,3 +17,4 @@ testscenarios>=0.4 # Apache-2.0/BSD
testtools>=1.4.0 # MIT
tempest>=12.1.0 # Apache-2.0
mock>=2.0 # BSD
ddt>=1.0.1 # MIT
Loading…
Cancel
Save