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

tpm_device: fix source_socket error #5866

Merged
merged 1 commit into from
Aug 29, 2024

Conversation

yanqzhan
Copy link
Contributor

source_socket accessed when it's not exist, which blocking real vm start error.

source_socket accessed when it's not exist, which blocking real
vm start error.

Signed-off-by: Yanqiu Zhang <[email protected]>
@yanqzhan
Copy link
Contributor Author

Before:
virtual_devices.tpm_device.normal_test.tpm-crb_model.emulator.plain.pcrbank_default.basic
Error Details
UnboundLocalError: cannot access local variable 'source_socket' where it is not associated with a value
In log it actually failed with another error:
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| raise virt_vm.VMStartError(
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| virttest.virt_vm.VMStartError: VM 'avocado-vt-vm1' failed to start: error: Failed to start domain 'avocado-vt-vm1'
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| error: internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/avocado-vt-vm1-swtpm.log' for details.(exit status: 1)
2024-08-09 12:10:05,505 stacktrace L0045 ERROR|
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| During handling of the above exception, another exception occurred:
2024-08-09 12:10:05,505 stacktrace L0045 ERROR|
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| Traceback (most recent call last):
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| File "/var/lib/avocado/data/avocado-vt/virttest/test-providers.d/downloads/io-github-autotest-libvirt/libvirt/tests/src/virtual_device/tpm_device.py", line 813, in run
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| if secret_value == 'none' or secret_uuid == 'nonexist' or not source_socket:
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| ^^^^^^^^^^^^^
2024-08-09 12:10:05,505 stacktrace L0045 ERROR| UnboundLocalError: cannot access local variable 'source_socket' where it is not associated with a value

After:
(1/1) type_specific.io-github-autotest-libvirt.virtual_devices.tpm_device.normal_test.tpm-crb_model.emulator.plain.pcrbank_default.basic: FAIL: VM 'avocado-vt-vm1' failed to start: error: Failed to start domain 'avocado-vt-vm1'\nerror: internal error: Could not run '/usr/bin/swtpm_setup'. exitstatus: 1; Check error log '/var/log/swtpm/libvirt/qemu/avocado-vt-vm1-swtpm.log' for details.(exit status... (6.37 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0

@yanqzhan
Copy link
Contributor Author

@chunfuwen pls review. thx.

Copy link
Contributor

@chunfuwen chunfuwen left a comment

Choose a reason for hiding this comment

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

lgtm

@chunfuwen chunfuwen merged commit 22e1602 into autotest:master Aug 29, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants