Merge "Increase address allocation size for subnet pool tests with IPv4"
diff --git a/neutron_tempest_plugin/api/test_dhcp_ipv6.py b/neutron_tempest_plugin/api/test_dhcp_ipv6.py
index 3a7db96..69b4ea0 100644
--- a/neutron_tempest_plugin/api/test_dhcp_ipv6.py
+++ b/neutron_tempest_plugin/api/test_dhcp_ipv6.py
@@ -50,8 +50,8 @@
def _remove_from_list_by_index(self, things_list, elem):
for index, i in enumerate(things_list):
if i['id'] == elem['id']:
- break
- del things_list[index]
+ del things_list[index]
+ return
def _clean_network(self):
body = self.client.list_ports()
diff --git a/neutron_tempest_plugin/api/test_qos.py b/neutron_tempest_plugin/api/test_qos.py
index ba7aad8..d31eab8 100644
--- a/neutron_tempest_plugin/api/test_qos.py
+++ b/neutron_tempest_plugin/api/test_qos.py
@@ -585,7 +585,7 @@
class QosBandwidthLimitRuleWithDirectionTestJSON(
- QosBandwidthLimitRuleTestJSON):
+ QosBandwidthLimitRuleTestJSON):
required_extensions = (
QosBandwidthLimitRuleTestJSON.required_extensions +
diff --git a/neutron_tempest_plugin/api/test_timestamp.py b/neutron_tempest_plugin/api/test_timestamp.py
index 4d2d32a..769d7cc 100644
--- a/neutron_tempest_plugin/api/test_timestamp.py
+++ b/neutron_tempest_plugin/api/test_timestamp.py
@@ -27,7 +27,7 @@
required_extensions = ["standard-attr-timestamp"]
- ## attributes for subnetpool
+ # attributes for subnetpool
min_prefixlen = '28'
max_prefixlen = '31'
_ip_version = 4
diff --git a/neutron_tempest_plugin/config.py b/neutron_tempest_plugin/config.py
index d6db315..65282cf 100644
--- a/neutron_tempest_plugin/config.py
+++ b/neutron_tempest_plugin/config.py
@@ -43,6 +43,10 @@
help='Max number of networks per project. '
'Configure this only when project is limited with real '
'vlans in deployment.'),
+ cfg.StrOpt('l3_agent_mode',
+ help='The agent mode for L3 agents in the deployment. '
+ 'Configure this only when the single value is used by '
+ 'all agents in the deployment.'),
]
# TODO(amuller): Redo configuration options registration as part of the planned
diff --git a/neutron_tempest_plugin/scenario/test_dvr.py b/neutron_tempest_plugin/scenario/test_dvr.py
index b1cba5a..fa2e9d4 100644
--- a/neutron_tempest_plugin/scenario/test_dvr.py
+++ b/neutron_tempest_plugin/scenario/test_dvr.py
@@ -14,6 +14,7 @@
# under the License.
from tempest.common import utils
from tempest.lib import decorators
+import testtools
from neutron_lib import constants
from neutron_tempest_plugin import config
@@ -54,6 +55,9 @@
super(NetworkDvrTest, cls).skip_checks()
@decorators.idempotent_id('3d73ec1a-2ec6-45a9-b0f8-04a283d9d344')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_vm_reachable_through_compute(self):
"""Check that the VM is reachable through compute node.
diff --git a/neutron_tempest_plugin/scenario/test_migration.py b/neutron_tempest_plugin/scenario/test_migration.py
index 62c3642..4f9c0f3 100644
--- a/neutron_tempest_plugin/scenario/test_migration.py
+++ b/neutron_tempest_plugin/scenario/test_migration.py
@@ -19,11 +19,15 @@
from neutron_lib import constants as const
from tempest.common import utils
from tempest.lib import decorators
+import testtools
from neutron_tempest_plugin.common import utils as common_utils
+from neutron_tempest_plugin import config
from neutron_tempest_plugin.scenario import base
from neutron_tempest_plugin.scenario import test_dvr
+CONF = config.CONF
+
class NetworkMigrationTestBase(base.BaseTempestTestCase,
test_dvr.NetworkTestMixin):
@@ -131,6 +135,9 @@
class NetworkMigrationFromLegacy(NetworkMigrationTestBase):
@decorators.idempotent_id('23724222-483a-4129-bc15-7a9278f3828b')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_legacy_to_dvr(self):
self._test_migration(before_dvr=False, before_ha=False,
after_dvr=True, after_ha=False)
@@ -141,6 +148,9 @@
after_dvr=False, after_ha=True)
@decorators.idempotent_id('fe169f2c-6ed3-4eb0-8afe-2d540c4b49e2')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_legacy_to_dvr_ha(self):
self._test_migration(before_dvr=False, before_ha=False,
after_dvr=True, after_ha=True)
@@ -154,11 +164,17 @@
after_dvr=False, after_ha=False)
@decorators.idempotent_id('42260eea-5d56-4d30-b62a-a62694dfe4d5')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_ha_to_dvr(self):
self._test_migration(before_dvr=False, before_ha=True,
after_dvr=True, after_ha=False)
@decorators.idempotent_id('e4149576-248b-43fa-9d0b-a5c2f51967ce')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_ha_to_dvr_ha(self):
self._test_migration(before_dvr=False, before_ha=True,
after_dvr=True, after_ha=True)
@@ -167,16 +183,25 @@
class NetworkMigrationFromDVR(NetworkMigrationTestBase):
@decorators.idempotent_id('e5cac02c-248d-4aac-bd5e-9d47c5197307')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_dvr_to_legacy(self):
self._test_migration(before_dvr=True, before_ha=False,
after_dvr=False, after_ha=False)
@decorators.idempotent_id('a00d5ad7-8509-4bb0-bdd2-7f1ee052d1cd')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_dvr_to_ha(self):
self._test_migration(before_dvr=True, before_ha=False,
after_dvr=False, after_ha=True)
@decorators.idempotent_id('25304a51-93a8-4cf3-9523-bce8b4eaecf8')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_dvr_to_dvr_ha(self):
self._test_migration(before_dvr=True, before_ha=False,
after_dvr=True, after_ha=True)
@@ -185,16 +210,25 @@
class NetworkMigrationFromDVRHA(NetworkMigrationTestBase):
@decorators.idempotent_id('1be9b2e2-379c-40a4-a269-6687b81df691')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_dvr_ha_to_legacy(self):
self._test_migration(before_dvr=True, before_ha=True,
after_dvr=False, after_ha=False)
@decorators.idempotent_id('55957267-4e84-4314-a2f7-7cd36a2df04b')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_dvr_ha_to_ha(self):
self._test_migration(before_dvr=True, before_ha=True,
after_dvr=False, after_ha=True)
@decorators.idempotent_id('d6bedff1-72be-4a9a-8ea2-dc037cd838e0')
+ @testtools.skipUnless(
+ CONF.neutron_plugin_options.l3_agent_mode == 'dvr_snat',
+ "Need dvr_snat agent mode assumption.")
def test_from_dvr_ha_to_dvr(self):
self._test_migration(before_dvr=True, before_ha=True,
after_dvr=True, after_ha=False)
diff --git a/tox.ini b/tox.ini
index c16664d..06eda94 100644
--- a/tox.ini
+++ b/tox.ini
@@ -44,14 +44,11 @@
# H404 multi line docstring should start with a summary
# H405 multi line docstring summary not separated with an empty line
# N530 direct neutron imports not allowed
-# TODO(ihrachys) figure out what to do with N534 and N536
-# N534 Untranslated exception message
-# N536 Use assertIsNone rather than assertEqual to check for None values
-ignore = E125,E126,E128,E129,E265,H404,H405,N530,N534,N536
+ignore = E125,E126,E128,E129,E265,H404,H405,N530
# H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None
# H904: Delay string interpolations at logging calls
-enable-extensions=H106,H203,H904
+enable-extensions = H106,H203,H904
show-source = true
-exclude = ./.*,build,dist,doc
+exclude = ./.*,build,dist,doc,*egg*,releasenotes
import-order-style = pep8