From e2c2fb1e06df8af20d29e73fefc25f385a1b05b1 Mon Sep 17 00:00:00 2001 From: Moshe Levi Date: Thu, 31 Aug 2017 15:18:58 +0300 Subject: [PATCH] allow to config port binding:profile When using OVS HW offload feature we need to create neutron port with --binding-profile '{"capabilities": ["switchdev"]}' [1] To allow this feature to be tested with Mellanox CI we need a way to configure the port binding:profile in tempest [1] - https://review.openstack.org/#/c/504911/ Change-Id: I9b562aaabf960d38f623d88e8b88619edbb70fe8 --- ...d-port-profile-config-option-2610b2fa67027960.yaml | 11 +++++++++++ tempest/config.py | 6 +++++- tempest/scenario/manager.py | 4 +++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add-port-profile-config-option-2610b2fa67027960.yaml diff --git a/releasenotes/notes/add-port-profile-config-option-2610b2fa67027960.yaml b/releasenotes/notes/add-port-profile-config-option-2610b2fa67027960.yaml new file mode 100644 index 0000000000..b54ee8b324 --- /dev/null +++ b/releasenotes/notes/add-port-profile-config-option-2610b2fa67027960.yaml @@ -0,0 +1,11 @@ +--- +prelude: > + When using OVS HW offload feature we need to create + Neutron port with a certain capability. This is done + by creating Neutron port with binding profile. To be + able to test this we need profile capability support + in Tempest as well. +features: + - A new config option 'port_profile' is added to the section + 'network' to specify capabilities of the port. + By default this is set to {}. diff --git a/tempest/config.py b/tempest/config.py index 340a27e4a1..8a6370ac8e 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -609,10 +609,14 @@ NetworkGroup = [ " for subnet creation"), cfg.StrOpt('port_vnic_type', choices=[None, 'normal', 'direct', 'macvtap'], - help="vnic_type to use when Launching instances" + help="vnic_type to use when launching instances" " with pre-configured ports." " Supported ports are:" " ['normal','direct','macvtap']"), + cfg.DictOpt('port_profile', + default={}, + help="port profile to use when launching instances" + " with pre-configured ports."), cfg.ListOpt('default_network', default=["1.0.0.0/16", "2.0.0.0/16"], help="List of ip pools" diff --git a/tempest/scenario/manager.py b/tempest/scenario/manager.py index 06aa5311b4..ef277fb95b 100644 --- a/tempest/scenario/manager.py +++ b/tempest/scenario/manager.py @@ -139,13 +139,15 @@ class ScenarioTest(tempest.test.BaseTestCase): name = data_utils.rand_name(self.__class__.__name__ + "-server") vnic_type = CONF.network.port_vnic_type + profile = CONF.network.port_profile # If vnic_type is configured create port for # every network if vnic_type: ports = [] - create_port_body = {'binding:vnic_type': vnic_type} + create_port_body = {'binding:vnic_type': vnic_type, + 'binding:profile': profile} if kwargs: # Convert security group names to security group ids # to pass to create_port