fragments: &fragments
  - &frag-lkft-base https://gitlab.com/Linaro/lkft/kernel-fragments/-/raw/main/lkft.config
  - &frag-lkft-crypto https://gitlab.com/Linaro/lkft/kernel-fragments/-/raw/main/lkft-crypto.config
  - &frag-lkft-distro https://gitlab.com/Linaro/lkft/kernel-fragments/-/raw/main/distro-overrides.config
  - &frag-lkft-netdev https://gitlab.com/Linaro/lkft/kernel-fragments/-/raw/main/netdev.config
  - &frag-lkft-systemd https://gitlab.com/Linaro/lkft/kernel-fragments/-/raw/main/systemd.config
  - &frag-lkft-virtio https://gitlab.com/Linaro/lkft/kernel-fragments/-/raw/main/virtio.config

lava-job-priority: &lava-job-priority 27
lava-job-priority-sanity: &lava-job-priority-sanity 80

# if the job takes long than the lava-queue-timeout in hours to be scheduled
# the job will be canceled.
lava-queue-timeout: &lava-queue-timeout 72

# debian rootfs
rootfs-debian-bookworm-arm: &rootfs-debian-bookworm-arm https://storage.tuxboot.com/debian/bookworm/armhf/rootfs.ext4.xz
rootfs-debian-bookworm-arm-tar: &rootfs-debian-bookworm-arm-tar https://storage.tuxboot.com/debian/bookworm/armhf/rootfs.tar.xz
rootfs-debian-bookworm-arm64: &rootfs-debian-bookworm-arm64 https://storage.tuxboot.com/debian/bookworm/arm64/rootfs.ext4.xz
rootfs-debian-bookworm-arm64-tar: &rootfs-debian-bookworm-arm64-tar https://storage.tuxboot.com/debian/bookworm/arm64/rootfs.tar.xz
rootfs-debian-bookworm-i386: &rootfs-debian-bookworm-i386 https://storage.tuxboot.com/debian/bookworm/i386/rootfs.ext4.xz
rootfs-debian-bookworm-i386-tar: &rootfs-debian-bookworm-i386-tar https://storage.tuxboot.com/debian/bookworm/i386/rootfs.tar.xz
rootfs-debian-bookworm-x86_64: &rootfs-debian-bookworm-x86_64 https://storage.tuxboot.com/debian/bookworm/amd64/rootfs.ext4.xz
rootfs-debian-bookworm-x86_64-tar: &rootfs-debian-bookworm-x86_64-tar https://storage.tuxboot.com/debian/bookworm/amd64/rootfs.tar.xz

rootfs-debian-trixie-arm: &rootfs-debian-trixie-arm https://storage.tuxboot.com/debian/trixie/armhf/rootfs.ext4.xz
rootfs-debian-trixie-arm-tar: &rootfs-debian-trixie-arm-tar https://storage.tuxboot.com/debian/trixie/armhf/rootfs.tar.xz
rootfs-debian-trixie-arm64: &rootfs-debian-trixie-arm64 https://storage.tuxboot.com/debian/trixie/arm64/rootfs.ext4.xz
rootfs-debian-trixie-arm64-tar: &rootfs-debian-trixie-arm64-tar https://storage.tuxboot.com/debian/trixie/arm64/rootfs.tar.xz
rootfs-debian-trixie-i386: &rootfs-debian-trixie-i386 https://storage.tuxboot.com/debian/trixie/i386/rootfs.ext4.xz
rootfs-debian-trixie-i386-tar: &rootfs-debian-trixie-i386-tar https://storage.tuxboot.com/debian/trixie/i386/rootfs.tar.xz
rootfs-debian-trixie-x86_64: &rootfs-debian-trixie-x86_64 https://storage.tuxboot.com/debian/trixie/amd64/rootfs.ext4.xz
rootfs-debian-trixie-x86_64-tar: &rootfs-debian-trixie-x86_64-tar https://storage.tuxboot.com/debian/trixie/amd64/rootfs.tar.xz
rootfs-debian-sid-riscv64: &rootfs-debian-sid-riscv64 https://storage.tuxboot.com/debian/sid/riscv64/rootfs.ext4.xz

# debian-kvm rootfs
rootfs-debian-kvm-bookworm-arm: &rootfs-debian-kvm-bookworm-arm https://storage.tuxboot.com/debian-kvm/bookworm/armhf/rootfs.ext4.xz
rootfs-debian-kvm-bookworm-arm64: &rootfs-debian-kvm-bookworm-arm64 https://storage.tuxboot.com/debian-kvm/bookworm/arm64/rootfs.ext4.xz
rootfs-debian-kvm-bookworm-arm64-tar: &rootfs-debian-kvm-bookworm-arm64-tar https://storage.tuxboot.com/debian-kvm/bookworm/arm64/rootfs.tar.xz
rootfs-debian-kvm-bookworm-i386: &rootfs-debian-kvm-bookworm-i386 https://storage.tuxboot.com/debian-kvm/bookworm/i386/rootfs.ext4.xz
rootfs-debian-kvm-bookworm-x86_64: &rootfs-debian-kvm-bookworm-x86_64 https://storage.tuxboot.com/debian-kvm/bookworm/amd64/rootfs.ext4.xz
rootfs-debian-kvm-trixie-arm: &rootfs-debian-kvm-trixie-arm https://storage.tuxboot.com/debian-kvm/trixie/armhf/rootfs.ext4.xz
rootfs-debian-kvm-trixie-arm64: &rootfs-debian-kvm-trixie-arm64 https://storage.tuxboot.com/debian-kvm/trixie/arm64/rootfs.ext4.xz
rootfs-debian-kvm-trixie-arm64-tar: &rootfs-debian-kvm-trixie-arm64-tar https://storage.tuxboot.com/debian-kvm/trixie/arm64/rootfs.tar.xz
rootfs-debian-kvm-trixie-i386: &rootfs-debian-kvm-trixie-i386 https://storage.tuxboot.com/debian-kvm/trixie/i386/rootfs.ext4.xz
rootfs-debian-kvm-trixie-x86_64: &rootfs-debian-kvm-trixie-x86_64 https://storage.tuxboot.com/debian-kvm/trixie/amd64/rootfs.ext4.xz

# debian-xfstests rootfs
rootfs-debian-xfstests-bookworm-arm64: &rootfs-debian-xfstests-bookworm-arm64 https://storage.tuxboot.com/debian-xfstests/bookworm/arm64/rootfs.ext4.xz
rootfs-debian-xfstests-bookworm-arm64-tar: &rootfs-debian-xfstests-bookworm-arm64-tar https://storage.tuxboot.com/debian-xfstests/bookworm/arm64/rootfs.tar.xz
rootfs-debian-xfstests-bookworm-x86_64: &rootfs-debian-xfstests-bookworm-x86_64 https://storage.tuxboot.com/debian-xfstests/bookworm/amd64/rootfs.ext4.xz

rootfs-debian-xfstests-trixie-arm64: &rootfs-debian-xfstests-trixie-arm64 https://storage.tuxboot.com/debian-xfstests/trixie/arm64/rootfs.ext4.xz
rootfs-debian-xfstests-trixie-arm64-tar: &rootfs-debian-xfstests-trixie-arm64-tar https://storage.tuxboot.com/debian-xfstests/trixie/arm64/rootfs.tar.xz
rootfs-debian-xfstests-trixie-x86_64: &rootfs-debian-xfstests-trixie-x86_64 https://storage.tuxboot.com/debian-xfstests/trixie/amd64/rootfs.ext4.xz

# Overlays
kvm-unit-tests-debian-bookworm-arm: &kvm-unit-tests-debian-bookworm-arm https://storage.tuxboot.com/overlays/debian/bookworm/armhf/kvm-unit-tests/master/kvm-unit-tests.tar.xz
kvm-unit-tests-debian-bookworm-arm64: &kvm-unit-tests-debian-bookworm-arm64 https://storage.dev.tuxboot.com/overlays/debian/bookworm/arm64/kvm-unit-tests/master/kvm-unit-tests.tar.xz
kvm-unit-tests-debian-bookworm-i386: &kvm-unit-tests-debian-bookworm-i386 https://storage.tuxboot.com/overlays/debian/bookworm/i386/kvm-unit-tests/master/kvm-unit-tests.tar.xz
kvm-unit-tests-debian-bookworm-x86_64: &kvm-unit-tests-debian-bookworm-x86_64 https://storage.tuxboot.com/overlays/debian/bookworm/amd64/kvm-unit-tests/master/kvm-unit-tests.tar.xz
kvm-unit-tests-debian-trixie-arm: &kvm-unit-tests-debian-trixie-arm https://storage.tuxboot.com/overlays/debian/trixie/armhf/20240216/kvm-unit-tests/master/kvm-unit-tests.tar.xz
kvm-unit-tests-debian-trixie-arm64: &kvm-unit-tests-debian-trixie-arm64 https://storage.dev.tuxboot.com/overlays/debian/trixie/arm64/20240216/kvm-unit-tests/master/kvm-unit-tests.tar.xz
kvm-unit-tests-debian-trixie-i386: &kvm-unit-tests-debian-trixie-i386 https://storage.tuxboot.com/overlays/debian/trixie/i386/20240216/kvm-unit-tests/master/kvm-unit-tests.tar.xz
kvm-unit-tests-debian-trixie-x86_64: &kvm-unit-tests-debian-trixie-x86_64 https://storage.tuxboot.com/overlays/debian/trixie/amd64/20240216/kvm-unit-tests/master/kvm-unit-tests.tar.xz


libgpiod-debian-bookworm-arm: &libgpiod-debian-bookworm-arm https://storage.tuxboot.com/overlays/debian/bookworm/armhf/libgpiod/v2.0.1/libgpiod.tar.xz
libgpiod-debian-bookworm-arm64: &libgpiod-debian-bookworm-arm64 https://storage.dev.tuxboot.com/overlays/debian/bookworm/arm64/libgpiod/v2.0.1/libgpiod.tar.xz
libgpiod-debian-bookworm-i386: &libgpiod-debian-bookworm-i386 https://storage.tuxboot.com/overlays/debian/bookworm/i386/libgpiod/v2.0.1/libgpiod.tar.xz
libgpiod-debian-bookworm-x86_64: &libgpiod-debian-bookworm-x86_64 https://storage.tuxboot.com/overlays/debian/bookworm/amd64/libgpiod/v2.0.1/libgpiod.tar.xz
libgpiod-debian-trixie-arm: &libgpiod-debian-trixie-arm https://storage.tuxboot.com/overlays/debian/trixie/armhf/libgpiod/v2.1/libgpiod.tar.xz
libgpiod-debian-trixie-arm64: &libgpiod-debian-trixie-arm64 https://storage.dev.tuxboot.com/overlays/debian/trixie/arm64/libgpiod/v2.1/libgpiod.tar.xz
libgpiod-debian-trixie-i386: &libgpiod-debian-trixie-i386 https://storage.tuxboot.com/overlays/debian/trixie/i386/libgpiod/v2.1/libgpiod.tar.xz
libgpiod-debian-trixie-x86_64: &libgpiod-debian-trixie-x86_64 https://storage.tuxboot.com/overlays/debian/trixie/amd64/libgpiod/v2.1/libgpiod.tar.xz
libgpiod-debian-sid-riscv64: &libgpiod-debian-sid-riscv64 https://storage.tuxboot.com/overlays/debian/sid/riscv64/libgpiod/v2.1/libgpiod.tar.xz


ltp-debian-bookworm-arm: &ltp-debian-bookworm-arm https://storage.tuxboot.com/overlays/debian/bookworm/armhf/ltp/20240129/ltp.tar.xz
ltp-debian-bookworm-arm64: &ltp-debian-bookworm-arm64 https://storage.tuxboot.com/overlays/debian/bookworm/arm64/ltp/20230129/ltp.tar.xz
ltp-debian-bookworm-i386: &ltp-debian-bookworm-i386 https://storage.tuxboot.com/overlays/debian/bookworm/i386/ltp/20230129/ltp.tar.xz
ltp-debian-bookworm-x86_64: &ltp-debian-bookworm-x86_64 https://storage.tuxboot.com/overlays/debian/bookworm/amd64/ltp/20230129/ltp.tar.xz
ltp-debian-trixie-arm: &ltp-debian-trixie-arm https://storage.tuxboot.com/overlays/debian/trixie/armhf/ltp/20240524/ltp.tar.xz
ltp-debian-trixie-arm64: &ltp-debian-trixie-arm64 https://storage.tuxboot.com/overlays/debian/trixie/arm64/ltp/20240524/ltp.tar.xz
ltp-debian-trixie-i386: &ltp-debian-trixie-i386 https://storage.tuxboot.com/overlays/debian/trixie/i386/ltp/20240524/ltp.tar.xz
ltp-debian-trixie-x86_64: &ltp-debian-trixie-x86_64 https://storage.tuxboot.com/overlays/debian/trixie/amd64/ltp/20240524/ltp.tar.xz
ltp-debian-sid-riscv64: &ltp-debian-sid-riscv64 https://storage.tuxboot.com/overlays/debian/sid/riscv64/ltp/20240524/ltp.tar.xz


