Standard test job for QEMU - Sid arm64

The first standard QEMU job uses a kernel, initramfs, modules and configuration. This is a simple boot test - a test shell is not supported as the ramdisk is not unpacked for QEMU.

QEMU with kernel and initramfs

This example will show how to boot an arm64 Debian kernel and initramfs in LAVA.

The initramfs needs to include all kernel modules which are needed to run the tests required by the test writer. The Debian initramfs includes modules automatically. There is no support for adding modules to the initramfs for QEMU in LAVA.

device_type: qemu
job_name: qemu arm64 ramdisk

    minutes: 15
    minutes: 5
    minutes: 3

priority: medium
visibility: public

Download / view qemu-kernel-standard-sid.yaml.


This example uses the Debian kernel which is a modular build. When modifying the standard qemu test jobs, always keep the builds of the kernel and initramfs in sync or provide a replacement kernel with all necessary modules built in.

Job context

  arch: arm64
  machine: virt
  netdevice: user
  cpu: cortex-a57
  - -smp
  - 1

The job context for this example specifies the default machine and cpu values for the arm64 architecture using the qemu template. (The arm64 architecture can also be specified as aarch64 with this template.)

The extra_options list can contain any option which is understood by QEMU. The name of the option and the value of that option should be listed as separate items in the extra_options list for correct parsing by QEMU.

Test writers can choose which QEMU options are specified as extra_options and which as image_arg. In some situations, this can matter as some options to QEMU need to be in a specific order. extra_options are added to the command line before image_arg and image_arg are added in the order specified in the test job.


Check the syntax carefully - the option is -smp so the line in extra_options uses a hyphen to continue the list in YAML, then a space, then the option which itself starts with a hyphen.

Deploying the kernel

- deploy:
      minutes: 5
    to: tmpfs
        image_arg: -kernel {kernel} --append 'root=/dev/ram0 rw rootwait rootdelay=5 console=ttyAMA0,38400n8 init=/sbin/init'
        sha256sum: 4dc0363bafc93f48e5b60ada3502394f61d9f1cfbf9059ceed30533aca16d706
        image_arg: -initrd {initrd}
        sha256sum: 4dfdcf9053bea72d7bc1c37f77f43c4447422c68f4ea8b99c6690de2e7f6e3e4

Deploying a kernel and initramfs without a root filesystem can be done using the image_arg support. In this example, the kernel command line is built using the --append option to QEMU.

The example also uses the sha256sum checksum support to ensure that the correct files are downloaded.


The initramfs in this test job comes from a Debian build, however the initramfs itself is not a full Debian system. In particular, it uses busybox for the shell and various utilities like mount. To handle this, the deployment must specify the operating system as oe so that LAVA can operate within the initramfs using only minimal tools.

Booting the kernel

- boot:
    method: qemu
    media: tmpfs
      minutes: 2
    - '\(initramfs\)'

As this system will boot into the initramfs, the '\(initramfs\)' prompt is specified.