Skip to content

Commit 65be5a9

Browse files
ralonsohkarelyatin
authored andcommitted
Add debug information to MacvtapAgentTestCase.test_get_all_devices
This patch is also adding an active wait checking both the MacVTap device MAC address and the list of MAC addresses returned by the MacVTAP manager. Related-Bug: #2012510 Change-Id: I13d4a76572af050ee07fbb2b9fe2abd60d337955 (cherry picked from commit 775d5de)
1 parent 9de68a7 commit 65be5a9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

neutron/tests/functional/plugins/ml2/drivers/macvtap/agent/test_macvtap_neutron_agent.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from neutron_lib import constants
1818

1919
from neutron.agent.linux import ip_lib
20+
from neutron.common import utils as common_utils
2021
from neutron.plugins.ml2.drivers.macvtap.agent import macvtap_neutron_agent
2122
from neutron.tests.common import net_helpers
2223
from neutron.tests.functional import base as functional_base
@@ -44,5 +45,14 @@ def test_get_all_devices(self):
4445
macvtap = self.useFixture(net_helpers.MacvtapFixture(
4546
src_dev=veth1.name, mode='bridge',
4647
prefix=constants.MACVTAP_DEVICE_PREFIX)).ip_dev
47-
self.assertEqual(set([macvtap.link.address]),
48-
self.mgr.get_all_devices())
48+
try:
49+
common_utils.wait_until_true(
50+
lambda: {macvtap.link.address} == self.mgr.get_all_devices(),
51+
timeout=5)
52+
except common_utils.WaitTimeout:
53+
msg = 'MacVTap address: %s, read devices: %s\n' % (
54+
macvtap.link.address, self.mgr.get_all_devices())
55+
for device in ip_lib.IPWrapper().get_devices():
56+
msg += ' Device %s, MAC: %s' % (device.name,
57+
device.link.address)
58+
self.fail(msg)

0 commit comments

Comments
 (0)