Specify physical network in QoS fullstack tests

Since [1], those ports and networks without a physical network defined,
will reject a QoS minimum bandwidth rule.

[1] https://review.openstack.org/#/c/641712/

Change-Id: If631ed20db174b988a53d311ec9e4bf9152c17c3
Related-Bug: #1819029
This commit is contained in:
Rodolfo Alonso Hernandez 2019-03-25 10:23:50 +00:00
parent c70a935ce7
commit 0db0fb71de
1 changed files with 9 additions and 2 deletions

View File

@ -26,6 +26,7 @@ from neutron.common import utils
from neutron.tests import base as tests_base
from neutron.tests.common.agents import l2_extensions
from neutron.tests.fullstack import base
from neutron.tests.fullstack.resources import config as fullstack_config
from neutron.tests.fullstack.resources import environment
from neutron.tests.fullstack.resources import machine
from neutron.tests.fullstack import utils as fullstack_utils
@ -50,6 +51,7 @@ DSCP_MARK = 16
class BaseQoSRuleTestCase(object):
of_interface = None
number_of_hosts = 1
physical_network = None
@property
def reverse_direction(self):
@ -75,8 +77,12 @@ class BaseQoSRuleTestCase(object):
agent_type=self.l2_agent_type)['agents'][0]
self.tenant_id = uuidutils.generate_uuid()
self.network = self.safe_client.create_network(self.tenant_id,
'network-test')
network_args = {}
if self.physical_network:
network_args = {'physical_network': self.physical_network,
'network_type': 'vlan'}
self.network = self.safe_client.create_network(
self.tenant_id, name='network-test', **network_args)
self.subnet = self.safe_client.create_subnet(
self.tenant_id, self.network['id'],
cidr='10.0.0.0/24',
@ -616,6 +622,7 @@ class TestQoSPolicyIsDefault(base.BaseFullStackTestCase):
class _TestMinBwQoS(BaseQoSRuleTestCase):
number_of_hosts = 1
physical_network = fullstack_config.PHYSICAL_NETWORK_NAME
def _wait_for_min_bw_rule_removed(self, vm, direction):
# No values are provided when port doesn't have qos policy