context:
  lava_test_sh_cmd: '/system/bin/sh'
  lava_test_results_dir: '/system/lava-%s'

device_type: hi6220-hikey-r2
job_name: hikey-android-on-dut-test
timeouts:
  job:
    minutes: 600
  action:
    minutes: 15
  connection:
    minutes: 2
priority: high
visibility: personal

metadata:
  build: https://developers.google.com/android/images-preview#hikey

protocols:
  lava-lxc:
    name: lxc-hikey-test
    distribution: ubuntu
    release: xenial
    arch: amd64
    verbose: true

actions:
- deploy:
    namespace: tlxc
    timeout:
      minutes: 15
    to: lxc
    packages:
    - wget
    - unzip
    os: debian

- boot:
    namespace: tlxc
    prompts:
    - root@(.*):/#
    - :/
    timeout:
      minutes: 5
    method: lxc

- test:
    namespace: tlxc
    timeout:
      minutes: 10
    definitions:
    - repository: https://git.linaro.org/qa/test-definitions.git
      from: git
      path: automated/linux/android-platform-tools/install.yaml
      name: install-android-platform-tools-latest

- deploy:
    timeout:
      minutes: 15
    to: fastboot
    namespace: droid
    images:
      ptable:
        url: file:///images/hikey-3606021/ptable-aosp-8g.img
        reboot: hard-reset
      boot:
        url: file:///images/hikey-3606021/boot.img
        reboot: hard-reset
      cache:
        url: file:///images/hikey-3606021/cache.img
      userdata:
        url: file:///images/hikey-3606021/userdata.img
      system:
        url: file:///images/hikey-3606021/system.img
        apply-overlay: true
    os: debian
    protocols:
      lava-lxc:
      - action: fastboot-deploy
        request: pre-power-command
        timeout:
          minutes: 2

- boot:
    namespace: droid
    prompts:
      - 'root@(.*):/#'
      - 'hikey:/'
    timeout:
      minutes: 15
    method: grub
    commands: installed
    protocols:
      lava-lxc:
      - action: grub-sequence-action
        request: pre-os-command
        timeout:
          minutes: 2

- test:
    namespace: droid
    timeout:
      minutes: 30
    definitions:
    - repository: https://github.com/chase-qi/test-definitions
      from: git
      branch: tm2
      path: automated/android/multinode/tradefed/tradefed-multinode-target.yaml
      name: tradefed-multinode-target