diff --git a/.antithesis/client/test-templates/anytime_check_bookie_consistency.sh b/.antithesis/client/test-templates/anytime_check_bookie_consistency.sh new file mode 100755 index 000000000..a996b7ceb --- /dev/null +++ b/.antithesis/client/test-templates/anytime_check_bookie_consistency.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -euo pipefail + +IFS=',' read -ra configs <<< "${CORROSION_CONFIGS:-/tmp/corrosion1.toml,/tmp/corrosion2.toml,/tmp/corrosion3.toml}" +echo "${configs[@]}" + +primary_bin="${BOOKIE_CHECK_PRIMARY_BIN:-corrosion2}" + +check_once() { + local bin="$1" + local config="$2" + + if ! command -v "${bin}" >/dev/null 2>&1; then + return 127 + fi + + if [ ! -f "${config}" ]; then + return 127 + fi + + "${bin}" -c "${config}" sync check-bookie-consistency +} + +for config in "${configs[@]}"; do + if ! check_once "${primary_bin}" "${config}"; then + echo "[bookie-check] consistency check failed: ${primary_bin} -c ${config}" + exit 1 + fi +done + +echo "[bookie-check] consistency check passed"