device_type: qemu
job_name: RPB OE boot ${MACHINE} ${MANIFEST_BRANCH} ${BUILD_NUMBER}

timeouts:
  job:
    minutes: 55
  action:
    minutes: 25
  connection:
    minutes: 2
priority: 25
visibility: public

context:
  arch: arm64
  netdevice: tap
  machine: virt
  cpu: cortex-a57
  guestfs_interface: virtio
  extra_kernel_args: \"${KERNEL_ARGS}\"

actions:
- deploy:
    namespace: target
    timeout:
      minutes: 15
    to: tmpfs
    images:
      bios:
        image_arg: '-bios {bios}'
        url: https://storage.kernelci.org/images/uefi/111bbcf87621/QEMU_EFI.fd-AARCH64-RELEASE-111bbcf87621
      rootfs:
        image_arg: -drive id=disk0,file={rootfs},if=none,format=raw -device virtio-blk-device,drive=disk0 -m 4096 -smp 4 -nographic
        url: ${EXT4_IMAGE_URL}
        compression: gz
        apply-overlay: true
        sparse: false
      kernel:
        image_arg: -kernel {kernel} --append "console=ttyAMA0 root=/dev/vda rw"
        url: ${KERNEL_URL}
        type: image
    os: oe

- boot:
    namespace: target
    timeout:
      minutes: 10
    method: qemu
    media: tmpfs
    expect_shell: False
    boot_finished:
     - 'reboot: Restarting system'
     - 'reboot: System halted'
     - 'Requesting system halt'

- boot:
    namespace: target
    timeout:
      minutes: 25
    method: qemu
    media: tmpfs
    auto_login:
      login_prompt: 'login::'
      username: ledge
      password_prompt: "Password:"
      password: ledge
      login_commands:
        - sudo -s
    prompts:
    - 'ledge-(.*)# '
    - 'ledge-(.*)~: '
    - 'ledge-.*:~\$$'

metadata:
  machine: ${MACHINE}
  manifest branch: ${MANIFEST_BRANCH}
  manifest commit: ${MANIFEST_COMMIT}
  build url: ${BUILD_URL}
  build location: ${BASE_URL}${PUB_DEST}
