-
Notifications
You must be signed in to change notification settings - Fork 13
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
Kola: update to handle torcx deprecation / docker and containerd sysext #465
Conversation
This change updates kola to handle torcx deprecation. Newer releases of Flatcar won't ship torcx anymore, while current stable and LTS will still use it. Kola tests have been updated to conditionally run torcx tests based on the OS release version. Also, first basic sysext tests have been added in a separate kola module. Currently, tests only focus on disabling sysexts. Sysext tests formerly residing in the systemd module have been moved to the new sysext module. Furthermore, the docker enable test has been generalised to also work with syysext and moved from the torcx module to the docker module.
This change adds a logger to kola/cluster which is used to log SSH commands (at INFO level) and stdout and stderr of the command execution (at DEBUG level) to the console kola has been started on. This is useful for understanding test failures from console output alone. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change adapts the bpf execsnoop test to work with sysext - the bcc container logs differ a bit when run on sysext docker. Also, the test is made more robust as docker log line parsing is now wrapped into a retry loop instead of being one-shot. Lastly, the change removes the additional c.run() wrapper around the test function. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
Journal filtering for user units appears to be racy / flakey in Flatcar; sometimes, journalctl --user --unit=... works, and sometimes it does not. This change updates the user unit journal test to not filter by unit but instead read the full user journal. Additionally, a retry loop is added around log retrieval to avoid potential race conditions. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
output := c.MustSSH(m, | ||
`test ! -f /usr/bin/containerd || echo "ERROR"`) | ||
if string(output) == "ERROR" { | ||
c.Errorf("/usr/bin/containerd exists even when sysext is disabled!") | ||
} |
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.
The test would be more robust by asserting what we expect instead of what we don't expect.
I think the easiest way would be:
output := c.MustSSH(m, | |
`test ! -f /usr/bin/containerd || echo "ERROR"`) | |
if string(output) == "ERROR" { | |
c.Errorf("/usr/bin/containerd exists even when sysext is disabled!") | |
} | |
# Assert that the containerd binary does not exist | |
_ = c.MustSSH(m, `test ! -f /usr/bin/containerd`) |
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 disagree - the suggestion makes the command fail instead of creating a meaningful test outcome. This would imply the test itself is broken.
In general, tests should end in one of 3 ways:
- The test succeeded, signalling the build is healthy (containerd is not present).
- The test failed, signalling an issue with the build (containerd is present).
- The test is broken, signalling an issue with the test suite (either "test" or "echo" are broken, or SSH failed.)
I want to communicate 2., not 3.
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.
Yes, it makes sense to distinguish that. The test is still not robust because it checks for errors explicitly. What you can change is to use && echo SUCCESS
and if string(output) != "SUCCESS" {
to handle more things that can get wrong.
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'll reverse the check and catch test
returning 1 (if the binary is not present).
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.
Done, please have another look.
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.
What I meant was that == "ERROR"
is too narrow and the test will silently break if it returns ERROR\n
or the empty string. Therefore it's better to use something like != "SUCCESS"
.
7deb834
to
2f40955
Compare
Addressed all feedback, thank you for your review @pothos ! |
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
2f40955
to
e8d9164
Compare
Co-authored-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
ac393eb
to
f7a20fb
Compare
Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
f7a20fb
to
1a30986
Compare
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 - a last nit-pick. Feel free to rebase or not your commits. Thanks for this work!
Co-authored-by: Mathieu Tortuyaux <mtortuyaux@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This change bumps the image ref of the mantle container to ghcr.io/flatcar/mantle:git-20a2f8ffee8c8a1a042b1da99f0f59312110f285. This version includes 2 PRs (flatcar/mantle#465 and flatcar/mantle#466) which add support for sysext docker / torcx removal in the OS image. Signed-off-by: Thilo Fromm <thilofromm@microsoft.com>
This PR prepares kola for torcx deprecation. It is a prerequisite for flatcar/scripts#1216 .
sysext.go
has been moved there from thesystemd
module.docker/enable_docker.go
.kola/tests/bpf/bpf.go
andkola/tests/systemd/journald.go
.kola/cluster/cluster.go
has been extended to print SSH commands before execution (log level INFO) and command output after execution (log level DEBUG).How to use
docker build -t my-mantle-container .
sdk_container/.repo/manifests/mantle-container
and put inmy-mantle-container
./run_local_test.sh
Note that the
sysext.custom-oem
test may still fail - it tries to download a devcontainer which might not exist for your particular image version.Testing done
torcx-deprecation-docker-sysext
branch.