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: fix for preseeding failures #8528
Conversation
@stolowski this hangs in the preseed tests, oh well :-( |
LXD snap pulls in core18, not core, so the test details had to change. In addition, the test will no longer hang on failure. Restore now correctly sources the helper script to perform the unmount. Unmounting is no longer performed in the execute block. Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
07f127b
to
0a9a25f
Compare
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
428c5b4
to
6991504
Compare
This prevents interaction with spread's ssh session. Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
6991504
to
b98b07e
Compare
tests/main/preseed/task.yaml
Outdated
MATCH "Do .+ start-snap-services +Start snap \"core18\" \([0-9]+\) services" < tasks.log | ||
MATCH "Do .+ run-hook +Run health check of \"core18\" snap" < tasks.log | ||
MATCH "Do .+ run-hook +Run install hook of \"lxd\" snap if present" < tasks.log | ||
else |
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.
nitpick: I wonder if we should be explicit here that this applies to 19.10 and have an else that just fails if we run it on something unexpected?
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.
Good idea, will do.
… the main preseed test (with 20.04) with no need for injecting these snaps.
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.
+0.5 (for zyga's changes re prepare/restore and introduction of systemd unit).
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.
LGTM, one errant TODO which I think can be removed now
@@ -4,7 +4,7 @@ description: | | |||
can be undone with --reset flag. | |||
|
|||
# TODO: reenable for ubuntu-20.04-*, that now uses the snapd snap |
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 TODO can be deleted, no?
qemu-nbd -c /dev/nbd0 "$CLOUD_IMAGE" | ||
# Run qemu-ndb as a service, so that it does not interact with ssh | ||
# stdin/stdout it would otherwise inherit from the spread session. | ||
systemd-run --system --service-type=forking --unit=qemu-ndb-preseed.service "$(command -v qemu-nbd)" --fork -c /dev/nbd0 "$CLOUD_IMAGE" |
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.
nice fix!
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.
LGTM (changes from Pawel)
@@ -4,7 +4,7 @@ description: | | |||
can be undone with --reset flag. | |||
|
|||
# TODO: reenable for ubuntu-20.04-*, that now uses the snapd snap |
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.
Let's remove this in the next pass.
This patch fixes the various preseed tests in two ways:
preseed.sh
script