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

snp_basic_config: Add snp basic config test case #4224

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zixi-chen
Copy link
Contributor

@zixi-chen zixi-chen commented Dec 2, 2024

ID: 2863

@zixi-chen zixi-chen force-pushed the snp_basic branch 2 times, most recently from 73ba367 to c184836 Compare December 2, 2024 09:26
@zixi-chen
Copy link
Contributor Author

zixi-chen commented Dec 3, 2024

@XueqiangWei @zhencliu @JinLiul Could you please help to review this?

@XueqiangWei
Copy link
Contributor

@zixi-chen Commit signature has been enabled, please repush the pullreq with -S. Thanks.

@zixi-chen
Copy link
Contributor Author

@zixi-chen Commit signature has been enabled, please repush the pullreq with -S. Thanks.

Done, thanks.

@zixi-chen
Copy link
Contributor Author

Update a retry function to fetch certs from the server.
...
ERROR: Unable to fetch VCEK from URL: 429
Error: Unable to fetch VCEK from URL: 429
Command 'snpguest fetch vcek pem genoa ./ attestation-report.bin' failed. Retry 1/3 in 20s...
The AMD ARK was self-signed!
The AMD ASK was signed by the AMD ARK!
The VCEK was signed by the AMD ASK!
...

Comment on lines +28 to +30
f = open(snp_module_path, "r")
output = f.read().strip()
f.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

with open(xxx) as f:
output = f.read().strip()

Comment on lines +35 to +36
if params.get("singlesocket_host_check") == "yes":
s, o = process.getstatusoutput(params.get("singlesocket_check_cmd"), shell=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove singlesocket_host_check param in cfg, just check if singlesocket_check_cmd is defined,e.g.
singlesocket_check_cmd = params.get("singlesocket_check_cmd")
if singlesocket_check_cmd:

Copy link
Contributor

@zhencliu zhencliu Dec 13, 2024

Choose a reason for hiding this comment

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

you may use process.system to return the status only if you dont need the output, or you may print out the output in the following fail()

test.cancel("Host cpu has more than 1 socket, skip the case.")

vm_name = params["main_vm"]
env_process.preprocess_vm(test, params, env, vm_name)
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this line should work fine imo

Comment on lines +70 to +72
status, output = session.cmd_status_output(guest_cmd, timeout=360)
if status:
test.fail("Guest script error")
Copy link
Contributor

Choose a reason for hiding this comment

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

use cmd_status if you don't want an output, or print out the output in the fail()

kill_vm = yes
login_timeout = 240
start_vm = no
image_snapshot = yes
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you want a snapshot here in order to keep the original image(image1) clean after your testing without any cleanup works, right? Have you checked if it works as expected?

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