Add debug information for TestMinBwQoSOvs

In case QoS rule is not applied correctly, the list of OVS QoS and
queue registers will be printed in the log.

Change-Id: Ie77f70652af54d1d6bccb3c93a70f39e37f840a1
Related-Bug: #1909234
This commit is contained in:
Rodolfo Alonso Hernandez 2021-01-12 17:59:39 +00:00
parent f21b8950f8
commit 24393a6e99

@ -671,13 +671,27 @@ class TestMinBwQoSOvs(_TestMinBwQoS, base.BaseFullStackTestCase):
def _wait_for_min_bw_rule_applied(self, vm, min_bw, direction):
if direction == constants.EGRESS_DIRECTION:
utils.wait_until_true(
lambda: vm.bridge.get_egress_min_bw_for_port(
vm.neutron_port['id']) == min_bw)
try:
utils.wait_until_true(
lambda: vm.bridge.get_egress_min_bw_for_port(
vm.neutron_port['id']) == min_bw)
except utils.WaitTimeout:
qoses, queues = self._qos_info(vm.bridge)
msg = ('QoS for port %s failed to apply minimum BW rule %s' %
(vm.neutron_port['id'], min_bw))
self.fail(msg + qoses + queues)
elif direction == constants.INGRESS_DIRECTION:
self.fail('"%s" direction not implemented'
% constants.INGRESS_DIRECTION)
def _qos_info(self, vm_bridge):
qoses = vm_bridge._list_qos()
queues = vm_bridge._list_queues()
qoses = '\nList of OVS QoS registers:\n%s' % ''.join(str(qoses))
queues = '\nList of OVS Queue registers:\n%s' % ''.join(str(queues))
return qoses, queues
def _find_agent_qos_and_queue(self, vm):
# NOTE(ralonsoh): the "_min_bw_qos_id" in vm.bridge is not the same as
# the ID in the agent br_int instance. We need first to find the QoS
@ -699,12 +713,9 @@ class TestMinBwQoSOvs(_TestMinBwQoS, base.BaseFullStackTestCase):
utils.wait_until_true(check_qos_and_queue, timeout=10)
return data['qos'], data['qos_queue']
except utils.WaitTimeout:
qoses = vm.bridge._list_qos()
queues = vm.bridge._list_queues()
queuenum = ('QoS register not found with queue-num %s' %
data['queue_num'])
qoses = '\nList of OVS QoS registers:\n%s' % '\n'.join(qoses)
queues = '\nList of OVS Queue registers:\n%s' % '\n'.join(queues)
qoses, queues = self._qos_info(vm.bridge)
self.fail(queuenum + qoses + queues)
def test_min_bw_qos_port_removed(self):