timeouts:
  job:
    minutes: 130
  connection:
    minutes: 2
context:
  arch: arm64
  netdevice: tap
  machine: virt-2.10,accel=kvm
  cpu: host
  guestfs_interface: virtio
device_type: qemu-arm
job_name: my-lxc-test
priority: high
visibility: public
metadata:
  tmp: apa
protocols:
  lava-lxc:
    name: lxc-target
    template: debian
    distribution: debian
    release: buster
    arch: amd64
    mirror: http://deb.debian.org/debian
actions:
- deploy:
    namespace: tlxc
    timeout:
      minutes: 15
    to: lxc
    packages:
    - curl
    - img2simg
    - cpio
    - file
    - git
    - libguestfs-tools
    - mkbootimg
    - xz-utils
    os: debian
- boot:
    namespace: tlxc
    prompts:
    - root@(.*):/#
    timeout:
      minutes: 5
    method: lxc
- test:
    namespace: tlxc
    timeout:
      minutes: 10
    definitions:
    - repository: https://github.com/Linaro/test-definitions.git
      from: git
      path: automated/linux/android-platform-tools/install.yaml
      name: install-android-platform-tools-r2600
      parameters:
        LINK: https://dl.google.com/android/repository/platform-tools_r26.0.0-linux.zip
- deploy:
    timeout:
      minutes: 40
    to: download
    namespace: target
    images:
      kernel:
        url: http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/hikey/lkft/linux-mainline/2210/Image--5.3+git0+0365fb6bae-r0-hikey-20191028145508-2210.bin
      modules:
        url: http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/hikey/lkft/linux-mainline/2210/modules--5.3+git0+0365fb6bae-r0-hikey-20191028145508-2210.tgz
      rootfs:
        url: http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/hikey/lkft/linux-mainline/2140/rpb-console-image-lkft-hikey-20190929175502-2140.rootfs.ext4.gz
        apply-overlay: true
    os: oe
- test:
    namespace: tlxc
    timeout:
      minutes: 30
    definitions:
    - from: inline
      name: resize-rootfs
      path: inline/resize-rootfs.yaml
      repository:
        metadata:
          description: resize rootfs image for test overlay
          format: Lava-Test Test Definition 1.0
          name: resize-rootfs
        run:
          steps:
          - pwd
          - cd /lava-lxc
          - curl -sSOL https://raw.githubusercontent.com/roxell/kir/wip/setup.sh
          - ls
          - chmod +x setup.sh
          - ls
          - ./setup.sh qemu wip2
- deploy:
    timeout:
      minutes: 15
    to: tmpfs
    namespace: target
    connection: lxc
    images:
      kernel:
        image_arg: -kernel {kernel} --append "console=ttyAMA0 root=/dev/vda rw"
        url: lxc:///Image.bin
        type: image
      rootfs:
        image_arg: -drive format=raw,file={rootfs},if=virtio -m 4096 -smp 4 -nographic
        url: lxc:///rpb-console-image-lkft.rootfs.ext4
        apply-overlay: true
        sparse: false
    os: oe
- boot:
    namespace: target
    timeout:
      minutes: 10
    method: qemu
    media: tmpfs
    auto_login:
      login_prompt: 'login:'
      username: root
      login_commands:
      - su
    prompts:
    - root@(.*):~#
- test:
    namespace: target
    timeout:
      minutes: 55
    definitions:
    - from: inline
      repository:
        metadata:
          format: Lava-Test Test Definition 1.0
          name: prep-tmp-disk
          description: Link /scratch to /tmp
        run:
          steps:
          - df -h
          - ln -s /tmp /scratch
      name: prep-tmp-disk
      path: inline/prep.yaml
    - from: inline
      repository:
        metadata:
          format: Lava-Test Test Definition 1.0
          name: timesync-off
          description: Disable systemd time sync services
        run:
          steps:
          - systemctl stop systemd-timesyncd || true
      name: timesync-off
      path: inline/timesync-off.yaml
    - repository: https://github.com/Linaro/test-definitions.git
      from: git
      revision: master
      path: automated/linux/kselftest/kselftest.yaml
      name: kselftest
      parameters:
        KSELFTEST_PATH: /opt/kselftests/default-in-kernel/
        SKIPFILE: skipfile-lkft.yaml
        BOARD: qemu_arm64
        BRANCH: mainline
        ENVIRONMENT: production
