-
Notifications
You must be signed in to change notification settings - Fork 195
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
tests: add new spread based snapd integration test #330
Conversation
d8c94e2
to
ca11dfa
Compare
FYI: packaging is done in: https://git.launchpad.net/~ubuntu-core-dev/netplan/+git/ubuntu |
ca11dfa
to
30a5433
Compare
fi | ||
# fake running on core (netplan only enabled on ubuntu core) | ||
# FIXME: find a more offical way, this if fugly | ||
cp /etc/os-release /etc/os-release.save |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs something like canonical/snapd#12607 to really work, this hack will break at some point but we have a plan in 12607
ef2fe25
to
b7a28ef
Compare
This comment was marked as resolved.
This comment was marked as resolved.
b7a28ef
to
700cfcc
Compare
src/meson.build
Outdated
@@ -41,6 +41,6 @@ meson.add_install_script(meson_make_symlink, | |||
# It's only around for legacy reasons, see netplan/cli/utils.py: get_generator_path() | |||
install_symlink( | |||
'generate', | |||
pointing_to: join_paths('..', '..') + join_paths(get_option('prefix'), libexec_netplan, 'generate'), | |||
pointing_to: join_paths('..', '..', '..') + join_paths(get_option('prefix'), libexec_netplan, 'generate'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, this change fixed the "make install" for me (but not sure if it's correct in all cases, it seems that in 0e2a8ff the path moved from /lib/netplan/generate to /usr/libexec/netplan/generate which is one level more so one more ".." seems to be needed) [but it requires a packaging update which is why the adt test fails right now it seems]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit worried about this change. It makes our autopkgtest GH action fail. We need to be careful with meson installation paths, as those can be different on Fedora/Debian/Ubuntu and might need to go hand-in-hand with packaging changes. Can we somehow avoid this change?
Maybe this helps: 2cded2f (i.e. rebase on top of our recent main
branch). See #327 for context.
700cfcc
to
d71804c
Compare
FYI: I rebased this on top of #331 to see if the spread test is now passing. |
And it looks like it did! Nice job, thanks for fixing the issue :-D ! |
66aabe4
to
3654e20
Compare
I pushed a small tweak now to properly setup/restore the state of the /etc/netplan dir (which makes the need to use multiple test bridge interfaces go away as spread will never run the same test in parallel in the same VM/container, when it runs in parallel it does so on multiple VMs/containers but not in the same). I would love to know if you folks are interested in taking this PR (in principal, happy to tweak as needed) or if you prefer not to. If this has a chance to land I can canonical/snapd#12607 to make the setup in the snapd integration test much nicer and potentially sketch how autopktest can be integrated with spread tests. While autopkgtest and spread are broadly doing the same our experience in snapd is that spread scales better with the (buildin) concept of suits and the more natural "prepare/execute/restore" patterns that one knows from regular unit test writing. It also scales better when many tests are used as it will use as many VMs/containers as provided (initially not a concern here though as the tests run in 2min right now ;) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mvo5 Sorry for taking too long to get through my PR review backlog..
Yes, I'm very much interested in landing this! Even as a spread test in GitHub actions, as proposed. We might want to migrate that later on into an autopkgtest, so it's also run at autopkgtest.ubuntu.com (and other instances, like DebCI).
But landing this spread test should be a good first step. It could also help to prepare infrastructure/tooling for further spread test integration, like canonical/network-manager-snap#15
The only thing I'm worried about is the src/meson.build
change (see my inline comment), otherwise this LGTM!
These tests integrate into the GH workflow and run snapd and dbus based integration tests.
This is archived by moving using the "restore-each" stanza and just restoring /etc/netplan in there. This avoids the need to have two br54,br55 (or N for N tests).
3654e20
to
ae86415
Compare
Actually, I think something like this should do the trick:
I rebased and force pushed to your branch. Let's see the CI results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 All tests are green now.
Michael, is there anything you'd like to add/change to this (e.g. regarding canonical/snapd#12607)? Otherwise, I think we could merge this as-is and improve upon in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is providing value as-is already. So let's get it merged. We can still improve upon this once snapd landed corresponding upstream changes. Or we've prepared an autopkgtest to run those spread tests accordingly.
Description
This is a first draft of adding integration tests for netplan with snapd and dbus. It uses spread and the LXD backend to run inside the github runners. A first test is designed to do basic interactions between netplan and snapd.
I put this into "draft" mode because I ran into the following issues:
I suspect (2) is a result in the most recent #323 ?
I also wonder if the build/install/build-dep step could be simplified by getting the debian packaging from somewhere but I could not figure out where it comes from (sorry for that and hints/ideas welcome).
Testing locally via spread