Repository navigation
test(e2e): follow-ups to the checks that a guest has booted - #1289
richardcase wants to merge 3 commits into
Conversation
The tests of a guest that boots rely on waitForBoot, and the tests of a guest that cannot boot made the same checks with their own calls of VerifyVMM and ConsoleMarker. A waitForBoot which passed for every guest, for instance one that returned before the check of the marker, would have failed no test. The negative tests now also call waitForBoot, through gomega's InterceptGomegaFailure, and check that it fails for the reason they expect. For a VMM which has exited the wait stops at once. For the Cloud Hypervisor guest without an init, whose VMM keeps running, it waits for the marker until its timeout, so that one subtest takes 30 seconds longer. The timeout is now a parameter of waitForBoot, the tests of a guest which boots pass bootTimeout as before. The checks the tests made themselves stay: they show that a failed VMM stays down and that there is one pid file, which waitForBoot does not. Part of #1267. Signed-off-by: Richard Case <richard.case@outlook.com>
The pattern of ConsoleMarker needed a space or the end of the line on both sides of the marker. A colour code after the uptime, or before the marker, would have made a test fail for a guest which has booted. The pattern now has nothing before or after the marker. The uptime still has to be a number, so the user-data as it was given to the guest does not match. A longer namespace or name cannot match either: the marker starts with a fixed text and has the namespace and the name between fixed texts, which the existing cases of the test show. A line of the kernel in the middle of the message is not found by any pattern on one line, and is left as it is. Part of #1267. Signed-off-by: Richard Case <richard.case@outlook.com>
TestNewMicroVMSpecUsesTheProvider had the name of the kernel image of each provider. It had to be changed each time a provider got another kernel, and said little about NewMicroVMSpec. The test now runs for each known provider and compares the spec with the fields of the provider. TestKernelWithoutPVHIsNotAKernelOfAProvider stays as the check that no provider boots with the kernel of the test of a guest which cannot boot, which the literal names once caught. Closes #1267. Signed-off-by: Richard Case <richard.case@outlook.com>
✅ Deploy Preview for flintlock-docs canceled.
|
|
Hosted e2e on this branch, both providers: https://github.com/liquidmetal-dev/flintlock/actions/runs/37926554148, passed. Each negative test logs that
Proof for item 1: https://github.com/liquidmetal-dev/flintlock/actions/runs/37926628657, a throwaway branch on top of this one where in Checks: the |
…has it The pr_type workflow has failed at startup on every pull request since 31c5723 (2024-07-10), so no pull request has had its kind label checked since then. That commit pinned the docker action as docker://index.docker.io/agilepathway/pull-request-label-checker:latest@sha256:... The organisation only allows the actions on its list, which has docker://agilepathway/pull-request-label-checker:* and not the form with index.docker.io. A pinning tool writes that form, which is noted in the workflow. The action is now referenced as the list has it, pinned by the digest of the current latest image. kind/test is added to the labels the check accepts. The pull requests which only change tests carry it, such as #1260 and #1289, and the check would fail them as soon as it runs again. Signed-off-by: Richard Case <richard.case@outlook.com>
Three small changes to the e2e tests, left from the review of #1264 and filed as #1267. None of them changes what a run of the suite shows today. One commit per item.
1. The negative tests call
waitForBoot(test/e2e/boot_failure_test.go)The tests of a guest that cannot boot made the same checks as
waitForBootwith their own calls, so awaitForBootwhich passed for every guest would have failed no test. They now also call it, through gomega'sInterceptGomegaFailure, and check the reason it fails for:waitForBootwaits for the marker until its timeout ("boot marker"). This is the only guest which exercises the marker check, and the subtest takes 30 seconds longer for it.The timeout is now a parameter of
waitForBoot. The checks the tests made themselves stay, they show thingswaitForBootdoes not: that a failed VMM stays down, and that there is one pid file.2.
ConsoleMarkerfinds the marker next to an escape sequence (test/e2e/utils/checks.go)The pattern has nothing before or after the marker any more. The uptime still has to be a number, so the user-data as it was given to the guest does not match, and a longer namespace or name cannot match because the marker has them between fixed texts. The existing unit cases show both, and a case with escape sequences on both sides is added.
A line of the kernel in the middle of the message is not found by any pattern on one line. That part of the issue is left as it is.
3.
TestNewMicroVMSpecUsesTheProviderdoes not name the kernels (test/e2e/harness_test.go)The test runs for each known provider and compares the spec with the fields of the provider.
TestKernelWithoutPVHIsNotAKernelOfAProviderstays as the guard that the literal names once were.Verification
make compile-e2e,make lintandmake testpass on each commit.waitForBootwhich returns before the marker check, run in the hosted e2e so that the negative tests are seen to fail. Link to follow in a comment.Closes #1267.