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

timeouts:
  job:
    minutes: 15
  action:
    minutes: 5
  connection:
    minutes: 3

priority: medium
visibility: public

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

Note

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

context:
  arch: arm64
  machine: virt
  netdevice: user
  cpu: cortex-a57
  extra_options:
  - -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.

Note

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

actions:
- deploy:
    timeout:
      minutes: 5
    to: tmpfs
    images:
      kernel:
        image_arg: -kernel {kernel} --append 'root=/dev/ram0 rw rootwait rootdelay=5 console=ttyAMA0,38400n8 init=/sbin/init'
        url: http://images.validation.linaro.org/snapshots.linaro.org/components/lava/standard/debian/sid/arm64/8/vmlinuz-4.9.0-2-arm64
        sha256sum: 4dc0363bafc93f48e5b60ada3502394f61d9f1cfbf9059ceed30533aca16d706
      initrd:
        image_arg: -initrd {initrd}
        url: http://images.validation.linaro.org/snapshots.linaro.org/components/lava/standard/debian/sid/arm64/8/initrd.img-4.9.0-2-arm64
        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.

Caution

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
    timeout:
      minutes: 2
    prompts:
    - '\(initramfs\)'

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