github/workflows: Enable test-in-svsm for NOCC#823
github/workflows: Enable test-in-svsm for NOCC#823joergroedel merged 6 commits intococonut-svsm:mainfrom
Conversation
|
I modified this PR, now it's possible to run test-in-svsm for nocc. /cc @osteffenrh who is the author of the original script |
|
update: if some of the tests doesn't pass (and panics the kernel) the GH action will run until timeout (180s). |
stefano-garzarella
left a comment
There was a problem hiding this comment.
Cool, this is nice, maybe it will slow down a bit our CI, but makes sense to me to run tests at least in native, hoping one day we will have SNP/TDX machines for our CI.
@luigix25 IIRC @osteffenrh added the |
If everything goes well, then |
Strange, in the panic handler we have Line 422 in 579de9f hlt, no?
|
no, so maybe we should call |
Exactly, you have to write in the |
IMO we should do something similar to |
Also the tests (or SVSM) might run into an infinite loop or never terminate for some other reason. |
|
Rebased on latest upstream, picking up MMIO native PR. A write to the QEMU exit port is performed whenever the test exits, successfully or panic. |
2e8f39d to
5b45026
Compare
|
Addressed Stefano's comments:
|
|
stefano-garzarella
left a comment
There was a problem hiding this comment.
LGTM, just a minor comment.
…uid` Test `test_has_memory_encryption_info_cpuid` can't be run on `native` platform. Add a check to prevent its execution. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
`exit` function, that writes to the QEMU port, uses GHCB unconditionally that is SNP only. Use `SVSM_PLATFORM` abstraction to perform the io operation according to the platform used. Tested only on native and SNP. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
QEMU, when a value is written in the exit port, returns `(value << 1) | 1`. This means that writing 0, it will return 1. This would create an ambiguity because 1 could also mean a failure in QEMU launch (i.e. error in the parameters). Change success value to 0x10. Suggested-by: Oliver Steffen <osteffen@redhat.com> Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
…c handler When an assert is hit during testing, it can be convenient to close QEMU immediately. This allows test failures to be detected quickly using specific return values. This requires writing to the QEMU exit port. Factor out `qemu_write_exit` from the `exit` function, allowing it to be reused in both the panic handler and the `exit` function. Them, add a call to `qemu_write_exit` in the panic handler to terminate QEMU with a failure code when a panic occurs during tests. Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Add necessary parameters to Makefile and `test-in-svsm` script to run tests in a nocc environment. Usage: `TEST_ARGS=--nocc make test-in-svsm` Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
Build and run test images in the CI to make sure that a PR doesn't break tests. Suggested-by: Stefano Garzarella <sgarzare@redhat.com> Signed-off-by: Luigi Leonardi <leonardi@redhat.com>
|
stefano-garzarella
left a comment
There was a problem hiding this comment.
@joergroedel I think we can merge this, but I'll wait for your review.
Note the CI time is not affected by this PR, since running tests is just 2 sec (see Run test-in-svsm in QEMU in https://github.com/coconut-svsm/svsm/actions/runs/18306479849/job/52124795547?pr=823)
|
Thanks for the review!! |
Enable
test-in-svsmfor NOCC and run them in the CI to make sure that a PR doesn't break tests.Suggested-by: Stefano Garzarella sgarzare@redhat.com