xfstests-debian-trixie-arm64: &xfstests-debian-trixie-arm64 https://storage.tuxboot.com/overlays/debian/trixie/arm64/xfstests/master/xfstests.tar.xz
xfstests-debian-trixie-x86_64: &xfstests-debian-trixie-x86_64 https://storage.tuxboot.com/overlays/debian/trixie/amd64/xfstests/master/xfstests.tar.xz


boot-timeout-arm: &boot-timeout-arm 30
boot-timeout-arm64: &boot-timeout-arm64 30
boot-timeout-fvp: &boot-timeout-fvp 60
boot-timeout-i386: &boot-timeout-i386 15
boot-timeout-x86: &boot-timeout-x86 15

kselftest-timeout: &kselftest-timeout 20
kselftest-arm64-timeout: &kselftest-arm64-timeout 60
kselftest-ftrace-timeout: &kselftest-ftrace-timeout 40
kselftest-memfd-timeout: &kselftest-memfd-timeout 30
kselftest-net-timeout: &kselftest-net-timeout 30
kselftest-tc-testing-timeout: &kselftest-tc-testing-timeout 20

kvm-unit-tests-timeout: &kvm-unit-tests-timeout 60
kvm-unit-tests-timeout-fvp: &kvm-unit-tests-timeout-fvp 160

ltp-commands-timeout: &ltp-commands-timeout 40
ltp-containers-timeout: &ltp-containers-timeout 25
ltp-controllers-timeout: &ltp-controllers-timeout 80
ltp-crypto-timeout: &ltp-crypto-timeout 30
ltp-cve-timeout: &ltp-cve-timeout 50
ltp-fs_bind-timeout: &ltp-fs_bind-timeout 40
ltp-fs-timeout: &ltp-fs-timeout 40
ltp-fs_perms_simple-timeout: &ltp-fs_perms_simple-timeout 10
ltp-fsx-timeout: &ltp-fsx-timeout 10
ltp-hugetlb-timeout: &ltp-hugetlb-timeout 20
ltp-math-timeout: &ltp-math-timeout 50
ltp-mm-timeout: &ltp-mm-timeout 40
ltp-pty-timeout: &ltp-pty-timeout 10
ltp-sched-timeout: &ltp-sched-timeout 30
ltp-syscalls-timeout: &ltp-syscalls-timeout 50
ltp-tracing-timeout: &ltp-tracing-timeout 30
ltp-smoke-timeout: &ltp-smoke-timeout 15

perf-timeout: &perf-timeout 60

version: 1
name: full kernel validation for the master branch.
description: Build and test linux kernel with every toolchain
jobs:
# arm
- name: arm-lkftconfig-tests
  builds:
    - build_name: clang-18-lkftconfig
      target_arch: arm
      toolchain: clang-18
      make_variables:
        LLVM: 1
        LLVM_IAS: 0
      kconfig: [ defconfig, *frag-lkft-base, *frag-lkft-crypto, *frag-lkft-distro, *frag-lkft-netdev, *frag-lkft-systemd, *frag-lkft-virtio, CONFIG_ARM_TI_CPUFREQ=y, CONFIG_SERIAL_8250_OMAP=y, CONFIG_POSIX_MQUEUE=y, CONFIG_OF=y, CONFIG_SYN_COOKIES=y, CONFIG_SCHEDSTATS=y, CONFIG_KFENCE=n ]
    - build_name: gcc-12-lkftconfig
      target_arch: arm
      toolchain: gcc-12
      kconfig: [ defconfig, *frag-lkft-base, *frag-lkft-crypto, *frag-lkft-distro, *frag-lkft-netdev, *frag-lkft-systemd, *frag-lkft-virtio, CONFIG_ARM_TI_CPUFREQ=y, CONFIG_SERIAL_8250_OMAP=y, CONFIG_POSIX_MQUEUE=y, CONFIG_OF=y, CONFIG_SYN_COOKIES=y, CONFIG_SCHEDSTATS=y, CONFIG_KFENCE=n ]
  sanity_test:
      device: qemu-armv7
      boot_args: rw
      parameters: {SKIPFILE: "skipfile-lkft.yaml"}
      rootfs: *rootfs-debian-bookworm-arm
      overlay: [ *ltp-debian-bookworm-arm ]
      tests: [ltp-smoke]
      timeouts: { "boot": *boot-timeout-arm, "ltp-smoke": *ltp-smoke-timeout }
  tests:
    - device: qemu-armv7
      boot_args: rw
      parameters: {SKIPFILE: "skipfile-lkft.yaml", MODULES_PATH:  "/usr/"}
      rootfs: *rootfs-debian-trixie-arm
      overlay: [ *ltp-debian-trixie-arm ]
      sharding: 4
      tests: [ltp-commands]
      timeouts: { "boot": *boot-timeout-arm, "ltp-commands": *ltp-commands-timeout }
    - device: qemu-armv7
      boot_args: rw
      parameters: {SKIPFILE: "skipfile-lkft.yaml", MODULES_PATH:  "/usr/"}
      rootfs: *rootfs-debian-trixie-arm
      overlay: [ *ltp-debian-trixie-arm ]
      tests: [ltp-math]
      sharding: 4
      timeouts: { "boot": *boot-timeout-arm, "ltp-math": *ltp-math-timeout }
    - device: x15
      boot_args: rw
      dtb: am57xx-beagle-x15.dtb
      parameters: {SKIPFILE: "skipfile-lkft.yaml", MODULES_PATH:  "/usr/", OVERLAY_URL: *ltp-debian-trixie-arm, DEPLOY_OS: "debian", LAVA_JOB_PRIORITY: *lava-job-priority, LAVA_QUEUE_TIMEOUT: *lava-queue-timeout}
      rootfs: *rootfs-debian-trixie-arm
      overlay: [ *ltp-debian-trixie-arm ]
      tests: [ltp-math]
      timeouts: { "boot": *boot-timeout-arm }
