Skip to content

test_gh668: fix failure on LXD VMs#801

Merged
OddBloke merged 1 commit into
canonical:masterfrom
OddBloke:tests2
Feb 5, 2021
Merged

test_gh668: fix failure on LXD VMs#801
OddBloke merged 1 commit into
canonical:masterfrom
OddBloke:tests2

Conversation

@OddBloke
Copy link
Copy Markdown
Collaborator

@OddBloke OddBloke commented Feb 5, 2021

Proposed Commit Message

test_gh668: fix failure on LXD VMs

In LXD containers, the default interface is named eth0.  In VMs, it
isn't; it's renamed by systemd (likely to enp5s0, but we can't rely on
that).  This means that, on VMs, the network configuration we specify
for "eth0" doesn't match an interface in the system and so is not
applied.

This modifies the test to set a MAC address in a match clause in the
network configuration and on the eth0 interface (which is the LXD name
in both containers and VMs pre-rename): this ensures that the specified
configuration applies in both cases.

Test Steps

Run the test using a LXD VM.

Checklist:

  • My code follows the process laid out in the documentation
  • I have updated or added any unit tests accordingly
  • I have updated or added any documentation accordingly

In LXD containers, the default interface is named eth0.  In VMs, it
isn't; it's renamed by systemd (likely to enp5s0, but we can't rely on
that).  This means that, on VMs, the network configuration we specify
for "eth0" doesn't match an interface in the system and so is not
applied.

This modifies the test to set a MAC address in a match clause in the
network configuration and on the eth0 interface (which is the LXD name
in both containers and VMs pre-rename): this ensures that the specified
configuration applies in both cases.
@OddBloke
Copy link
Copy Markdown
Collaborator Author

OddBloke commented Feb 5, 2021

This test still causes systemd-networkd to report the interface as "configuring" indefinitely, meaning that we have to wait out the wait-online timeout (~2mins) before cloud-init will complete.

@OddBloke OddBloke merged commit 3a0a589 into canonical:master Feb 5, 2021
@OddBloke OddBloke deleted the tests2 branch February 5, 2021 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants