diff --git a/src/tests/basic_deployment.py b/src/tests/basic_deployment.py index f694ed0..e181a0f 100644 --- a/src/tests/basic_deployment.py +++ b/src/tests/basic_deployment.py @@ -98,11 +98,14 @@ class AodhBasicDeployment(OpenStackAmuletDeployment): tenant='admin') # Authenticate admin with aodh endpoint - aodh_ep = self.keystone.service_catalog.url_for(service_type='alarming', - endpoint_type='publicURL') - keystone_ep = self.keystone.service_catalog.url_for(service_type='identity', - endpoint_type='publicURL') - os_token = self.keystone.auth_token + aodh_ep = self.keystone.service_catalog.url_for( + service_type='alarming', + endpoint_type='publicURL') + + keystone_ep = self.keystone.service_catalog.url_for( + service_type='identity', + endpoint_type='publicURL') + auth = keystone_identity.V2Token(auth_url=keystone_ep, token=self.keystone.auth_token) sess = keystone_session.Session(auth=auth) diff --git a/src/tox.ini b/src/tox.ini index 127dd33..479d7bb 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -1,12 +1,16 @@ +# Source charm: ./src/tox.ini +# This file is managed centrally by release-tools and should not be modified +# within individual charm repos. [tox] envlist = pep8 skipsdist = True [testenv] -envdir = .tox/py27 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 AMULET_SETUP_TIMEOUT=2700 +whitelist_externals = juju +passenv = HOME TERM AMULET_* deps = -r{toxinidir}/test-requirements.txt install_command = pip install --allow-unverified python-apt {opts} {packages} @@ -22,28 +26,24 @@ commands = bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy [testenv:func27] -# Charm Functional Test # Run all gate tests which are +x (expected to always pass) basepython = python2.7 commands = bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" --no-destroy [testenv:func27-smoke] -# Charm Functional Test # Run a specific test as an Amulet smoke test (expected to always pass) basepython = python2.7 commands = bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-mitaka --no-destroy [testenv:func27-dfs] -# Charm Functional Test # Run all deploy-from-source tests which are +x (may not always pass!) basepython = python2.7 commands = bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dfs-*" --no-destroy [testenv:func27-dev] -# Charm Functional Test # Run all development test targets which are +x (may not always pass!) basepython = python2.7 commands = diff --git a/tox.ini b/tox.ini index 615ecfc..893f30f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,36 +1,28 @@ +# Source charm: ./tox.ini +# This file is managed centrally by release-tools and should not be modified +# within individual charm repos. [tox] skipsdist = True envlist = pep8,py34,py35 skip_missing_interpreters = True [testenv] -basepython = python2.7 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 TERM=linux - INTERFACE_PATH={toxinidir}/interfaces LAYER_PATH={toxinidir}/layers + INTERFACE_PATH={toxinidir}/interfaces JUJU_REPOSITORY={toxinidir}/build passenv = http_proxy https_proxy install_command = pip install {opts} {packages} deps = - -r{toxinidir}/requirements.txt + -r{toxinidir}/requirements.txt [testenv:build] -commands = - charm-build --log-level DEBUG -o {toxinidir}/build src - -[testenv:venv] -commands = {posargs} - -[testenv:pep8] -commands = flake8 {posargs} src/reactive src/lib unit_tests - -[testenv:py27] basepython = python2.7 -deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} +commands = + charm-build --log-level DEBUG -o {toxinidir}/build src {posargs} [testenv:py34] basepython = python3.4 @@ -41,3 +33,15 @@ commands = ostestr {posargs} basepython = python3.5 deps = -r{toxinidir}/test-requirements.txt commands = ostestr {posargs} + +[testenv:pep8] +basepython = python2.7 +deps = -r{toxinidir}/test-requirements.txt +commands = flake8 {posargs} src unit_tests + +[testenv:venv] +commands = {posargs} + +[flake8] +# E402 ignore necessary for path append before sys module import in actions +ignore = E402