Merge "Use random name in qos test_list_policy_filter_by_name"
diff --git a/neutron_tempest_plugin/api/test_qos.py b/neutron_tempest_plugin/api/test_qos.py
index a85a037..59a0eb6 100644
--- a/neutron_tempest_plugin/api/test_qos.py
+++ b/neutron_tempest_plugin/api/test_qos.py
@@ -41,6 +41,10 @@
cls.qos_bw_limit_rule_client = \
cls.os_admin.qos_limit_bandwidth_rules_client
+ def setUp(self):
+ super(QosTestJSON, self).setUp()
+ self.policy_name = data_utils.rand_name(name='test', prefix='policy')
+
@staticmethod
def _get_driver_details(rule_type_details, driver_name):
for driver in rule_type_details['drivers']:
@@ -78,7 +82,7 @@
@decorators.idempotent_id('606a48e2-5403-4052-b40f-4d54b855af76')
@utils.requires_ext(extension="project-id", service="network")
def test_show_policy_has_project_id(self):
- policy = self.create_qos_policy(name='test-policy', shared=False)
+ policy = self.create_qos_policy(name=self.policy_name, shared=False)
body = self.admin_client.show_qos_policy(policy['id'])
show_policy = body['policy']
self.assertIn('project_id', show_policy)
@@ -130,7 +134,7 @@
@decorators.idempotent_id('8e88a54b-f0b2-4b7d-b061-a15d93c2c7d6')
def test_policy_update(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='',
shared=False,
project_id=self.admin_client.tenant_id)
@@ -146,7 +150,7 @@
@decorators.idempotent_id('6e880e0f-bbfc-4e54-87c6-680f90e1b618')
def test_policy_update_forbidden_for_regular_tenants_own_policy(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='',
shared=False,
project_id=self.client.tenant_id)
@@ -157,7 +161,7 @@
@decorators.idempotent_id('4ecfd7e7-47b6-4702-be38-be9235901a87')
def test_policy_update_forbidden_for_regular_tenants_foreign_policy(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='',
shared=False,
project_id=self.admin_client.tenant_id)
@@ -168,7 +172,7 @@
@decorators.idempotent_id('ee263db4-009a-4641-83e5-d0e83506ba4c')
def test_shared_policy_update(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='',
shared=True,
project_id=self.admin_client.tenant_id)
@@ -251,7 +255,7 @@
@decorators.idempotent_id('65b9ef75-1911-406a-bbdb-ca1d68d528b0')
def test_policy_association_with_admin_network(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
network = self.create_network('test network', shared=True,
@@ -263,7 +267,7 @@
@decorators.idempotent_id('1738de5d-0476-4163-9022-5e1b548c208e')
def test_policy_association_with_tenant_network(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=True)
network = self.create_network('test network',
@@ -283,7 +287,7 @@
@decorators.idempotent_id('1aa55a79-324f-47d9-a076-894a8fc2448b')
def test_policy_association_with_network_non_shared_policy(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self.assertRaises(
@@ -293,7 +297,7 @@
@decorators.idempotent_id('09a9392c-1359-4cbb-989f-fb768e5834a8')
def test_policy_update_association_with_admin_network(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
network = self.create_network('test network', shared=True)
@@ -308,7 +312,7 @@
@decorators.idempotent_id('98fcd95e-84cf-4746-860e-44692e674f2e')
def test_policy_association_with_port_shared_policy(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=True)
network = self.create_network('test network', shared=True)
@@ -329,7 +333,7 @@
@decorators.idempotent_id('f53d961c-9fe5-4422-8b66-7add972c6031')
def test_policy_association_with_port_non_shared_policy(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
network = self.create_network('test network', shared=True)
@@ -340,7 +344,7 @@
@decorators.idempotent_id('f8163237-fba9-4db5-9526-bad6d2343c76')
def test_policy_update_association_with_port_shared_policy(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=True)
network = self.create_network('test network', shared=True)
@@ -355,7 +359,7 @@
@decorators.idempotent_id('18163237-8ba9-4db5-9525-bad6d2343c75')
def test_delete_not_allowed_if_policy_in_use_by_network(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=True)
self.create_network('test network', qos_policy_id=policy['id'],
@@ -366,7 +370,7 @@
@decorators.idempotent_id('24153230-84a9-4dd5-9525-bad6d2343c75')
def test_delete_not_allowed_if_policy_in_use_by_port(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=True)
network = self.create_network('test network', shared=True)
@@ -377,7 +381,7 @@
@decorators.idempotent_id('a2a5849b-dd06-4b18-9664-0b6828a1fc27')
def test_qos_policy_delete_with_rules(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self._create_qos_bw_limit_rule(
@@ -406,7 +410,7 @@
@decorators.idempotent_id('18d94f22-b9d5-4390-af12-d30a0cfc4cd3')
def test_default_policy_creating_network_without_policy(self):
project_id = self.create_project()['id']
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
project_id=project_id,
is_default=True)
network = self.create_network('test network', client=self.admin_client,
@@ -433,7 +437,7 @@
@decorators.idempotent_id('06060880-2956-4c16-9a63-f284c3879229')
def test_user_create_port_with_admin_qos_policy(self):
qos_policy = self.create_qos_policy(
- name='test-policy',
+ name=self.policy_name,
project_id=self.admin_client.tenant_id,
shared=False)
network = self.create_network(
@@ -463,6 +467,10 @@
def resource_setup(cls):
super(QosBandwidthLimitRuleTestJSON, cls).resource_setup()
+ def setUp(self):
+ super(QosBandwidthLimitRuleTestJSON, self).setUp()
+ self.policy_name = data_utils.rand_name(name='test', prefix='policy')
+
def _create_qos_bw_limit_rule(self, policy_id, rule_data):
rule = self.qos_bw_limit_rule_client.create_limit_bandwidth_rule(
qos_policy_id=policy_id,
@@ -484,7 +492,7 @@
@decorators.idempotent_id('8a59b00b-3e9c-4787-92f8-93a5cdf5e378')
def test_rule_create(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self._create_qos_bw_limit_rule(
@@ -519,7 +527,7 @@
@decorators.idempotent_id('8a59b00b-ab01-4787-92f8-93a5cdf5e378')
def test_rule_create_fail_for_the_same_type(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self._create_qos_bw_limit_rule(
@@ -533,7 +541,7 @@
@decorators.idempotent_id('149a6988-2568-47d2-931e-2dbc858943b3')
def test_rule_update(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self._create_qos_bw_limit_rule(
@@ -559,7 +567,7 @@
@decorators.idempotent_id('67ee6efd-7b33-4a68-927d-275b4f8ba958')
def test_rule_delete(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self._create_qos_bw_limit_rule(
@@ -592,7 +600,7 @@
@decorators.idempotent_id('1bfc55d9-6fd8-4293-ab3a-b1d69bf7cd2e')
def test_rule_update_forbidden_for_regular_tenants_own_policy(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False,
project_id=self.client.tenant_id)
@@ -607,7 +615,7 @@
@decorators.idempotent_id('9a607936-4b6f-4c2f-ad21-bd5b3d4fc91f')
def test_rule_update_forbidden_for_regular_tenants_foreign_policy(self):
policy = self.create_qos_policy(
- name='test-policy',
+ name=self.policy_name,
description='test policy',
shared=False,
project_id=self.admin_client.tenant_id)
@@ -651,7 +659,7 @@
# As an admin create an non shared QoS policy,add a rule
# and associate it with a network
self.network = self.create_network()
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy for attach',
shared=False)
self._create_qos_bw_limit_rule(
@@ -702,10 +710,14 @@
def resource_setup(cls):
super(QosBandwidthLimitRuleWithDirectionTestJSON, cls).resource_setup()
+ def setUp(self):
+ super(QosBandwidthLimitRuleWithDirectionTestJSON, self).setUp()
+ self.policy_name = data_utils.rand_name(name='test', prefix='policy')
+
@decorators.idempotent_id('c8cbe502-0f7e-11ea-8d71-362b9e155667')
def test_create_policy_with_multiple_rules(self):
# Create a policy with multiple rules
- policy = self.create_qos_policy(name='test-policy1',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy1',
shared=False)
@@ -1004,9 +1016,13 @@
def resource_setup(cls):
super(QosDscpMarkingRuleTestJSON, cls).resource_setup()
+ def setUp(self):
+ super(QosDscpMarkingRuleTestJSON, self).setUp()
+ self.policy_name = data_utils.rand_name(name='test', prefix='policy')
+
@decorators.idempotent_id('f5cbaceb-5829-497c-9c60-ad70969e9a08')
def test_rule_create(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self.admin_client.create_dscp_marking_rule(
@@ -1035,7 +1051,7 @@
@decorators.idempotent_id('08553ffe-030f-4037-b486-7e0b8fb9385a')
def test_rule_create_fail_for_the_same_type(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self.admin_client.create_dscp_marking_rule(
@@ -1048,7 +1064,7 @@
@decorators.idempotent_id('76f632e5-3175-4408-9a32-3625e599c8a2')
def test_rule_update(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self.admin_client.create_dscp_marking_rule(
@@ -1064,7 +1080,7 @@
@decorators.idempotent_id('74f81904-c35f-48a3-adae-1f5424cb3c18')
def test_rule_delete(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self.admin_client.create_dscp_marking_rule(
@@ -1096,7 +1112,7 @@
@decorators.idempotent_id('33646b08-4f05-4493-a48a-bde768a18533')
def test_invalid_rule_create(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self.assertRaises(
@@ -1163,7 +1179,7 @@
# Create QoS policy
dscp_policy_id = self.create_qos_policy(
- name='test-policy',
+ name=self.policy_name,
description='test-qos-policy',
shared=True)['id']
@@ -1211,9 +1227,13 @@
cls.qos_min_bw_rules_client_primary = \
cls.os_primary.qos_minimum_bandwidth_rules_client
+ def setUp(self):
+ super(QosMinimumBandwidthRuleTestJSON, self).setUp()
+ self.policy_name = data_utils.rand_name(name='test', prefix='policy')
+
@decorators.idempotent_id('aa59b00b-3e9c-4787-92f8-93a5cdf5e378')
def test_rule_create(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self.qos_min_bw_rules_client.create_minimum_bandwidth_rule(
@@ -1247,7 +1267,7 @@
@decorators.idempotent_id('266d9b87-e51c-48bd-9aa7-8269573621be')
def test_rule_create_fail_for_missing_min_kbps(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self.assertRaises(
@@ -1258,7 +1278,7 @@
@decorators.idempotent_id('aa59b00b-ab01-4787-92f8-93a5cdf5e378')
def test_rule_create_fail_for_the_same_type(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self.qos_min_bw_rules_client.create_minimum_bandwidth_rule(
@@ -1277,7 +1297,7 @@
@utils.requires_ext(extension="qos-bw-minimum-ingress",
service="network")
def test_rule_create_pass_for_direction_ingress(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self.qos_min_bw_rules_client.create_minimum_bandwidth_rule(
@@ -1294,7 +1314,7 @@
@decorators.idempotent_id('a49a6988-2568-47d2-931e-2dbc858943b3')
def test_rule_update(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self.qos_min_bw_rules_client.create_minimum_bandwidth_rule(
@@ -1315,7 +1335,7 @@
@decorators.idempotent_id('a7ee6efd-7b33-4a68-927d-275b4f8ba958')
def test_rule_delete(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self.qos_min_bw_rules_client.create_minimum_bandwidth_rule(
@@ -1396,6 +1416,10 @@
cls.min_pps_client_primary = \
cls.os_primary.qos_minimum_packet_rate_rules_client
+ def setUp(self):
+ super(QosMinimumPpsRuleTestJSON, self).setUp()
+ self.policy_name = data_utils.rand_name(name='test', prefix='policy')
+
def _create_qos_min_pps_rule(self, policy_id, rule_data):
rule = self.min_pps_client.create_minimum_packet_rate_rule(
policy_id, **rule_data)['minimum_packet_rate_rule']
@@ -1407,7 +1431,7 @@
@decorators.idempotent_id('66a5b9b4-d4f9-4af8-b238-9e1881b78487')
def test_rule_create(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self._create_qos_min_pps_rule(
@@ -1440,7 +1464,7 @@
@decorators.idempotent_id('6b656b57-d2bf-47f9-89a9-1baad1bd5418')
def test_rule_create_fail_for_missing_min_kpps(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self.assertRaises(exceptions.BadRequest,
@@ -1450,7 +1474,7 @@
@decorators.idempotent_id('f41213e5-2ab8-4916-b106-38d2cac5e18c')
def test_rule_create_fail_for_the_same_type(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self._create_qos_min_pps_rule(policy['id'],
@@ -1465,7 +1489,7 @@
@decorators.idempotent_id('ceb8e41e-3d72-11ec-a446-d7faae6daec2')
def test_rule_create_any_direction_when_egress_direction_exists(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self._create_qos_min_pps_rule(policy['id'],
@@ -1480,7 +1504,7 @@
@decorators.idempotent_id('a147a71e-3d7b-11ec-8097-278b1afd5fa2')
def test_rule_create_egress_direction_when_any_direction_exists(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
self._create_qos_min_pps_rule(policy['id'],
@@ -1495,7 +1519,7 @@
@decorators.idempotent_id('522ed09a-1d7f-4c1b-9195-61f19caf916f')
def test_rule_update(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self._create_qos_min_pps_rule(
@@ -1516,7 +1540,7 @@
@decorators.idempotent_id('a020e186-3d60-11ec-88ca-d7f5eec22764')
def test_rule_update_direction_conflict(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule1 = self._create_qos_min_pps_rule(
@@ -1545,7 +1569,7 @@
@decorators.idempotent_id('c49018b6-d358-49a1-a94b-d53224165045')
def test_rule_delete(self):
- policy = self.create_qos_policy(name='test-policy',
+ policy = self.create_qos_policy(name=self.policy_name,
description='test policy',
shared=False)
rule = self._create_qos_min_pps_rule(
diff --git a/neutron_tempest_plugin/api/test_qos_negative.py b/neutron_tempest_plugin/api/test_qos_negative.py
index 505d1eb..1f3ff05 100644
--- a/neutron_tempest_plugin/api/test_qos_negative.py
+++ b/neutron_tempest_plugin/api/test_qos_negative.py
@@ -55,8 +55,10 @@
@decorators.attr(type='negative')
@decorators.idempotent_id('0e85f3e4-7a93-4187-b847-8f4e835aae1b')
def test_update_policy_with_too_long_name(self):
- policy = self.create_qos_policy(name='test', description='test policy',
- shared=False)
+ policy = self.create_qos_policy(
+ name=data_utils.rand_name('test', 'policy'),
+ description='test policy',
+ shared=False)
self.assertRaises(lib_exc.BadRequest,
self.client.update_qos_policy, policy['id'],
name=LONG_NAME_NG)
@@ -64,8 +66,10 @@
@decorators.attr(type='negative')
@decorators.idempotent_id('925c7eaf-474b-4a02-a4ba-76a9f82bc45a')
def test_update_policy_with_too_long_description(self):
- policy = self.create_qos_policy(name='test', description='test policy',
- shared=False)
+ policy = self.create_qos_policy(
+ name=data_utils.rand_name('test', 'policy'),
+ description='test policy',
+ shared=False)
self.assertRaises(lib_exc.BadRequest,
self.client.update_qos_policy, policy['id'],
description=LONG_DESCRIPTION_NG)
@@ -100,9 +104,10 @@
def _test_rule_update_rule_nonexistent_policy(self, create_params,
update_params):
non_exist_id = data_utils.rand_name('qos_policy')
- policy = self.create_qos_policy(name='test-policy',
- description='test policy',
- shared=False)
+ policy = self.create_qos_policy(
+ name=data_utils.rand_name('test', 'policy'),
+ description='test policy',
+ shared=False)
rule = self.rule_create_m(policy['id'], **create_params)
if "minimum_bandwidth_rule" in rule.keys():
rule_id = rule['minimum_bandwidth_rule']['id']
diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py
index 6674cb8..cbe5df6 100644
--- a/neutron_tempest_plugin/scenario/base.py
+++ b/neutron_tempest_plugin/scenario/base.py
@@ -367,7 +367,8 @@
should_succeed=True,
nic=None, mtu=None, fragmentation=True,
timeout=None, pattern=None,
- forbid_packet_loss=False):
+ forbid_packet_loss=False,
+ check_response_ip=True):
"""check ping server via source ssh connection
:param source: RemoteClient: an ssh connection from which to ping
@@ -380,6 +381,7 @@
:param timeout: Timeout for all ping packet(s) to succeed
:param pattern: hex digits included in ICMP messages
:param forbid_packet_loss: forbid or allow some lost packets
+ :param check_response_ip: check response ip
:returns: boolean -- should_succeed == ping
:returns: ping is false if ping failed
"""
@@ -422,7 +424,8 @@
LOG.debug('Packet loss detected')
return not should_succeed
- if validators.validate_ip_address(dest) is None:
+ if (check_response_ip and
+ validators.validate_ip_address(dest) is None):
# Assert that the return traffic was from the correct
# source address.
from_source = 'from %s' % dest
@@ -436,13 +439,15 @@
nic=None, mtu=None, fragmentation=True,
servers=None, timeout=None,
ping_count=CONF.validation.ping_count,
- pattern=None, forbid_packet_loss=False):
+ pattern=None, forbid_packet_loss=False,
+ check_response_ip=True):
try:
self.assertTrue(self._check_remote_connectivity(
source, dest, ping_count, should_succeed, nic, mtu,
fragmentation,
timeout=timeout, pattern=pattern,
- forbid_packet_loss=forbid_packet_loss))
+ forbid_packet_loss=forbid_packet_loss,
+ check_response_ip=check_response_ip))
except (lib_exc.SSHTimeout, ssh_exc.AuthenticationException) as ssh_e:
LOG.debug(ssh_e)
self._log_console_output(servers)
diff --git a/neutron_tempest_plugin/scenario/test_local_ip.py b/neutron_tempest_plugin/scenario/test_local_ip.py
new file mode 100644
index 0000000..0cc9de1
--- /dev/null
+++ b/neutron_tempest_plugin/scenario/test_local_ip.py
@@ -0,0 +1,103 @@
+# Copyright 2021 Huawei, Inc. All rights reserved.
+#
+# 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.
+#
+
+from oslo_log import log as logging
+from tempest.common import utils
+from tempest.common import waiters
+from tempest.lib.common.utils import data_utils
+from tempest.lib import decorators
+
+from neutron_tempest_plugin.common import ssh
+from neutron_tempest_plugin import config
+from neutron_tempest_plugin.scenario import base
+from neutron_tempest_plugin.scenario import constants as const
+
+LOG = logging.getLogger(__name__)
+CONF = config.CONF
+
+
+class LocalIPTest(base.BaseTempestTestCase):
+ credentials = ['primary', 'admin']
+
+ @classmethod
+ @utils.requires_ext(extension="local_ip", service="network")
+ def resource_setup(cls):
+ super(LocalIPTest, cls).resource_setup()
+ cls.network = cls.create_network()
+ cls.subnet = cls.create_subnet(cls.network)
+ cls.keypair = cls.create_keypair()
+
+ # Create security group with admin privileges
+ cls.secgroup = cls.create_security_group(
+ name=data_utils.rand_name('secgroup'))
+
+ # Execute funcs to achieve ssh and ICMP capabilities
+ cls.create_loginable_secgroup_rule(secgroup_id=cls.secgroup['id'])
+ cls.create_pingable_secgroup_rule(secgroup_id=cls.secgroup['id'])
+
+ # Create router
+ cls.router = cls.create_router(
+ router_name=data_utils.rand_name("router-test"),
+ admin_state_up=True,
+ external_network_id=CONF.network.public_network_id)
+ cls.create_router_interface(cls.router['id'], cls.subnet['id'])
+
+ def _create_server(self, name=None):
+ port = self.create_port(
+ self.network, security_groups=[self.secgroup['id']])
+ server = self.create_server(
+ flavor_ref=CONF.compute.flavor_ref,
+ image_ref=CONF.compute.image_ref,
+ key_name=self.keypair['name'], name=name,
+ networks=[{'port': port['id']}])['server']
+ waiters.wait_for_server_status(self.os_primary.servers_client,
+ server['id'],
+ const.SERVER_STATUS_ACTIVE)
+
+ return {'port': port, 'server': server}
+
+ @decorators.idempotent_id('3aa4b288-011a-4aa2-9024-19ad2ce40bfd')
+ def test_local_ip_connectivity(self):
+ server1 = self._create_server(name='local_ip_vm1')
+ server2 = self._create_server(name='local_ip_vm2')
+
+ fip = self.create_and_associate_floatingip(server1['port']['id'])
+ ssh_client = ssh.Client(
+ fip['floating_ip_address'],
+ CONF.validation.image_ssh_user,
+ pkey=self.keypair['private_key'])
+
+ servers = [server1['server'], server2['server']]
+
+ # first check basic connectivity
+ self.check_remote_connectivity(
+ ssh_client,
+ server2['port']['fixed_ips'][0]['ip_address'],
+ servers=servers)
+
+ local_ip = self.create_local_ip(network_id=self.network['id'])
+ self.create_local_ip_association(local_ip['id'],
+ fixed_port_id=server2['port']['id'])
+ # check connectivity with local ip address
+ self.check_remote_connectivity(
+ ssh_client, local_ip['local_ip_address'],
+ servers=servers, check_response_ip=False)
+
+ # check basic connectivity after local ip association
+ self.check_remote_connectivity(
+ ssh_client,
+ server2['port']['fixed_ips'][0]['ip_address'],
+ servers=servers,
+ check_response_ip=False)
diff --git a/zuul.d/master_jobs.yaml b/zuul.d/master_jobs.yaml
index d24eae8..468128a 100644
--- a/zuul.d/master_jobs.yaml
+++ b/zuul.d/master_jobs.yaml
@@ -150,18 +150,21 @@
ovsdb-server: false
q-ovn-metadata-agent: false
# Neutron services
+ neutron-local-ip-static: true
q-agt: true
q-dhcp: true
q-l3: true
q-meta: true
q-metering: true
network_api_extensions: *api_extensions
+ network_api_extensions_openvswitch:
+ - local_ip
network_available_features: *available_features
devstack_localrc:
Q_AGENT: openvswitch
Q_ML2_TENANT_NETWORK_TYPE: vxlan
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch
- NETWORK_API_EXTENSIONS: "{{ network_api_extensions | join(',') }}"
+ NETWORK_API_EXTENSIONS: "{{ (network_api_extensions + network_api_extensions_openvswitch) | join(',') }}"
devstack_local_conf:
post-config:
$NEUTRON_CONF:
@@ -204,6 +207,16 @@
- ^neutron/plugins/ml2/drivers/macvtap/.*$
- ^neutron/plugins/ml2/drivers/mech_sriov/.*$
- ^neutron/plugins/ml2/drivers/ovn/.*$
+ - ^neutron/services/ovn_l3/.*$
+ - ^neutron/services/logapi/drivers/ovn/.*$
+ - ^neutron/services/portforwarding/drivers/ovn/.*$
+ - ^neutron/services/qos/drivers/linuxbridge/.*$
+ - ^neutron/services/qos/drivers/ovn/.*$
+ - ^neutron/services/trunk/drivers/linuxbridge/.*$
+ - ^neutron/services/trunk/drivers/ovn/.*$
+ - ^neutron/cmd/ovn/.*$
+ - ^neutron/common/ovn/.*$
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|sfc|tap_as_a_service|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^rally-jobs/.*$
@@ -226,12 +239,15 @@
ovsdb-server: false
q-ovn-metadata-agent: false
# Neutron services
+ neutron-local-ip: true
q-agt: true
q-dhcp: true
q-l3: true
q-meta: true
q-metering: true
network_api_extensions: *api_extensions
+ network_api_extensions_openvswitch:
+ - local_ip
network_available_features: *available_features
# TODO(slaweq): remove trunks subport_connectivity test from blacklist
# when bug https://bugs.launchpad.net/neutron/+bug/1838760 will be fixed
@@ -244,7 +260,7 @@
Q_AGENT: openvswitch
Q_ML2_TENANT_NETWORK_TYPE: vxlan
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch
- NETWORK_API_EXTENSIONS: "{{ network_api_extensions | join(',') }}"
+ NETWORK_API_EXTENSIONS: "{{ (network_api_extensions + network_api_extensions_openvswitch) | join(',') }}"
devstack_local_conf:
post-config:
$NEUTRON_CONF:
@@ -290,6 +306,16 @@
- ^neutron/plugins/ml2/drivers/macvtap/.*$
- ^neutron/plugins/ml2/drivers/mech_sriov/.*$
- ^neutron/plugins/ml2/drivers/ovn/.*$
+ - ^neutron/services/ovn_l3/.*$
+ - ^neutron/services/logapi/drivers/ovn/.*$
+ - ^neutron/services/portforwarding/drivers/ovn/.*$
+ - ^neutron/services/qos/drivers/linuxbridge/.*$
+ - ^neutron/services/qos/drivers/ovn/.*$
+ - ^neutron/services/trunk/drivers/linuxbridge/.*$
+ - ^neutron/services/trunk/drivers/ovn/.*$
+ - ^neutron/cmd/ovn/.*$
+ - ^neutron/common/ovn/.*$
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|sfc|tap_as_a_service|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^rally-jobs/.*$
@@ -411,6 +437,17 @@
- ^neutron/plugins/ml2/drivers/macvtap/.*$
- ^neutron/plugins/ml2/drivers/mech_sriov/.*$
- ^neutron/plugins/ml2/drivers/ovn/.*$
+ - ^neutron/services/ovn_l3/.*$
+ - ^neutron/services/logapi/drivers/openvswitch/.*$
+ - ^neutron/services/logapi/drivers/ovn/.*$
+ - ^neutron/services/portforwarding/drivers/ovn/.*$
+ - ^neutron/services/qos/drivers/openvswitch/.*$
+ - ^neutron/services/qos/drivers/ovn/.*$
+ - ^neutron/services/trunk/drivers/openvswitch/.*$
+ - ^neutron/services/trunk/drivers/ovn/.*$
+ - ^neutron/cmd/ovn/.*$
+ - ^neutron/common/ovn/.*$
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|sfc|tap_as_a_service|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^rally-jobs/.*$
@@ -540,7 +577,12 @@
- ^neutron/plugins/ml2/drivers/openvswitch/.*$
- ^neutron/plugins/ml2/drivers/macvtap/.*$
- ^neutron/plugins/ml2/drivers/mech_sriov/.*$
+ - ^neutron/services/qos/drivers/linuxbridge/.*$
+ - ^neutron/services/qos/drivers/openvswitch/.*$
+ - ^neutron/services/trunk/drivers/linuxbridge/.*$
+ - ^neutron/services/trunk/drivers/openvswitch/.*$
- ^neutron/scheduler/.*$
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|sfc|tap_as_a_service|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^rally-jobs/.*$
@@ -783,6 +825,7 @@
- ^neutron/plugins/ml2/drivers/.*$
- ^neutron/scheduler/.*$
- ^neutron/services/(?!externaldns).*$
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|sfc|tap_as_a_service|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^rally-jobs/.*$
@@ -844,6 +887,7 @@
- ^neutron/tests/unit/.*$
- ^neutron/tests/fullstack/.*
- ^neutron/tests/functional/.*
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|tap_as_a_service|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^tools/.*$
@@ -903,6 +947,7 @@
- ^neutron/tests/unit/.*$
- ^neutron/tests/fullstack/.*
- ^neutron/tests/functional/.*
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(fwaas|neutron_dynamic_routing|sfc|tap_as_a_service|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^tools/.*$
@@ -968,6 +1013,7 @@
- ^neutron/tests/unit/.*$
- ^neutron/tests/fullstack/.*
- ^neutron/tests/functional/.*
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|sfc|tap_as_a_service|vpnaas).*$
- ^tools/.*$
- ^tox.ini$
@@ -1026,6 +1072,7 @@
- ^neutron/tests/unit/.*$
- ^neutron/tests/fullstack/.*
- ^neutron/tests/functional/.*
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|sfc|tap_as_a_service).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^tools/.*$
@@ -1129,6 +1176,7 @@
- ^neutron/tests/unit/.*$
- ^neutron/tests/fullstack/.*
- ^neutron/tests/functional/.*
+ - ^neutron_tempest_plugin/api/test_.*$
- ^neutron_tempest_plugin/(bgpvpn|fwaas|neutron_dynamic_routing|sfc|vpnaas).*$
- ^neutron_tempest_plugin/services/bgp/.*$
- ^tools/.*$