Skip to content
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

Add integration test infrastructure #23

Merged
merged 6 commits into from
May 23, 2022
Merged

Conversation

crobinso
Copy link
Contributor

This adds some test infrastructure for calling the sevctl binary directly, and comparing against known good output stored in git.

This is on top of tyler's pending vmsa build work. Once that lands I'll rebase this

@crobinso
Copy link
Contributor Author

crobinso commented May 18, 2022

Rebased on main. @tylerfanelli please take a look

@tylerfanelli
Copy link
Member

This looks good. We can also add tests for other commands using this format. With this added, do you see still see a good reason to keep sevctl-test around? Or simply input those tests to the tests directory here?

@crobinso
Copy link
Contributor Author

With this added, do you see still see a good reason to keep sevctl-test around? Or simply input those tests to the tests directory here?

Any test cases that don't touch /dev/sev are nicer to have in sevctl git IMO, but I'd leave the others alone for now.

It's a little weird to me to have functional host depenent tests as part of plain cargo test. If this was python you could add a custom pytest option like --yeah-really-touch-host-dev-sev and hide the tests behind that so they are strictly opt in, but I don't know how to accomplish something like that with cargo

From rust 1.63 clippy nightly

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Add some infrastructure for calling the generated sevctl binary
directly. Add a couple `help` smoke tests to show it in action.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
Contains `tail --bytes=4096 OVMF.amdsev.fd` from package
edk2-ovmf-20220126gitbb1bba3d77-4.el9

Signed-off-by: Cole Robinson <crobinso@redhat.com>
This performs two `vmsa build` tests and compares against known
good output saved in `tests/data`.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
When that environment variable is set, we rewrite tests/data/
output when test comparison fails. This can be simplify adding new
test cases:

- Write vmsabuild.rs test case cdoe
- Set expected="tests/data/SOMENAME'
- Run `SEVCTL_TEST_REGENERATE_OUTPUT=1 cargo test`
- Commit tests/data/SOMENAME

Signed-off-by: Cole Robinson <crobinso@redhat.com>
@crobinso crobinso merged commit 1c4df9f into virtee:main May 23, 2022
@crobinso crobinso deleted the test-infra branch May 23, 2022 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants