device_type: qemu
job_name: ledge qemu aarch64 ${BUILD_NUMBER}
timeouts:
  job:
    minutes: 120
  action:
    minutes: 120
  connection:
    minutes: 3
priority: 25
visibility: public
context:
  arch: aarch64
  machine: virt,secure=on
  cpu: cortex-a57
  guestfs_interface: virtio
  netdevice: user
actions:
- deploy:
    namespace: target
    timeout:
      minutes: 15
    to: tmpfs
    images:
      1rootfs:
        image_arg: -drive id=disk1,file={1rootfs},if=none,format=raw -device virtio-blk-device,drive=disk1 -nographic -device i6300esb,id=watchdog0 -m 2048 -smp 4
        url: ${SYSTEM_URL}
        compression: gz
        apply-overlay: true
        sparse: false
      3bios:
        image_arg: -drive if=pflash,unit=0,readonly=off,file={3bios},format=raw
        url: http://snapshots.linaro.org/components/ledge/ts/latest/qemuarm64-secureboot/flash.bin
    os: oe
# boot to uboot
- boot:
    namespace: target
    timeout:
      minutes: 4
    method: qemu
    media: tmpfs
    docker:
      image: linaro/ci-amd64-ledge:stable
      binary: /usr/bin/qemu-system-aarch64
    expect_shell: false
    auto_login:
      login_prompt: 'Hit any key to stop autoboot'
      username: " "
    parameters:
      kernel-start-message: "Booting Trusted Firmware"
    prompts:
    - '=>'
    boot_finished:
    - '=>'
# configure to boot the image
- test:
    namespace: target
    timeout:
      minutes: 20
    interactive:
    - name: basic-cmds
      prompts: ['=> ', 'Booting:']
      script:
      - command:
      - command: "virtio scan"
      - command: "ls virtio 0 && ls virtio 1"
      - command: "efidebug boot add -b 1 BootLedge virtio 0:1 efi/boot/bootaa64.efi -i virtio 0:1 ledge-initramfs.rootfs.cpio.gz -s 'console=ttyAMA0,115200 console=tty0 root=UUID=6091b3a4-ce08-3020-93a6-f755a22ef03b rootwait panic=60'"
      - command: "efidebug boot order 1"
      - command: "bootefi bootmgr"
# wait for boot to userspace
- boot:
    namespace: target
    timeout:
      minutes: 40
    method: minimal
    reset: false
    prompts:
      - 'ledge-qemuarm64:'
    auto_login:
      login_prompt: 'login:'
      username: "ledge"
      password_prompt: 'Password:'
      password: "ledge"
