Skip to content

Integration test for gh-626#728

Merged
OddBloke merged 2 commits into
canonical:masterfrom
TheRealFalcon:test-gh626
Dec 15, 2020
Merged

Integration test for gh-626#728
OddBloke merged 2 commits into
canonical:masterfrom
TheRealFalcon:test-gh626

Conversation

@TheRealFalcon
Copy link
Copy Markdown
Contributor

Proposed Commit Message

Integration test for gh-626

Ensure if wakeonlan is specified in the network config that it is
rendered in the /etc/network/interfaces or netplan config.

Additional Context

See #626

Test Steps

pytest tests/integration_tests/bugs/test_gh626.py

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

@TheRealFalcon
Copy link
Copy Markdown
Contributor Author

It looks like, at least under Ubuntu, the netplan config renders as expected, even before the changes we're testing (but not ENI). Is this expected?

'user.network-config': NETWORK_CONFIG
})
def test_wakeonlan(client: IntegrationInstance):
if ImageSpecification.from_os_image().release == 'xenial':
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking this way isn't ideal, but I see it as being short term until we come up with a better way of checking

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not even sure if this is desirable, but this would DTRT even if we haven't detected a specified image as xenial:

Suggested change
if ImageSpecification.from_os_image().release == 'xenial':
if client.execute("lsb_release --short --codename") == "xenial":

(Presumably "a better way" would be separate tests with appropriate release tagging?)

Ensure if wakeonlan is specified in the network config that it is
rendered in the /etc/network/interfaces or netplan config.
Copy link
Copy Markdown
Collaborator

@OddBloke OddBloke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, and confirmed the test passes/fails as expected. (As netplan is just passthrough, we expect it to pass already; this is regression-testing that, really.) Thanks!

'user.network-config': NETWORK_CONFIG
})
def test_wakeonlan(client: IntegrationInstance):
if ImageSpecification.from_os_image().release == 'xenial':
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not even sure if this is desirable, but this would DTRT even if we haven't detected a specified image as xenial:

Suggested change
if ImageSpecification.from_os_image().release == 'xenial':
if client.execute("lsb_release --short --codename") == "xenial":

(Presumably "a better way" would be separate tests with appropriate release tagging?)

@OddBloke OddBloke merged commit 2022bc7 into canonical:master Dec 15, 2020
@TheRealFalcon TheRealFalcon deleted the test-gh626 branch June 29, 2021 19:00
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