timeouts:
  job:
    minutes: 130
  connection:
    minutes: 2
context:
  test_character_delay: 10
device_type: dragonboard-410c
job_name: my-lxc-test
priority: high
visibility: public
metadata:
  source: https://git.linaro.org/ci/job/configs.git
  path: lt-qcom/lava-job-definitions/
protocols:
  lava-lxc:
    name: lxc-target
    template: debian
    distribution: debian
    release: stretch
    arch: amd64
    mirror: http://deb.debian.org/debian
actions:
- deploy:
    namespace: tlxc
    timeout:
      minutes: 15
    to: lxc
    packages:
    - curl
    - gzip
    - unzip
    - img2simg
    - e2fsprogs
    - cpio
    - git
    - mkbootimg
    - mktemp
    - 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:
      dtb:
        url: http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/dragonboard-410c/lkft/linux-mainline/2210/Image.gz--5.3+git0+0365fb6bae-r0-apq8016-sbc-20191028144214-2210.dtb
      kernel:
        url: http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/dragonboard-410c/lkft/linux-mainline/2210/Image.gz--5.3+git0+0365fb6bae-r0-dragonboard-410c-20191028144214-2210.bin
        compression: gz
      modules:
        url: http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/dragonboard-410c/lkft/linux-mainline/2210/modules--5.3+git0+0365fb6bae-r0-dragonboard-410c-20191028144214-2210.tgz
        compression: gz
      rootfs:
        url: http://snapshots.linaro.org/openembedded/lkft/lkft/sumo/dragonboard-410c/lkft/linux-mainline/2140/rpb-console-image-lkft-dragonboard-410c-20190929175547-2140.rootfs.ext4.gz
        compression: 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:
          - ls
          - local_modules=(ls modules-*.)
          - local_kernel=(ls *Image-*.bin)
          - local_dtb=(ls *Image-*.dtb)
          - local_rootfs=(ls *rpb-console-image-lkft-*.ext4)
          - git clone https://github.com/roxell/kir
          - cd kir
          - ./repack_boot.sh -t dragonboard-410c -d "${local_dtb}" -k "${local_kernel}"
          - ./resize_rootfs.sh -s -f "${local_rootfs}" -o "${local_modules}"
          - ls lava-lxc/
          - mv lava-lxc/boot-Image.img /lava-lxc/
          - mv lava-lxc/$(ls *rpb-console-image-lkft-*.img /lava-lxc/
          - mv /lava-lxc/$(ls *rpb-console-image-lkft-*.rootfs.img /lava-lxc/rpb-console-image-lkft.rootfs.img
- deploy:
    timeout:
      minutes: 40
    to: fastboot
    namespace: target
    images:
      boot:
        url: lxc:///boot-Image.img
      rootfs:
        url: lxc:///rpb-console-image-lkft.rootfs.img
        apply-overlay: true
    os: oe
    protocols:
      lava-lxc:
      - action: fastboot-deploy
        request: pre-power-command
        timeout:
          minutes: 2
- boot:
    namespace: target
    auto_login:
      login_prompt: 'login:'
      username: linaro
      login_commands:
        # Become super user to run tests
      - su
    prompts:
    - root@(.*):/#
    - root@dragonboard-410c:~#
    - dragonboard-410c:/home/linaro#
    - dragonboard-410c:~\$
    timeout:
      minutes: 5
    method: fastboot
- test:
    namespace: target
    timeout:
      minutes: 55
    definitions:
    - 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: dragonboard-410c
        BRANCH: mainline
        ENVIRONMENT: production
