OpenStack Networking (Neutron)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.9 KiB

# Copyright 2020 Ericsson Software Technology
# 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
# 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 unittest import mock
from import constants as qos_consts
from neutron.objects import network as network_object
from import driver
from import base
class TestOVSDriver(base.BaseQosTestCase):
def setUp(self):
super(TestOVSDriver, self).setUp()
self.driver = driver.OVSDriver.create()
def test_validate_min_bw_rule_vs_physnet_non_physnet(self):
scenarios = [
({'physical_network': 'fake physnet'}, self.assertTrue),
({}, self.assertFalse),
for segment_kwargs, test_method in scenarios:
segment = network_object.NetworkSegment(**segment_kwargs)
net = network_object.Network(mock.Mock(), segments=[segment])
rule = mock.Mock()
rule.rule_type = qos_consts.RULE_TYPE_MINIMUM_BANDWIDTH
port = mock.Mock()
with mock.patch(
mock.Mock(), rule, port))
mock.Mock(), rule, network_id=mock.Mock()))