From 85e88af06aee0315c48664d968cef5a4b40e7846 Mon Sep 17 00:00:00 2001 From: Daniel Watkins Date: Tue, 16 Feb 2021 17:24:46 -0500 Subject: integration_tests: fix test_gh626 on LXD VMs (#809) 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 2d336462..7b0df6eb 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.clouds import ImageSpecification 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 @@ iface eth0 inet dhcp @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': -- cgit v1.2.3