Merge "allow create_server with vnic_type and port_profile from kwargs"

This commit is contained in:
Zuul 2019-03-16 06:30:03 +00:00 committed by Gerrit Code Review
commit 4cc8d770f3

View File

@ -125,6 +125,27 @@ class ScenarioTest(tempest.test.BaseTestCase):
returns a test server. The purpose of this wrapper is to minimize
the impact on the code of the tests already using this
function.
:param **kwargs:
See extra parameters below
:Keyword Arguments:
* *vnic_type* (``string``) --
used when launching instances with pre-configured ports.
Examples:
normal: a traditional virtual port that is either attached
to a linux bridge or an openvswitch bridge on a
compute node.
direct: an SR-IOV port that is directly attached to a VM
macvtap: an SR-IOV port that is attached to a VM via a macvtap
device.
Defaults to ``CONF.network.port_vnic_type``.
* *port_profile* (``dict``) --
This attribute is a dictionary that can be used (with admin
credentials) to supply information influencing the binding of
the port.
example: port_profile = "capabilities:[switchdev]"
Defaults to ``CONF.network.port_profile``.
"""
# NOTE(jlanoux): As a first step, ssh checks in the scenario
@ -143,8 +164,8 @@ class ScenarioTest(tempest.test.BaseTestCase):
if name is None:
name = data_utils.rand_name(self.__class__.__name__ + "-server")
vnic_type = CONF.network.port_vnic_type
profile = CONF.network.port_profile
vnic_type = kwargs.pop('vnic_type', CONF.network.port_vnic_type)
profile = kwargs.pop('port_profile', CONF.network.port_profile)
# If vnic_type or profile are configured create port for
# every network