#!/usr/bin/env bats setup() { REPO_ROOT="$(cd "${BATS_TEST_DIRNAME}/.." && pwd)" } @test "Rhino only advertises Lomiri where a matching image exists" { run bash -c ' . "$1/templates/rhino-linux" RELEASE=2025.4 printf "old:%s\n" "$(editions_)" RELEASE=2026.1 printf "current:%s\n" "$(editions_)" unset RELEASE printf "all:%s\n" "$(editions_)" if output=$(RELEASE=2025.4 EDITION=lomiri ARCH=amd64 get_ 2>&1); then exit 1 fi [ -z "${output}" ] ' _ "${REPO_ROOT}" [ "${status}" -eq 0 ] [ "${output}" = $'old:unicorn\ncurrent:unicorn lomiri\nall:unicorn lomiri' ] } @test "Siduction resolves the current release, edition, image, and checksum" { run bash -c ' web_pipe() { case "$1" in https://mirror.math.princeton.edu/pub/siduction/iso/) printf "%s\n" "Parent" "Big_Crime/";; */iso/Big_Crime/) printf "%s\n" "Parent" "xorg/" "lxqt/" "image" "old image";; */iso/Big_Crime/xorg/) echo "image";; *.sha256) printf "%064d siduction-2026.1.0-Big_Crime-xorg-amd64-202610181325.iso\n" 0;; esac } . "$1/templates/siduction" RELEASE=$(releases_ | head -n 1) printf "release=%s\n" "${RELEASE}" printf "%s\n" "$(editions_)" EDITION=xorg get_ ' _ "${REPO_ROOT}" [ "${status}" -eq 0 ] [ "${lines[0]}" = "release=Big_Crime" ] [ "${lines[1]}" = "xorg" ] [[ "${lines[2]}" == "https://mirror.math.princeton.edu/pub/siduction/iso/Big_Crime/xorg/siduction-2026.1.0-Big_Crime-xorg-amd64-202610181325.iso "* ]] [[ "${lines[2]##* }" =~ ^[[:xdigit:]]{64}$ ]] } @test "PCLinuxOS uses the upstream case-sensitive edition names" { run bash -c ' web_pipe() { case "$1" in *XFCE*) printf "%032d pclinuxos64-XFCE-2026.10.iso\n" 0;; *MATE*) printf "%032d pclinuxos64-MATE-2026.10.iso\n" 0;; esac } . "$1/templates/pclinuxos" RELEASE=2026.10 EDITION=xfce get_ EDITION=mate get_ ' _ "${REPO_ROOT}" [ "${status}" -eq 0 ] [[ "${lines[0]}" == "https://ftp.fau.de/pclinuxos/iso/pclinuxos64-XFCE-2026.10.iso "* ]] [[ "${lines[1]}" == "https://ftp.fau.de/pclinuxos/iso/pclinuxos64-MATE-2026.10.iso "* ]] [[ "${lines[0]##* }" =~ ^[[:xdigit:]]{32}$ ]] [[ "${lines[1]##* }" =~ ^[[:xdigit:]]{32}$ ]] } @test "Talos normalizes prerelease tags and tolerates missing release assets" { run bash -c ' atom_feed_iso_entries() { printf "%s\\t%s\\n" "1.15.0-alpha2" "https://github.com/siderolabs/talos/releases/download/v1.15.0-alpha.2/metal-amd64.iso" } web_pipe_json() { printf "{\"assets\":null}\\n" } . "$1/templates/talos-linux" RSS= DW=https://distrowatch.com/talos printf "release=%s\\n" "$(releases_)" RELEASE=1.15.0-alpha2 ARCH=arm64 get_ ' _ "${REPO_ROOT}" [ "${status}" -eq 0 ] [ "${lines[0]}" = "release=1.15.0-alpha.2" ] [[ "${lines[1]}" == "https://github.com/siderolabs/talos/releases/download/v1.15.0-alpha.2/metal-arm64.iso "* ]] } @test "T4n OS editions and checksums follow files published in its feed" { run bash -c ' web_pipe() { case "$1" in *t4n-os/rss*) printf "%s\n" \ "