diff --git a/neutron/tests/functional/agent/linux/test_dhcp.py b/neutron/tests/functional/agent/linux/test_dhcp.py index 8d5ca163113..6ac3bf88c85 100644 --- a/neutron/tests/functional/agent/linux/test_dhcp.py +++ b/neutron/tests/functional/agent/linux/test_dhcp.py @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +import functools + import mock from oslo_config import cfg @@ -75,16 +77,19 @@ class TestDhcp(functional_base.BaseSudoTestCase): "10:22:33:44:55:69", namespace="qdhcp-foo_id") ipw = ip_lib.IPWrapper(namespace="qdhcp-foo_id") - devices = ipw.get_devices(exclude_loopback=True) + get_devices = functools.partial( + ipw.get_devices, + exclude_loopback=True, exclude_gre_devices=True) + devices = get_devices() self.addCleanup(ipw.netns.delete, 'qdhcp-foo_id') self.assertEqual(sorted(["tapfoo_id2", "tapfoo_id3"]), sorted(map(str, devices))) # setting up dhcp for the network dev_mgr.setup(tests_base.AttributeDict(network)) common_utils.wait_until_true( - lambda: 1 == len(ipw.get_devices(exclude_loopback=True)), + lambda: 1 == len(get_devices()), timeout=5, sleep=0.1, exception=RuntimeError("only one non-loopback device must remain")) - devices = ipw.get_devices(exclude_loopback=True) + devices = get_devices() self.assertEqual("tapfoo_port_id", devices[0].name)