Kola: update to handle torcx deprecation / docker and containerd sysext#465
Kola: update to handle torcx deprecation / docker and containerd sysext#465t-lo merged 10 commits intoflatcar-masterfrom
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.
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.
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.
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.
I'll reverse the check and catch test returning 1 (if the binary is not present).
There was a problem hiding this comment.
Done, please have another look.
There was a problem hiding this comment.
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
tormath1
left a comment
There was a problem hiding this comment.
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.gohas been moved there from thesystemdmodule.docker/enable_docker.go.kola/tests/bpf/bpf.goandkola/tests/systemd/journald.go.kola/cluster/cluster.gohas 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-containerand put inmy-mantle-container./run_local_test.shNote that the
sysext.custom-oemtest may still fail - it tries to download a devcontainer which might not exist for your particular image version.Testing done
torcx-deprecation-docker-sysextbranch.