From 9246311fac815f4085d699ec092b93de4a7c52a5 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Thu, 11 Feb 2021 09:21:23 -0500 Subject: [PATCH] integration_tests: fix test_gh626 on LXD VMs Without a MAC address match clause, the test network configuration is not applied to the primary interface in LXD VMs (which is named enp*s* rather than eth0). --- tests/integration_tests/bugs/test_gh626.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/integration_tests/bugs/test_gh626.py b/tests/integration_tests/bugs/test_gh626.py index 2d336462b97..7b0df6eb828 100644 --- a/tests/integration_tests/bugs/test_gh626.py +++ b/tests/integration_tests/bugs/test_gh626.py @@ -11,13 +11,16 @@ from tests.integration_tests.instances import IntegrationInstance +MAC_ADDRESS = "de:ad:be:ef:12:34" NETWORK_CONFIG = """\ version: 2 ethernets: eth0: dhcp4: true wakeonlan: true -""" + match: + macaddress: {} +""".format(MAC_ADDRESS) EXPECTED_ENI_END = """\ iface eth0 inet dhcp @@ -28,7 +31,8 @@ @pytest.mark.lxd_container @pytest.mark.lxd_vm @pytest.mark.lxd_config_dict({ - 'user.network-config': NETWORK_CONFIG + 'user.network-config': NETWORK_CONFIG, + "volatile.eth0.hwaddr": MAC_ADDRESS, }) def test_wakeonlan(client: IntegrationInstance): if ImageSpecification.from_os_image().release == 'xenial':