device_type: dragonboard-410c
job_name: lhg-oe-wifi-test-${MANIFEST_BRANCH}-${BUILD_NUMBER}
timeouts:
  job:
    minutes: 160
  action:
    minutes: 15
  connection:
    minutes: 2
priority: high
visibility: public

metadata:
  manifest branch: ${MANIFEST_BRANCH}
  build-url: ${BUILD_URL}
  build-location: ${BASE_URL}/${PUB_DEST}

protocols:
  lava-lxc:
    name: lxc-dragonboard-410c-test
    distribution: ubuntu
    release: xenial
    arch: amd64
    verbose: true

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

- boot:
    namespace: tlxc
    prompts:
    - root@(.*):/#
    - root@linaro-developer:~#
    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-r2600
      parameters:
        LINK: 'https://dl.google.com/android/repository/platform-tools_r26.0.0-linux.zip'

- deploy:
    timeout:
      minutes: 40
    to: fastboot
    namespace: dragonboard-410c
    images:
      boot:
        url: ${BOOT_URL}
      rootfs:
        url: ${SYSTEM_URL}
        compression: gz
        apply-overlay: true
    os: oe
    protocols:
      lava-lxc:
      - action: fastboot-deploy
        request: pre-power-command
        timeout:
          minutes: 2

- boot:
    namespace: dragonboard-410c
    auto_login:
      login_prompt: 'login:'
      username: root
    prompts:
    - root@(.*):/#
    - root@dragonboard-410c:~#
    timeout:
      minutes: 15
    method: fastboot
    protocols:
      lava-lxc:
      - action: auto-login-action
        request: pre-os-command
        timeout:
          minutes: 2

- test:
    namespace: dragonboard-410c
    name: target-simple-test
    timeout:
      minutes: 160
    definitions:
    - from: inline
      repository:
        metadata:
          format: Lava-Test Test Definition 1.0
          name: basic-tests
          description: "Basic tests after dragonboard-410c boots to the shell prompt"
        run:
          steps:
          - lava-test-case ps --shell ps aux
          - lava-test-case db410c-dmesg --shell dmesg
          - lava-test-case db410c-ifconfig --shell ifconfig -a
          - lava-test-case db410c-ping-google --shell ping -c4 www.google.com
      name: target-basic-test
      path: inline/target-basic-test.yaml

- test:
    namespace: dragonboard-410c
    name: wifi-test
    timeout:
      minutes: 5
    definitions:
    - repository: https://git.linaro.org/qa/test-definitions.git
      from: git
      path: automated/linux/wlan-smoke/wlan-smoke.yaml
      params:
        DEVICE: wlan0
      name: linux-wlan-smoke

- test:
    namespace: dragonboard-410c
    name: wlan-download-test
    timeout:
      minutes: 20
    definitions:
    - repository: https://git.linaro.org/qa/test-definitions.git
      from: git
      path: automated/linux/wlan-download/wlan-download.yaml
      params:
        DEVICE: wlan0
        ETHERNET_DEVICE: eth0
        SSID_NAME: LAVATESTX
        SSID_PASSWORD: NepjqGbq
        FILE_URL: http://testdata.validation.linaro.org/stress/stress-network.img
        FILE_CHECKSUM: e5c834fbdaa6bfd8eac5eb9404eefdd4
        TIME_DELAY: 0s
      name: linux-wlan-download
