Add libvirt/KVM VM scripts for Linux x86_64 testing#5
Merged
Conversation
Add setup and test scripts for running netdevsim DKMS smoke tests and ptp-operator e2e tests inside libvirt/KVM VMs on Linux x86_64 hosts. Scripts: - setup-libvirt-ubuntu.sh: create VM, install DKMS, add SSH config - test-libvirt-ubuntu.sh: full lifecycle including ptp-operator tests Update README with libvirt setup docs and test instructions: ./run-on-vm.sh --dkms --mode oc,bc,dualnicbc,dualnicbcha,dualfollower <VM_IP>
Use LIBVIRT_DEFAULT_URI=qemu:///system so virsh/virt-install connect to the system daemon via polkit instead of requiring root. Only sudo is used for starting libvirtd if it is not already running. The script now checks for libvirt and kvm group membership and gives actionable errors.
- Store qcow2 disk and cloud-init ISO in ~/.local/share/netdevsim-dkms/ so the VM survives script exit - Use LIBVIRT_DEFAULT_URI=qemu:///system with polkit instead of root - Detect QEMU user (libvirt-qemu/qemu) and check ACL permissions - No sudo calls; script exits with actionable fix commands instead - Update README with group membership and ACL setup instructions
|
Worked great for me under Fedora-43, thank you! |
lack
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
scripts/setup-libvirt-ubuntu.sh— creates a libvirt/KVM VM with DKMS modules installed and loaded, adds an SSH config entryscripts/test-libvirt-ubuntu.sh— full VM lifecycle: create, install DKMS, smoke tests, ptp-operator e2e testslibvirtandkvmgroups (onlysudofor starting libvirtd if needed)Running ptp-operator tests
Test plan
./scripts/setup-libvirt-ubuntu.shon an x86_64 Linux host as a non-root user in the libvirt group./run-on-vm.sh --dkms--cleanupremoves the VMAssisted-By: Cursor