Skip to content

Added automation of Virsh commands#285

Open
Rohan-in-Qualcomm wants to merge 1 commit intoqualcomm-linux:mainfrom
Rohan-in-Qualcomm:Virtualization
Open

Added automation of Virsh commands#285
Rohan-in-Qualcomm wants to merge 1 commit intoqualcomm-linux:mainfrom
Rohan-in-Qualcomm:Virtualization

Conversation

@Rohan-in-Qualcomm
Copy link

This PR refactors the Virsh Commands into a modular suite of independent KVM test cases.

Key Changes:

  1. Modular Architecture: Split the original script into 5 standalone test cases:
  2. Kvm-Setup: Defines and starts the VM.
  3. Kvm-Reboot: Verifies reboot functionality.
  4. Kvm-Suspend: Verifies suspend/pause functionality.
  5. Kvm-Resume: Verifies resume functionality.
  6. Kvm-UnDefine: Verifies destroy and undefine functionality.

Created kvm_common.sh to handle shared logic (define, start, clean, state checks) and reduce code duplication.

Robust State Verification: Replaced simple exit code checks with a check_vm_state function that parses virsh domstate output to ensure the VM is actually in the expected state (e.g., "running", "paused", "shut off").

Independence: Each test script now manages its own lifecycle (Setup -> Test -> Undefine), allowing them to be run individually or in any order.

Reporting: Added .res file generation (PASS/FAIL) and LAVA-compatible .yaml metadata for automation integration.

@vnarapar
Copy link
Contributor

Please fix the checks

Copy link
Contributor

@smuppand smuppand left a comment

Choose a reason for hiding this comment

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

These changes are not aligned with the repository standards. Please review the contributions README and update accordingly.

@@ -0,0 +1,44 @@
#!/bin/bash

Copy link
Contributor

Choose a reason for hiding this comment

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

Please avoid creating a custom folder with your username and sending the pull request.

Copy link
Author

Choose a reason for hiding this comment

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

I have deleted the folder

@Rohan-in-Qualcomm Rohan-in-Qualcomm force-pushed the Virtualization branch 2 times, most recently from 381bdf3 to 9346e9d Compare February 13, 2026 06:40
@Rohan-in-Qualcomm
Copy link
Author

Updated the PR with the requested changes.
Please review the updated commit.

This PR refactors the Virsh Commands into a modular suite of independent KVM test cases.

Key Changes:

Modular Architecture: Split the original script into 5 standalone test cases:
Kvm-Setup: Defines and starts the VM.
Kvm-Reboot: Verifies reboot functionality.
Kvm-Suspend: Verifies suspend/pause functionality.
Kvm-Resume: Verifies resume functionality.
Kvm-UnDefine: Verifies destroy and undefine functionality.
Common Library: Created kvm_common.sh to handle shared logic (define, start, clean, state checks) and reduce code duplication.
Robust State Verification: Replaced simple exit code checks with a check_vm_state function that parses virsh domstate output to ensure the VM is actually in the expected state (e.g., "running", "paused", "shut off").
Independence: Each test script now manages its own lifecycle (Setup -> Test -> UnDefine), allowing them to be run individually or in any order.
Reporting: Added .res file generation (PASS/FAIL) and LAVA-compatible .yaml metadata for automation integration.

Signed-off-by: Rohan Dutta <rohadutt@qti.qualcomm.com>
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