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

CVM: add attestation report test for Azure Linux using snpguest tool #3529

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

trungams
Copy link
Member

  • 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

lisa/tools/cargo.py Outdated Show resolved Hide resolved
microsoft/testsuites/cvm/cvm_attestation.py Show resolved Hide resolved
log_path,
)
elif isinstance(node.os, CBLMariner):
assert_that(node.tools[SnpGuest].run_cvm_attestation()).is_true()

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?

Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. This line can be node.tools[SnpGuest].run_cvm_attestation()). It should be enough, if the method have enough assertion already.
  2. In case it needs to check the return code, add described_as to provide error message for this assert_that. Please have a try to understand the behaviors of assert_that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

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.

3 participants