device_type: rzn1d
job_name: SE ${MACHINE} dev-image (LTP/PTEST) ${MANIFEST_BRANCH}-${KERNEL_VERSION_PATCHLEVEL} ${BUILD_NUMBER}

timeouts:
  job:
    minutes: 700
  action:
    minutes: 70
  connection:
    minutes: 20
priority: medium
visibility: public

actions:

####################
# Deploy QSPI images
####################
- deploy:
    namespace: dfu-firmware
    to: tmpfs
    images:
      sf_fsbl:
        image_arg: --alt sf_fsbl --download {sf_fsbl}
        url: ${FSBL_URL}
      sf_trustedfw0:
        image_arg: --alt sf_trustedfw0 --download {sf_trustedfw0}
        url: ${OPTEE_ITB_URL}
      sf_trustedfw1:
        image_arg: --alt sf_trustedfw1 --download {sf_trustedfw1}
        url: ${OPTEE_ITB_URL}
      sf_uboot0:
        image_arg: --alt sf_uboot0 --download {sf_uboot0}
        url: ${UBOOT_ITB_URL}
      sf_uboot1:
        image_arg: --alt sf_uboot1 --download {sf_uboot1}
        url: ${UBOOT_ITB_URL}

- command:
    namespace: dfu-firmware
    name: set_boot_to_nand

- boot:
    namespace: dfu-firmware
    method: dfu
    timeout:
      minutes: 10

- command:
    namespace: test
    name: set_boot_to_qspi

##########################
# Configure ethernet ports
##########################
- command:
    namespace: test
    name: j17_off
- command:
    namespace: test
    name: j21_on
- command:
    namespace: test
    name: j22_off
- command:
    namespace: test
    name: j23_off
- command:
    namespace: test
    name: j24_off

###################
# dev-image.wic
###################
- deploy:
    namespace: test-wic
    timeout:
      minutes: 100
    to: flasher
    images:
      image:
        url: ${WIC_DEV_IMAGE_URL}
        compression: bz2
      layout:
        url: ${WIC_DEV_BMAP_URL}


- boot:
    namespace: test-wic
    connection-namespace: dfu-firmware
    timeout:
      minutes: 10
    method: u-boot
    commands:
    - "setenv linux_sd 'mmc rescan; fatload mmc 0:1 $${fdt_addr_r} $${fdt_name}; fatload mmc 0:1 $${kernel_addr_r} $${kernel_name}; setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait coherent_pool=2M audit=0; bootz $${kernel_addr_r} - $${fdt_addr_r}'"
    - run linux_sd
    auto_login:
      login_prompt: "login:"
      username: root
    prompts:
    - "root@snarc-soca9:"
    - "root@rzn1d400-bestla:"
    transfer_overlay:
      download_command: udhcpc -i eth1 -n; wget
      unpack_command: tar --touch -C / -xzf

- test:
    namespace: test-wic
    timeout:
      minutes: 10
    interactive:
    - name: basic-cmds-wic
      prompts: ["root@snarc-soca9", "root@rzn1d400-bestla"]
      script:
      - command: uname -a
      - command: cat /proc/device-tree/model ; echo ""
      - command: mount
      - command: ps aux --sort -rss
      - command: cat /proc/meminfo
      - command: cat /proc/cpuinfo
      - command: free -h
      - command: sysctl -a | grep vm.min_free_kbytes
      - command: memstat
      - command: mount
      - command: systemctl --no-pager status systemd-resolved
      - command: systemctl --no-pager restart systemd-resolved
      - command: systemctl --no-pager status systemd-resolved
      - command: ifconfig -a
      - command: ping -c 3 github.com
      - command: which docker


##################
# Functional Tests
##################
- test:
    namespace: test-wic
    timeout:
      minutes: 600
    definitions:

    - name: meminfo
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/meminfo/meminfo.yaml

    - name: ltp-syscalls-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'syscalls'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-math-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'math'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-timers-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'timers'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-fcntl-locktests-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'fcntl-locktests'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-ipc-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'ipc'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-fsx-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'fsx'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-fs-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'fs'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-hugetlb-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'hugetlb'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-io-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'io'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-nptl-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'nptl'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-pty-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'pty'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-fs_bind-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'fs_bind'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-filecaps-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'filecaps'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-admin_tools-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'admin_tools'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: ltp-connectors-tests
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ltp/ltp.yaml
      parameters:
        SKIP_INSTALL: 'true'
        TST_CMDFILES: 'connectors'
        SKIPFILE: 'skipfile-lkft.yaml'
        BOARD: ${MACHINE}
        TIMEOUT_MULTIPLIER: 3

    - name: linux-ptest
      from: git
      history: false
      repository: https://git.linaro.org/landing-teams/working/schneider/test-definitions.git
      branch: master
      path: automated/linux/ptest/ptest.yaml
      params:
        EXCLUDE: 'bluez5 bzip2 containerd e2fsprogs libxml2 parted python strace openssh openssl perl'

metadata:
  machine: ${MACHINE}
  manifest branch: ${MANIFEST_BRANCH}-${KERNEL_VERSION_PATCHLEVEL}
  manifest commit: ${MANIFEST_COMMIT}
  build url: ${BUILD_URL}
  build location: ${PUBLISH_SERVER}${PUB_DEST}

notify:
    recipients:
    - to:
        method: email
        email: ralph.siemsen@linaro.org
    criteria:
        status: incomplete
    verbosity: verbose
