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

Integration test for gh-626 #728

Merged
merged 2 commits into from Dec 15, 2020
Merged

Conversation

TheRealFalcon
Copy link
Member

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
Member 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
Member 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
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
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
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.

None yet

2 participants