Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_gh668: fix failure on LXD VMs #801

Merged
merged 1 commit into from Feb 5, 2021
Merged

Conversation

OddBloke
Copy link
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
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.

None yet

2 participants