vmware-nsx/vmware_nsx_tempest/plugin.py
Chandan Kumar eb293bd418 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
2017-05-17 10:24:53 +00:00

61 lines
2.0 KiB
Python

# Copyright 2015 VMware, Inc.
#
# 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 import config
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
1. register_opts() to register group/opts to Tempest
2. get_opt_lists() to pass config to Tempest
The official plugin is defined at
https://docs.openstack.org/developer/tempest/plugin.html
"""
def load_tests(self):
mydir = os.path.dirname(os.path.abspath(__file__))
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
def register_opts(self, conf):
conf.register_opt(config_nsx.service_option,
group='service_available')
for group, option in _opts:
config.register_opt_group(conf, group, option)
def get_opt_lists(self):
return [(group.name, option) for group, option in _opts
].append(('service_available', [config_nsx.service_option]))