summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2021-02-16 17:24:46 -0500
committerGitHub <noreply@github.com>2021-02-16 17:24:46 -0500
commit85e88af06aee0315c48664d968cef5a4b40e7846 (patch)
tree7cea8590c609a2f0f5ead07efbae77eb10fc5c63
parent84e56f84d24e8f18b73c559e219b70527b9347af (diff)
downloadcloud-init-git-85e88af06aee0315c48664d968cef5a4b40e7846.tar.gz
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).
-rw-r--r--tests/integration_tests/bugs/test_gh626.py8
1 files 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':