#!/usr/bin/env bash # v3 vs v3.1 battle test, tests 7 and 9 (shell: curl + sha256sum). Usage: tests.sh 2026-10-29 18 [dir] # Prints PASS or FAIL for each check and exits 1 if any check FAILs. set -euo pipefail day=$1 hh=$2 dir=${3:-./battle-$day-$hh}; h=${day}T$hh; dl=https://dl.pendulumflow.com mkdir -p "$dir/v3" "$dir/v3.1"; cd "$dir" fails=0 verdict() { if [ "$2" = ok ]; then echo "PASS $1"; else echo "FAIL $1"; fails=$((fails + 1)); fi; } # 7. SHA256SUMS. Each archive's SHA256SUMS.txt lists every file of the hour (paths are relative to v3/ or v3.1/). # v3.1's list has 2 more lines than the manifest's own list: the manifest itself and the verify report, # which the manifest cannot list (a file cannot hold its own checksum). In a typical hour that is 38 and 36. # Expected: every listed file downloads and checks OK, in all three lists. curl -fsS --retry 5 --retry-delay 30 "$dl/v3/SHA256SUMS.txt" | grep " $day/$hh/" > v3/SUMS || true curl -fsS --retry 5 --retry-delay 30 "$dl/v3.1/SHA256SUMS.txt" | grep " $day/$hh/" > v3.1/SUMS || true check() { # check