summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mellado <dmellado@redhat.com>2017-06-06 13:53:11 +0000
committerDaniel Mellado <dmellado@redhat.com>2017-06-12 07:54:31 +0000
commit3273c50589d5da03c493895ad18d6fada2cd151c (patch)
tree36ca09e970214ad6b420d48c7c2bbf960c15f9b2
parent947e5ba4ca1d414533bf7dc847f01251d704f97f (diff)
Add proper class skip
This commit fixes the resource_setup skip decorator and switches from pretty_tox to tempest run. Change-Id: I0f8b0ac50653efaabb69bff1dff8b2a7350989d4
Notes
Notes (review): Code-Review+2: garyk <gkotton@vmware.com> Workflow+1: garyk <gkotton@vmware.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 13 Jun 2017 10:08:09 +0000 Reviewed-on: https://review.openstack.org/471364 Project: openstack/networking-l2gw Branch: refs/heads/master
-rw-r--r--networking_l2gw/tests/api/test_l2gw_extensions.py2
-rw-r--r--networking_l2gw/tests/api/test_l2gw_negative.py6
-rw-r--r--tox.ini19
3 files changed, 19 insertions, 8 deletions
diff --git a/networking_l2gw/tests/api/test_l2gw_extensions.py b/networking_l2gw/tests/api/test_l2gw_extensions.py
index 253cacd..a146194 100644
--- a/networking_l2gw/tests/api/test_l2gw_extensions.py
+++ b/networking_l2gw/tests/api/test_l2gw_extensions.py
@@ -52,7 +52,7 @@ class L2GatewayExtensionTestJSON(base.BaseAdminNetworkTest):
52 config.register_options() 52 config.register_options()
53 super(L2GatewayExtensionTestJSON, cls).resource_setup() 53 super(L2GatewayExtensionTestJSON, cls).resource_setup()
54 # At least one switch detail should be provided to run the tests 54 # At least one switch detail should be provided to run the tests
55 if (len(CONF.L2GW.l2gw_switch) < 0): 55 if (len(CONF.L2GW.l2gw_switch) <= 0):
56 msg = ('At least one switch detail must be defined.') 56 msg = ('At least one switch detail must be defined.')
57 raise cls.skipException(msg) 57 raise cls.skipException(msg)
58 if not test.is_extension_enabled('l2-gateway', 'network'): 58 if not test.is_extension_enabled('l2-gateway', 'network'):
diff --git a/networking_l2gw/tests/api/test_l2gw_negative.py b/networking_l2gw/tests/api/test_l2gw_negative.py
index 9d3b79c..d5513cf 100644
--- a/networking_l2gw/tests/api/test_l2gw_negative.py
+++ b/networking_l2gw/tests/api/test_l2gw_negative.py
@@ -39,7 +39,7 @@ class L2GatewaysNegativeTestJSON(base.BaseNetworkTest):
39 def resource_setup(cls): 39 def resource_setup(cls):
40 super(L2GatewaysNegativeTestJSON, cls).resource_setup() 40 super(L2GatewaysNegativeTestJSON, cls).resource_setup()
41 # At least one switch detail should be provided to run the tests 41 # At least one switch detail should be provided to run the tests
42 if (len(CONF.L2GW.l2gw_switch) < 0): 42 if (len(CONF.L2GW.l2gw_switch) <= 0):
43 msg = ('At least one switch detail must be defined.') 43 msg = ('At least one switch detail must be defined.')
44 raise cls.skipException(msg) 44 raise cls.skipException(msg)
45 if not test.is_extension_enabled('l2-gateway', 'network'): 45 if not test.is_extension_enabled('l2-gateway', 'network'):
@@ -106,6 +106,10 @@ class L2GatewaysNegativeAdminTestJSON(base.BaseAdminNetworkTest):
106 @classmethod 106 @classmethod
107 def resource_setup(cls): 107 def resource_setup(cls):
108 super(L2GatewaysNegativeAdminTestJSON, cls).resource_setup() 108 super(L2GatewaysNegativeAdminTestJSON, cls).resource_setup()
109 # At least one switch detail should be provided to run the tests
110 if (len(CONF.L2GW.l2gw_switch) <= 0):
111 msg = ('At least one switch detail must be defined.')
112 raise cls.skipException(msg)
109 if not test.is_extension_enabled('l2-gateway', 'network'): 113 if not test.is_extension_enabled('l2-gateway', 'network'):
110 msg = "L2Gateway Extension not enabled." 114 msg = "L2Gateway Extension not enabled."
111 raise cls.skipException(msg) 115 raise cls.skipException(msg)
diff --git a/tox.ini b/tox.ini
index a3bd884..aed4f6a 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,8 +4,9 @@ minversion = 1.6
4skipsdist = True 4skipsdist = True
5 5
6[testenv] 6[testenv]
7setenv = VIRTUAL_ENV={envdir} 7setenv =
8 PYTHONWARNINGS=default::DeprecationWarning 8 VIRTUAL_ENV={envdir}
9 PYTHONWARNINGS=default::DeprecationWarning
9usedevelop = True 10usedevelop = True
10install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} 11install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
11deps = -r{toxinidir}/requirements.txt 12deps = -r{toxinidir}/requirements.txt
@@ -47,10 +48,16 @@ builtins = _
47exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.tmp 48exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,.tmp
48 49
49[testenv:api] 50[testenv:api]
50setenv = OS_TEST_PATH=./networking_l2gw/tests/api 51setenv =
51 TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc} 52 {[testenv]setenv}
52 OS_TEST_API_WITH_REST=1 53 OS_TEST_PATH=./networking_l2gw/tests/api
53 OS_TEST_TIMEOUT=90 54 TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
55 OS_TEST_API_WITH_REST=1
56 OS_TEST_TIMEOUT=90
57deps = {[testenv]deps}
58commands =
59 find . -type f -name "*.py[c|o]" -delete
60 tempest run --serial {posargs}
54 61
55[hacking] 62[hacking]
56import_exceptions = networking_l2gw._i18n 63import_exceptions = networking_l2gw._i18n