# arm64
- name: arm64-lkftconfig-tests
  builds:
    - build_name: clang-18-lkftconfig
      target_arch: arm64
      toolchain: clang-18
      make_variables:
        LLVM: 1
        LLVM_IAS: 0
      kconfig: [ defconfig, *frag-lkft-base, *frag-lkft-crypto, *frag-lkft-distro, *frag-lkft-netdev, *frag-lkft-systemd, *frag-lkft-virtio, CONFIG_ARM64_MODULE_PLTS=y, CONFIG_SYN_COOKIES=y, CONFIG_SCHEDSTATS=y ]
    - build_name: gcc-12-lkftconfig
      target_arch: arm64
      toolchain: gcc-12
      kconfig: [ defconfig, *frag-lkft-base, *frag-lkft-crypto, *frag-lkft-distro, *frag-lkft-systemd, *frag-lkft-virtio, CONFIG_SYN_COOKIES=y, CONFIG_SCHEDSTATS=y ]
  sanity_test:
    - device: qemu-arm64
      boot_args: rw
      parameters: {SKIPFILE: "skipfile-lkft.yaml", cpu.lpa2: "off"}
      rootfs: *rootfs-debian-bookworm-arm64
      overlay: [ *ltp-debian-bookworm-arm64 ]
      tests: [ltp-smoke]
      timeouts: { "boot": *boot-timeout-arm64, "ltp-smoke": *ltp-smoke-timeout }
  tests:
    - device: qemu-arm64
      boot_args: rw
      parameters: {SKIPFILE: "skipfile-lkft.yaml", MODULES_PATH:  "/usr/", cpu.lpa2: "off"}
      rootfs: *rootfs-debian-trixie-arm64
      overlay: [ *ltp-debian-trixie-arm64 ]
      sharding: 4
      tests: [ltp-commands]
      timeouts: { "boot": *boot-timeout-arm64, "ltp-commands": *ltp-commands-timeout }
    - device: qemu-arm64
      boot_args: rw
      parameters: {SKIPFILE: "skipfile-lkft.yaml", MODULES_PATH:  "/usr/", cpu.lpa2: "off"}
      rootfs: *rootfs-debian-trixie-arm64
      overlay: [ *ltp-debian-trixie-arm64 ]
      tests: [ltp-math]
      timeouts: { "boot": *boot-timeout-arm64, "ltp-math": *ltp-math-timeout }
    - device: dragonboard-410c
      boot_args: rw
      dtb: qcom/apq8016-sbc.dtb
      parameters: {SKIPFILE: "skipfile-lkft.yaml", MODULES_PATH:  "/usr/", OVERLAY_URL: *ltp-debian-trixie-arm64, DEPLOY_OS: "debian", LAVA_JOB_PRIORITY: *lava-job-priority, LAVA_QUEUE_TIMEOUT: *lava-queue-timeout}
      rootfs: *rootfs-debian-trixie-arm64
      overlay: [ *ltp-debian-trixie-arm64 ]
      tests: [ltp-math]
      timeouts: { "boot": *boot-timeout-arm64 }
