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 test to check quote generation via vsock #253

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

hector-cao
Copy link
Collaborator

@hector-cao hector-cao commented Oct 23, 2024

this test will contribute to verify the issue #252

the test that checks the issue is tests/test_guest_tdxattest.py::test_guest_tdxattest_vsock_wrong_qgs_addr
it currently fails and should succeed once the issue is resolved

QemuMachine created.
qemu-system-x86_64 -cpu host -smp 16,sockets=1 -accel kvm -nographic -nodefaults -no-user-config -m 2G -bios /usr/share/ovmf/OVMF.fd -object {'qom-type': 'tdx-guest', 'id': 'tdx', 'quote-generation-socket': {'type': 'vsock', 'cid': '3', 'port': '4050'}} -machine q35,kernel_irqchip=split,confidential-guest-support=tdx -drive file=/tmp/tdxtest-default-xc64ol1d/image.qcow2,if=none,id=virtio-disk0 -device virtio-blk-pci,drive=virtio-disk0 -pidfile /tmp/tdxtest-default-xc64ol1d/qemu.pid -monitor unix:/tmp/tdxtest-default-xc64ol1d/monitor.sock,server,nowait -qmp unix:/tmp/tdxtest-default-xc64ol1d/qmp.sock,server=on,wait=off -device virtio-net-pci,netdev=nic0_td -netdev user,id=nic0_td,hostfwd=tcp::55375-:22 -D /tmp/tdxtest-default-xc64ol1d/qemu-log.txt -chardev file,id=c1,path=/tmp/tdxtest-default-xc64ol1d/serial.log,signal=off -device isa-serial,chardev=c1 -device vhost-vsock-pci,guest-cid=10
Connecting ...
Connected ...

Failed to get the quote

FAILED

additional changes:

  • enable the function enable_quote_socket to enable_qgs_addr to better match what it does, add an argument to allow the customization of the QGS address

Fixes : #252

this test will contribute to verify the issue #252

additionnal changes:
 - enable the function enable_quote_socket to enable_qgs_addr
   to better match what it does, add an argument to allow
   the customization of the QGS address
@hector-cao hector-cao requested a review from a team October 23, 2024 21:06
Copy link
Collaborator

@frenchwr frenchwr left a comment

Choose a reason for hiding this comment

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

LGTM

@hector-cao
Copy link
Collaborator Author

The fix has been brought in with the version 1.21-0ubuntu2.2 of the package libtdx-attest1

And now the test passes:

tests/test_guest_tdxattest.py::test_guest_tdxattest_vsock_wrong_qgs_addr 

QemuMachine created.
qemu-system-x86_64 -cpu host -smp 16,sockets=1 -accel kvm -nographic -nodefaults -no-user-config -m 2G -bios /usr/share/ovmf/OVMF.fd -object {'qom-type': 'tdx-guest', 'id': 'tdx', 'quote-generation-socket': {'type': 'vsock', 'cid': '3', 'port': '4050'}} -machine q35,kernel_irqchip=split,confidential-guest-support=tdx -drive file=/tmp/tdxtest-default-jut8td_v/image.qcow2,if=none,id=virtio-disk0 -device virtio-blk-pci,drive=virtio-disk0 -pidfile /tmp/tdxtest-default-jut8td_v/qemu.pid -monitor unix:/tmp/tdxtest-default-jut8td_v/monitor.sock,server,nowait -qmp unix:/tmp/tdxtest-default-jut8td_v/qmp.sock,server=on,wait=off -device virtio-net-pci,netdev=nic0_td -netdev user,id=nic0_td,hostfwd=tcp::46985-:22 -D /tmp/tdxtest-default-jut8td_v/qemu-log.txt -chardev file,id=c1,path=/tmp/tdxtest-default-jut8td_v/serial.log,signal=off -device isa-serial,chardev=c1 -device vhost-vsock-pci,guest-cid=10
Connecting ...
Connected ...
PASSED

@hector-cao hector-cao merged commit 387764a into noble-24.04 Oct 24, 2024
2 checks passed
@hector-cao hector-cao deleted the noble-24.04-add-test-for-issue-252 branch November 13, 2024 22:25
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.

libtdxattest : quote generation fails with vsock method
2 participants