From eb293bd418918fb43837b5d533dd062ba188ba1f Mon Sep 17 00:00:00 2001 From: Chandan Kumar Date: Tue, 16 May 2017 20:01:53 +0530 Subject: [PATCH] Fixes vmware_nsx_tempest tempest plugin issues with tempest * Added vmware_nsx_tempest under packages in setup.cfg so that tempest can discovers it. * Removed pbr version from vmware_nsx_tempest (in-tree tempest plugin) as it causes versioning issue with the main package vmware_nsx. * Added all sections and options defined in tempest plugin conf so that tempest can retrive all the tempest sample configurations. Depends-on: Iab0202a28bfa525c4cd91e776ac2bdba56a807f6 Change-Id: I2f706b8cdb31c53d951b059f939fb0d6afc32958 Closes-Bug: #1691122 --- setup.cfg | 1 + vmware_nsx_tempest/__init__.py | 19 ------------------- vmware_nsx_tempest/config.py | 1 + vmware_nsx_tempest/plugin.py | 34 ++++++++++++++-------------------- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/setup.cfg b/setup.cfg index 824c98605e..52a87fc39c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,6 +21,7 @@ classifier = [files] packages = vmware_nsx + vmware_nsx_tempest [entry_points] console_scripts = diff --git a/vmware_nsx_tempest/__init__.py b/vmware_nsx_tempest/__init__.py index 94ca290da9..e69de29bb2 100644 --- a/vmware_nsx_tempest/__init__.py +++ b/vmware_nsx_tempest/__init__.py @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- - -# 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 pbr.version - - -__version__ = pbr.version.VersionInfo( - 'vmware_nsx_tempest').version_string() diff --git a/vmware_nsx_tempest/config.py b/vmware_nsx_tempest/config.py index 47dfbab236..ec47e705d2 100644 --- a/vmware_nsx_tempest/config.py +++ b/vmware_nsx_tempest/config.py @@ -67,6 +67,7 @@ NetworkGroup = [ default='mail', help="host exists in dns_search_domain"), cfg.StrOpt('public_network_cidr', + default='', help="Public network cidr which provides external network" " connectivity"), cfg.StrOpt('backend', diff --git a/vmware_nsx_tempest/plugin.py b/vmware_nsx_tempest/plugin.py index ae18cbee15..db36053117 100644 --- a/vmware_nsx_tempest/plugin.py +++ b/vmware_nsx_tempest/plugin.py @@ -22,6 +22,15 @@ from tempest.test_discover import plugins from vmware_nsx_tempest import config as config_nsx +_opts = [ + (config_nsx.scenario_group, config_nsx.ScenarioGroup), + (config_nsx.network_group, config_nsx.NetworkGroup), + (config_nsx.nsxv_group, config_nsx.NSXvGroup), + (config_nsx.l2gw_group, config_nsx.L2gwGroup), + (config_nsx.nsxv3_group, config_nsx.NSXv3Group) +] + + class VMwareNsxTempestPlugin(plugins.TempestPlugin): """Our addon configuration is defined at vmware_nsx_tempest/config.py @@ -38,29 +47,14 @@ class VMwareNsxTempestPlugin(plugins.TempestPlugin): base_path = os.path.split(mydir)[0] test_dir = "vmware_nsx_tempest/tests" test_fullpath = os.path.join(base_path, test_dir) - return (test_fullpath, base_path) + return test_fullpath, base_path def register_opts(self, conf): conf.register_opt(config_nsx.service_option, group='service_available') - config.register_opt_group( - conf, - config_nsx.scenario_group, config_nsx.ScenarioGroup) - config.register_opt_group( - conf, - config_nsx.network_group, config_nsx.NetworkGroup) - config.register_opt_group( - conf, - config_nsx.nsxv_group, config_nsx.NSXvGroup) - config.register_opt_group( - conf, - config_nsx.l2gw_group, config_nsx.L2gwGroup) - config.register_opt_group( - conf, - config_nsx.nsxv3_group, config_nsx.NSXv3Group) + for group, option in _opts: + config.register_opt_group(conf, group, option) def get_opt_lists(self): - return [ - (config_nsx.scenario_group.name, config_nsx.scenario_group), - ('service_available', [config_nsx.service_option]) - ] + return [(group.name, option) for group, option in _opts + ].append(('service_available', [config_nsx.service_option]))