andreygubarev / molecule-qemu

Molecule QEMU driver for testing Ansible roles
https://pypi.org/project/molecule-qemu/
MIT License
11 stars 8 forks source link

fix(kvm): check for existance of /dev/kvm #26

Closed glacion closed 1 year ago

glacion commented 1 year ago

The issue arises from kernel modules not listed by lsmod. KVM check fails from this issue. Instead of checking for kvm module, check for existence of /dev/kvm. This is done by the kvm-ok tool as well, where I also took the CPU checking part.

Tested on Arch Linux running on WSL2 with debian bookworm arm64 and amd64.

andreygubarev commented 1 year ago

Hello @glacion, thank you for the contribution! One thing - I had to revert EDK2 for x86 because it somehow breaks GitHub Actions tests (freezes on Wait for SSH step). It's fairly difficult to debug this behavior, however if you have ideas on how we can solve the issue please share. And once again thank you for the updates 🤗

PR with fix for GH Actions tests: https://github.com/andreygubarev/molecule-qemu/pull/27

glacion commented 1 year ago

Hi, I ran it on my M1 Pro device while making the edk II changes and there were no issues. Tried it on my WSL device as well now, I can't replicate the issue on GH actions with both test-platform-amd64 and test-platform-arm64. The failing case was test-platform-amd64.

Can't really debug it working on actions, but running the bare qemu invocation without molecule and with -nographic instead of -display none -daemonize on my local systems it's easy to see when it's going to work and when it's not.

However on my machine ubuntu on arm64 failed due to edk2 not being able to find the boot disk, probably related to the edk2 binary I pulled from arch linux, the previous QEMU_EFI.fd works with it. I'll try with edk2 binaries from debian packages.

If these work and GH actions still fail then the probable cause is that running QEMU on GH actions being so slow that it breaches the timeout waiting for SSH, increasing them could get that to work.

andreygubarev commented 1 year ago

I ran it on my M1 Pro device while making the edk II changes and there were no issues.

Confirming, tested locally without any issues.

I'll try with edk2 binaries from debian packages.

I pulled bios from debian bullseye repo If I'm not mistaken. I'll try to debug this as well with bookworm repo. Approach you implemented seems very reasonable to me so I definitelly think this part should be released.

I'll keep you posted on results of debugging process.