-
Notifications
You must be signed in to change notification settings - Fork 30
Tests support for vm boot options #1149
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
base: main
Are you sure you want to change the base?
Tests support for vm boot options #1149
Conversation
Summary of ChangesHello @rvykydal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the testing framework by providing more granular control over virtual machine test environments. It introduces a robust mechanism to specify and apply custom boot options to VMs during testing and allows tests to be conditionally executed based on the VM setup. This improvement increases the flexibility and coverage of VM-related tests, particularly for scenarios requiring specific boot configurations like network setup via kernel parameters. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces support for running tests in different VM setups, allowing extra boot options to be passed to the VM for testing various installation scenarios. While the overall implementation for adding a new decorator and logic to skip tests based on VM setup is solid, a critical command injection vulnerability has been identified in test/machine_install.py. This vulnerability arises from insecurely handling the TEST_EXTRA_BOOT_ARGS environment variable when constructing shell commands and must be addressed by properly escaping the input using shlex.quote().
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey - I've left some high level feedback:
- TEST_EXTRA_BOOT_ARGS is interpolated directly into the virt-install shell command; consider using proper shell-escaping (e.g., shlex.quote or passing arguments as a list) to avoid breakage or injection issues when the value contains spaces or quotes.
- The skip message for unsupported VM setups currently prints the raw list representation (e.g., ['','net1']); consider formatting this as a comma-separated string to make the required setups clearer in test output.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- TEST_EXTRA_BOOT_ARGS is interpolated directly into the virt-install shell command; consider using proper shell-escaping (e.g., shlex.quote or passing arguments as a list) to avoid breakage or injection issues when the value contains spaces or quotes.
- The skip message for unsupported VM setups currently prints the raw list representation (e.g., ['','net1']); consider formatting this as a comma-separated string to make the required setups clearer in test output.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
test/run
Outdated
| # other - all remaining tests | ||
| # efi - tests in UEFI mode (they might be tests which are also present in other scenarios) | ||
| # compose-{compose-id} - tests defined in wiki-testmap.json ran against given compose | ||
| # bootoptns-net1 - tests run for installation with network configuration via boot options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a new test scenario here. We need to also define it here if we want it to run:
https://github.com/cockpit-project/bots/blob/main/lib/testmap.py#L25
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want these options by default for all tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a new test scenario here. We need to also define it here if we want it to run: https://github.com/cockpit-project/bots/blob/main/lib/testmap.py#L25
Yes, thanks for the pointer, that would be the final step.
In fact, I think the test/run change should go in only with the use of the scenario, ie with 50ed010 (updated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want these options by default for all tests?
No, we want to set these specific options for special network tests as in 50ed010 of #1087. For example this test's decorator contains also "" which means the tests should run both on default setup (I think others scenario) and the special bootopts-net1 setup.
In the future we might to want add a vm_setup for two network devices configured by boot options (which means added to the vm when creating it) (There is a separate issue for it).
Resolves: INSTALLER-4518
3ff8fb6 to
b635d65
Compare
|
Updated for Gemini review. The feature is used in #1087 with Add network configuration tests for boot options configured device See the fedora-rawhide-boot/bootopts-net1 check result (triggered by For example was run also in fedora-rawhide-boot/other as expected ("" argument of run_on_vm_setups) |
Resolves: INSTALLER-4518
b635d65 to
5cf428e
Compare
The use of the test (and results of a run) can be seen in scope of network tests for another PR: #1087 (comment).
bootopts-net1scenario) should be probably moved from this PR to the networking PR as well. It illustrates the usage.