Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions uefi-test-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ Available options:
- `--verbose`: enables verbose mode, prints commands before running them
- `--headless`: enables headless mode, which runs QEMU without a GUI
- `--release`: builds the code with optimizations enabled
- `--disable-kvm`: disable [KVM](https://www.linux-kvm.org/page/Main_Page) hardware acceleration
when running the tests in QEMU

This is especially useful if you want to run the tests under [WSL](https://docs.microsoft.com/en-us/windows/wsl/) on Windows.
12 changes: 10 additions & 2 deletions uefi-test-runner/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
'config': 'debug',
# Disables some tests which don't work in our CI setup
'ci': False,
# KVM is a Linux kernel module which allows QEMU to use
# hardware-accelerated virtualization.
'disable_kvm': False,
# QEMU executable to use
# Indexed by the `arch` setting
'qemu_binary': {
Expand Down Expand Up @@ -247,8 +250,9 @@ def run_qemu():
'-m', '256M',
])
if not SETTINGS['ci']:
# Enable acceleration if possible.
qemu_flags.append('--enable-kvm')
# Enable hardware-accelerated virtualization if possible.
if not SETTINGS['disable_kvm']:
qemu_flags.append('--enable-kvm')
else:
# Exit instead of rebooting
qemu_flags.append('-no-reboot')
Expand Down Expand Up @@ -407,6 +411,9 @@ def main():
parser.add_argument('--ci', help='disables some tests which currently break CI',
action='store_true')

parser.add_argument('--disable-kvm', help='disables hardware accelerated virtualization support in QEMU',
action='store_true')

opts = parser.parse_args()

SETTINGS['arch'] = opts.target
Expand All @@ -415,6 +422,7 @@ def main():
SETTINGS['headless'] = opts.headless
SETTINGS['config'] = 'release' if opts.release else 'debug'
SETTINGS['ci'] = opts.ci
SETTINGS['disable_kvm'] = opts.disable_kvm

verb = opts.verb

Expand Down