John Kung bd998017d5 SysInv Decoupling: Create Inventory Service
Create host inventory services (api, conductor and agent) and
python-inventoryclient.

The inventory service collects the host resources and provides a
REST API and client to expose the host resources.

Create plugin for integration with system configuration (sysinv)
service.

This is the initial inventory service infratructure commit.
Puppet configuration, SM integration and host integration with
sysinv(systemconfig) changes are pending and planned to be
delivered in future commits.

Tests Performed:
 Verify the changes are inert on config_controller installation
 and provisioning.
     Puppet and spec changes are required in order to create keystone,
     database and activate inventory services.

 Unit tests performed (when puppet configuration for keystone, database
 is applied):
     Trigger host configure_check, configure signals into
         systemconfig(sysinv).

     Verify python-inventoryclient and api service:
         Disks and related storage resources are pending.
         inventory host-cpu-list/show
         inventory host-device-list/show/modify
         inventory host-ethernetport-list/show
         inventory host-lldp-neighbor-list
         inventory host-lldp-agent-list/show
         inventory host-memory-list/show
         inventory host-node-list/show
         inventory host-port-list/show

     Tox Unit tests:
         inventory: pep8
         python-inventoryclient: py27, pep8, cover, pylint

Change-Id: I744ac0de098608c55b9356abf180cc36601cfb8d
Story: 2002950
Task: 22952
Signed-off-by: John Kung <john.kung@windriver.com>
2018-12-06 13:17:35 -05:00

102 lines
3.2 KiB
INI

[tox]
minversion = 2.0
# envlist = pep8
envlist = py27,pep8
# tox does not work if the path to the workdir is too long, so move it to /tmp
toxworkdir = /tmp/{env:USER}_inventorytox
cgcsdir = {toxinidir}/../../..
wrsdir = {toxinidir}/../../../../../../../..
distshare={toxworkdir}/.tox/distshare
[testenv]
# sitepackages = True
install_command = pip install -v -v -v -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike} {opts} {packages}
whitelist_externals = bash
find
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
INVENTORY_TEST_ENV=True
TOX_WORK_DIR={toxworkdir}
PYLINTHOME={toxworkdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-e{[tox]cgcsdir}/stx-update/tsconfig/tsconfig
-e{[tox]cgcsdir}/stx-config/configutilities/configutilities
-e{[tox]cgcsdir}/stx-config/sysinv/cgts-client/cgts-client
-e{[tox]cgcsdir}/stx-fault/fm-api
-e{[tox]cgcsdir}/stx-fault/python-fmclient/fmclient
-e{[tox]cgcsdir}/stx-config/controllerconfig/controllerconfig
-e{[tox]cgcsdir}/stx-update/cgcs-patch/cgcs-patch
-e{[tox]cgcsdir}/stx-integ/utilities/platform-util/platform-util
commands =
find . -type f -name "*.pyc" -delete
find . -type f -name ".coverage\.*" -delete
coverage erase
[testenv:py27]
basepython = python2.7
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:pep8]
commands = flake8 {posargs}
[testenv:venv]
commands = {posargs}
[testenv:cover]
deps = {[testenv]deps}
-e{[tox]cgcsdir}/stx-update/tsconfig/tsconfig
-e{[tox]cgcsdir}/stx-config/configutilities/configutilities
-e{[tox]cgcsdir}/stx-fault/fm-api
-e{[tox]cgcsdir}/stx-fault/python-fmclient/fmclient
-e{[tox]cgcsdir}/stx-config/controllerconfig/controllerconfig
-e{[tox]cgcsdir}/stx-config/sysinv/cgts-client/cgts-client
-e{[tox]cgcsdir}/stx-update/cgcs-patch/cgcs-patch
-e{[tox]cgcsdir}/stx-integ/utilities/platform-util/platform-util
setenv =
VIRTUAL_ENV={envdir}
PYTHON=coverage run --source inventory --parallel-mode
commands =
find . -type f -name "*.pyc" -delete
find . -type f -name ".coverage\.*" -delete
stestr run {posargs}
coverage erase
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug]
commands = oslo_debug_helper {posargs}
[hacking]
import_exceptions = inventory.common.i18n
[flake8]
# H102 Apache License format
# H233 Python 3.x incompatible use of print operator
# H404 multi line docstring should start without a leading new line
# H405 multi line docstring summary not separated with an empty line
ignore = H102,H233,H404,H405
show-source = True
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build