Refactored python-tempestconf to work with devstack

Change-Id: I5143d9ef63d7bf326b477110c0ff6f82b3c2a9b2
This commit is contained in:
Chandan Kumar 2017-01-18 15:18:53 +05:30
parent 2811119bd4
commit 305bf0bb19
16 changed files with 62 additions and 93 deletions

View File

@ -1,4 +1,4 @@
tempest_config_tool Style Commandments python-tempestconf Style Commandments
=============================================== ===============================================
Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/ Read the OpenStack Style Commandments http://docs.openstack.org/developer/hacking/

View File

@ -1,17 +1,15 @@
=============================== ===============================
tempest_config_tool python-tempestconf
=============================== ===============================
OpenStack Boilerplate contains all the boilerplate you need to create an OpenStack package. python-tempestconf will automatically generates the tempest configuration based on your cloud.
Please fill here a long description which must be at least 3 lines wrapped on
80 cols, so that distribution package maintainers can use it in their packages.
Note that this is a hard requirement.
* Free software: Apache license * Free software: Apache license
* Documentation: http://docs.openstack.org/developer/tempest_config_tool * Documentation: http://docs.openstack.org/developer/python-tempestconf
* Source: http://git.openstack.org/cgit/openstack/tempest_config_tool * Source: http://git.openstack.org/cgit/openstack/python-tempestconf
* Bugs: http://bugs.launchpad.net/replace with the name of the project on launchpad * Bugs: http://bugs.launchpad.net/python-tempestconf
Features Features
-------- --------

View File

@ -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(
'config_tempest').version_string()

23
config_tempest/config_tempest.py Normal file → Executable file
View File

@ -34,34 +34,29 @@ or manually if necessary.
obtained by querying the cloud. obtained by querying the cloud.
""" """
import api_discovery
import argparse import argparse
import ConfigParser import ConfigParser
import logging import logging
import os import os
import shutil import shutil
import sys import tempest.config
import urllib2 import urllib2
# Since tempest can be configured in different directories, we need to use
# the path starting at cwd.
sys.path.insert(0, os.getcwd())
import config_tempest.api_discovery as api_discovery
from tempest.common import identity from tempest.common import identity
import tempest.config
from tempest.lib import auth from tempest.lib import auth
from tempest.lib import exceptions from tempest.lib import exceptions
from tempest.lib.services.compute import flavors_client from tempest.lib.services.compute import flavors_client
from tempest.lib.services.compute import networks_client as nova_net_client from tempest.lib.services.compute import networks_client as nova_net_client
from tempest.lib.services.compute import servers_client from tempest.lib.services.compute import servers_client
from tempest.lib.services.identity.v2 import identity_client
from tempest.lib.services.identity.v2 import roles_client
from tempest.lib.services.identity.v2 import tenants_client
from tempest.lib.services.identity.v2 import users_client
from tempest.lib.services.identity.v3 \
import identity_client as identity_v3_client
from tempest.lib.services.image.v2 import images_client from tempest.lib.services.image.v2 import images_client
from tempest.lib.services.network import networks_client from tempest.lib.services.network import networks_client
from tempest.services.identity.v2.json import identity_client
from tempest.services.identity.v2.json import roles_client
from tempest.services.identity.v2.json import tenants_client
from tempest.services.identity.v2.json import users_client
from tempest.services.identity.v3.json \
import identity_client as identity_v3_client
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
@ -776,7 +771,7 @@ def configure_discovered_services(conf, services):
# set supported API versions for services with more of them # set supported API versions for services with more of them
for service, versions in SERVICE_VERSIONS.iteritems(): for service, versions in SERVICE_VERSIONS.iteritems():
supported_versions = services[service]['versions'] supported_versions = services.get(service, {}).get('versions', [])
section = service + '-feature-enabled' section = service + '-feature-enabled'
for version in versions: for version in versions:
is_supported = any(version in item is_supported = any(version in item

View File

@ -13,16 +13,16 @@
# under the License. # under the License.
""" """
test_config_tempest test_tempest_config
---------------------------------- ----------------------------------
Tests for `config_tempest` module. Tests for `tempest_config` module.
""" """
from config_tempest.tests import base from tempest_config.tests import base
class TestConfig_tempest(base.TestCase): class TestTempest_config(base.TestCase):
def test_something(self): def test_something(self):
pass pass

View File

@ -37,8 +37,8 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'tempest_config_tool' project = u'python-tempestconf'
copyright = u'2016, OpenStack Foundation' copyright = u'2016, Red Hat'
# If true, '()' will be appended to :func: etc. cross-reference text. # If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True add_function_parentheses = True

View File

@ -1,9 +1,9 @@
.. tempest_config_tool documentation master file, created by .. python-tempestconf documentation master file, created by
sphinx-quickstart on Tue Jul 9 22:26:36 2013. sphinx-quickstart on Tue Jul 9 22:26:36 2013.
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to tempest_config_tool's documentation! Welcome to python-tempestconf's documentation!
======================================================== ========================================================
Contents: Contents:

View File

@ -4,9 +4,9 @@ Installation
At the command line:: At the command line::
$ pip install tempest_config_tool $ pip install python-tempestconf
Or, if you have virtualenvwrapper installed:: Or, if you have virtualenvwrapper installed::
$ mkvirtualenv tempest_config_tool $ mkvirtualenv python-tempestconf
$ pip install tempest_config_tool $ pip install python-tempestconf

View File

@ -2,6 +2,6 @@
Usage Usage
======== ========
To use tempest_config_tool in a project:: To use python-tempestconf in a project::
import config_tempest import tempest_config

View File

@ -55,7 +55,7 @@ source_suffix = '.rst'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'config_tempest Release Notes' project = u'tempest_config Release Notes'
copyright = u'2016, OpenStack Foundation' copyright = u'2016, OpenStack Foundation'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
@ -270,3 +270,6 @@ texinfo_documents = [
# If true, do not generate a @detailmenu in the "Top" node's menu. # If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False # texinfo_no_detailmenu = False
# -- Options for Internationalization output ------------------------------
locale_dirs = ['locale/']

View File

@ -1,5 +1,5 @@
============================================ ============================================
config_tempest Release Notes tempest_config Release Notes
============================================ ============================================
.. toctree:: .. toctree::

View File

@ -2,6 +2,6 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
pbr>=1.6 # Apache-2.0 pbr>=1.8 # Apache-2.0
requests tempest>=14.0.0 # Apache-2.0
tempest requests>=2.10.0,!=2.12.2 # Apache-2.0

View File

@ -1,11 +1,11 @@
[metadata] [metadata]
name = tempest_config_tool name = python-tempestconf
summary = OpenStack Boilerplate contains all the boilerplate you need to create an OpenStack package. summary = python-tempestconf will automatically generates the tempest configuration based on your cloud.
description-file = description-file =
README.rst README.rst
author = OpenStack author = Red Hat
author-email = openstack-dev@lists.openstack.org author-email = rdo-list@redhat.com
home-page = http://www.openstack.org/ home-page = http://www.redhat.com/
classifier = classifier =
Environment :: OpenStack Environment :: OpenStack
Intended Audience :: Information Technology Intended Audience :: Information Technology
@ -23,6 +23,13 @@ classifier =
packages = packages =
config_tempest config_tempest
data_files =
etc/tempest = etc/*
[entry_points]
console_scripts =
discover-tempest-config = config_tempest.config_tempest:main
[build_sphinx] [build_sphinx]
source-dir = doc/source source-dir = doc/source
build-dir = doc/build build-dir = doc/build
@ -31,21 +38,7 @@ all_files = 1
[upload_sphinx] [upload_sphinx]
upload-dir = doc/build/html upload-dir = doc/build/html
[compile_catalog]
directory = config_tempest/locale
domain = config_tempest
[update_catalog]
domain = config_tempest
output_dir = config_tempest/locale
input_file = config_tempest/locale/config_tempest.pot
[extract_messages]
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = config_tempest/locale/config_tempest.pot
[build_releasenotes] [build_releasenotes]
all_files = 1 all_files = 1
build-dir = releasenotes/build build-dir = releasenotes/build
source-dir = releasenotes/source source-dir = releasenotes/source

View File

@ -25,5 +25,5 @@ except ImportError:
pass pass
setuptools.setup( setuptools.setup(
setup_requires=['pbr'], setup_requires=['pbr>=1.8'],
pbr=True) pbr=True)

View File

@ -2,16 +2,16 @@
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking<0.12,>=0.11.0 # Apache-2.0 hacking>=0.12.0,<0.13 # Apache-2.0
coverage>=3.6 # Apache-2.0 coverage>=4.0 # Apache-2.0
python-subunit>=0.0.18 # Apache-2.0/BSD python-subunit>=0.0.18 # Apache-2.0/BSD
sphinx!=1.3b1,<1.3,>=1.2.1 # BSD sphinx>=1.2.1,!=1.3b1,<1.4 # BSD
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0 oslosphinx>=4.7.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0 oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD
testtools>=1.4.0 # MIT testtools>=1.4.0 # MIT
# releasenotes # releasenotes
reno>=1.8.0 # Apache2 reno>=1.8.0 # Apache-2.0

View File

@ -5,12 +5,11 @@ skipsdist = True
[testenv] [testenv]
usedevelop = True usedevelop = True
install_command = pip install -U {opts} {packages} install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
deps = PYTHONWARNINGS=default::DeprecationWarning
-r{toxinidir}/requirements.txt deps = -r{toxinidir}/test-requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}' commands = python setup.py test --slowest --testr-args='{posargs}'
[testenv:pep8] [testenv:pep8]
@ -23,7 +22,7 @@ commands = {posargs}
commands = python setup.py test --coverage --testr-args='{posargs}' commands = python setup.py test --coverage --testr-args='{posargs}'
[testenv:docs] [testenv:docs]
commands = python setup.py build_sphinx {posargs} commands = python setup.py build_sphinx
[testenv:releasenotes] [testenv:releasenotes]
commands = commands =