mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-22 12:26:37 +00:00
test(perf): cover ABBA evidence binding matrix (#5585)
Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -159,33 +159,51 @@ BAD_EVIDENCE_HOOK="${TMP_DIR}/bad-evidence-hook.sh"
|
|||||||
cat >"$BAD_EVIDENCE_HOOK" <<'HOOK'
|
cat >"$BAD_EVIDENCE_HOOK" <<'HOOK'
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cat >"$HOTPATH_ABBA_DEPLOY_EVIDENCE_FILE" <<EOF
|
leg="$HOTPATH_ABBA_LEG"
|
||||||
leg=$HOTPATH_ABBA_LEG
|
phase="$HOTPATH_ABBA_PHASE"
|
||||||
phase=$HOTPATH_ABBA_PHASE
|
bucket="$HOTPATH_ABBA_BUCKET"
|
||||||
bucket=wrong-bucket
|
binary_sha256="$HOTPATH_ABBA_BINARY_SHA256"
|
||||||
binary_sha256=$HOTPATH_ABBA_BINARY_SHA256
|
|
||||||
dataset_reset=true
|
dataset_reset=true
|
||||||
|
|
||||||
|
case "${BAD_EVIDENCE_FIELD:?missing BAD_EVIDENCE_FIELD}" in
|
||||||
|
leg) leg=wrong-leg ;;
|
||||||
|
phase) phase=wrong-phase ;;
|
||||||
|
bucket) bucket=wrong-bucket ;;
|
||||||
|
binary_sha256) binary_sha256=wrong-sha256 ;;
|
||||||
|
dataset_reset) dataset_reset=false ;;
|
||||||
|
*) echo "unknown BAD_EVIDENCE_FIELD=$BAD_EVIDENCE_FIELD" >&2; exit 2 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cat >"$HOTPATH_ABBA_DEPLOY_EVIDENCE_FILE" <<EOF
|
||||||
|
leg=$leg
|
||||||
|
phase=$phase
|
||||||
|
bucket=$bucket
|
||||||
|
binary_sha256=$binary_sha256
|
||||||
|
dataset_reset=$dataset_reset
|
||||||
EOF
|
EOF
|
||||||
HOOK
|
HOOK
|
||||||
chmod +x "$BAD_EVIDENCE_HOOK"
|
chmod +x "$BAD_EVIDENCE_HOOK"
|
||||||
|
|
||||||
if "$RUNNER" \
|
for bad_field in leg phase bucket binary_sha256 dataset_reset; do
|
||||||
--baseline-bin /usr/bin/true \
|
bad_out_dir="${TMP_DIR}/bad-deploy-evidence-${bad_field}"
|
||||||
--candidate-bin /usr/bin/true \
|
if BAD_EVIDENCE_FIELD="$bad_field" "$RUNNER" \
|
||||||
--baseline-revision baseline-test \
|
--baseline-bin /usr/bin/true \
|
||||||
--candidate-revision candidate-test \
|
--candidate-bin /usr/bin/true \
|
||||||
--endpoint 127.0.0.1:9000 \
|
--baseline-revision baseline-test \
|
||||||
--deploy-hook "$BAD_EVIDENCE_HOOK" \
|
--candidate-revision candidate-test \
|
||||||
--warp-bin /usr/bin/true \
|
--endpoint 127.0.0.1:9000 \
|
||||||
--rounds 3 \
|
--deploy-hook "$BAD_EVIDENCE_HOOK" \
|
||||||
--out-dir "${TMP_DIR}/bad-deploy-evidence" >/dev/null 2>&1; then
|
--warp-bin /usr/bin/true \
|
||||||
echo "expected a formal external deploy hook with wrong evidence to fail" >&2
|
--rounds 3 \
|
||||||
exit 1
|
--out-dir "$bad_out_dir" >/dev/null 2>&1; then
|
||||||
fi
|
echo "expected a formal external deploy hook with wrong $bad_field evidence to fail" >&2
|
||||||
rg -qx 'external=true' "${TMP_DIR}/bad-deploy-evidence/manifest.env"
|
exit 1
|
||||||
rg -qx 'external_isolation=deploy-hook-attested' "${TMP_DIR}/bad-deploy-evidence/manifest.env"
|
fi
|
||||||
rg -qx 'evidence_mode=external-deploy-hook-attested' "${TMP_DIR}/bad-deploy-evidence/manifest.env"
|
rg -qx 'external=true' "$bad_out_dir/manifest.env"
|
||||||
rg -qx 'formal_evidence=true' "${TMP_DIR}/bad-deploy-evidence/manifest.env"
|
rg -qx 'external_isolation=deploy-hook-attested' "$bad_out_dir/manifest.env"
|
||||||
rg -qx 'performance_conclusion=not_claimed_gate_and_artifacts_required' "${TMP_DIR}/bad-deploy-evidence/manifest.env"
|
rg -qx 'evidence_mode=external-deploy-hook-attested' "$bad_out_dir/manifest.env"
|
||||||
|
rg -qx 'formal_evidence=true' "$bad_out_dir/manifest.env"
|
||||||
|
rg -qx 'performance_conclusion=not_claimed_gate_and_artifacts_required' "$bad_out_dir/manifest.env"
|
||||||
|
done
|
||||||
|
|
||||||
echo "hotpath warp ABBA tests passed"
|
echo "hotpath warp ABBA tests passed"
|
||||||
|
|||||||
Reference in New Issue
Block a user