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

Improve the management of workdir cleanup for debugging purposes #221

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

hector-cao
Copy link
Collaborator

  • In case of test failure, we would like that the workdir of qemu is not cleaned up so that we can do some debugging.
  • Improve the management of environment variable TDXTEST_DEBUG that forbids the clean up of these workdirs at any case

Copy link
Collaborator

@spmcmillan spmcmillan left a comment

Choose a reason for hiding this comment

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

Hi Hector, overall looks good. Added a comment. One other comment, another option when terminating Qemu is to add the kill() signal after trying to terminate properly. (in stop())

"""
if report.failed:
# enable debug flag to avoid cleanup to happen
Qemu.QemuMachine.set_debug(True)
Copy link
Collaborator

Choose a reason for hiding this comment

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

why do we want to avoid cleanup when a test fails? Don't we want the next text to start cleanly? I understand if we running individually and we can set "debug", but not generally

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

each qemu has its own working folder (/tmp/tdxtest-xxxxx/) that is not shared with other tests qemu instances

@hector-cao hector-cao force-pushed the noble-24.04-fix-cleanup branch 4 times, most recently from dcc4cde to 687c7d7 Compare September 18, 2024 11:33
@hector-cao hector-cao marked this pull request as ready for review September 18, 2024 11:47
@hector-cao hector-cao force-pushed the noble-24.04-fix-cleanup branch 2 times, most recently from 977defe to ec38679 Compare September 18, 2024 12:18
- In case of test failure, we would like that the workdir of qemu
  is not cleaned up so that we can do some debugging.
- Improve the management of environment variable TDXTEST_DEBUG
  that forbids the clean up of these workdirs at any case
@hector-cao
Copy link
Collaborator Author

hector-cao commented Sep 18, 2024

Hi Hector, overall looks good. Added a comment. One other comment, another option when terminating Qemu is to add the kill() signal after trying to terminate properly. (in stop())

I decided to split this MR into 2, the current one is now only about workdir clean up and debug flag, the second one (#227) will be on the kvm unload issue

Copy link
Collaborator

@spmcmillan spmcmillan 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 hector-cao merged commit 80b75fd into noble-24.04 Sep 18, 2024
1 check passed
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.

2 participants