-
Notifications
You must be signed in to change notification settings - Fork 179
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
CVM: add attestation report test for Azure Linux using snpguest tool #3529
base: main
Are you sure you want to change the base?
Conversation
trungams
commented
Nov 23, 2024
- Extend cargo tool to support optional build parameters
- Add support for snpguest
- Extend Azure CVM attestation report test case for Azure Linux 3.0. The attestation workflow done in the test case is described in snpguest's README
Signed-off-by: Thien Trung Vuong <[email protected]>
log_path, | ||
) | ||
elif isinstance(node.os, CBLMariner): | ||
assert_that(node.tools[SnpGuest].run_cvm_attestation()).is_true() |
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.
Do we not want/need to use similar parameters to the existing test?
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.
imo since this is the actual test case definition. Assertion should be done here rather than in the tool
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.
If all cases need a success result, you can assert in the tool. And please always add describe_as
to provide an error message in case it happens. So it's easy to know the error in the test results, instead of digging into the code.
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.
Yup. Each function in the tool already has an assert for exit code = 0, and an error message in case of failure. The assert here is more or less to make it clear what we're looking for.
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.
- This line can be
node.tools[SnpGuest].run_cvm_attestation())
. It should be enough, if the method have enough assertion already. - In case it needs to check the return code, add
described_as
to provide error message for thisassert_that
. Please have a try to understand the behaviors of assert_that.
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.
Updated
Signed-off-by: Thien Trung Vuong <[email protected]>
Signed-off-by: Thien Trung Vuong <[email protected]>
Signed-off-by: Thien Trung Vuong <[email protected]>