Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Concelier Attestation Tests / attestation-tests (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
console-runner-image / build-runner-image (push) Has been cancelled
wine-csp-build / Build Wine CSP Image (push) Has been cancelled
wine-csp-build / Integration Tests (push) Has been cancelled
wine-csp-build / Security Scan (push) Has been cancelled
wine-csp-build / Generate SBOM (push) Has been cancelled
wine-csp-build / Publish Image (push) Has been cancelled
wine-csp-build / Air-Gap Bundle (push) Has been cancelled
wine-csp-build / Test Summary (push) Has been cancelled
- Added BerkeleyDbReader class to read and extract RPM header blobs from BerkeleyDB hash databases. - Implemented methods to detect BerkeleyDB format and extract values, including handling of page sizes and magic numbers. - Added tests for BerkeleyDbReader to ensure correct functionality and header extraction. feat: Add Yarn PnP data tests - Created YarnPnpDataTests to validate package resolution and data loading from Yarn PnP cache. - Implemented tests for resolved keys, package presence, and loading from cache structure. test: Add egg-info package fixtures for Python tests - Created egg-info package fixtures for testing Python analyzers. - Included PKG-INFO, entry_points.txt, and installed-files.txt for comprehensive coverage. test: Enhance RPM database reader tests - Added tests for RpmDatabaseReader to validate fallback to legacy packages when SQLite is missing. - Implemented helper methods to create legacy package files and RPM headers for testing. test: Implement dual signing tests - Added DualSignTests to validate secondary signature addition when configured. - Created stub implementations for crypto providers and key resolvers to facilitate testing. chore: Update CI script for Playwright Chromium installation - Modified ci-console-exports.sh to ensure deterministic Chromium binary installation for console exports tests. - Added checks for Windows compatibility and environment variable setups for Playwright browsers.
91 lines
2.8 KiB
Bash
91 lines
2.8 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Validates the store-aoc-19-005 dataset tarball.
|
|
# Usage: ./scripts/concelier/test-store-aoc-19-005-dataset.sh [tarball]
|
|
|
|
command -v tar >/dev/null || { echo "tar is required" >&2; exit 1; }
|
|
command -v sha256sum >/dev/null || { echo "sha256sum is required" >&2; exit 1; }
|
|
command -v python >/dev/null || { echo "python is required" >&2; exit 1; }
|
|
|
|
DATASET="${1:-out/linksets/linksets-stage-backfill.tar.zst}"
|
|
|
|
if [[ ! -f "${DATASET}" ]]; then
|
|
echo "Dataset not found: ${DATASET}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
WORKDIR="$(mktemp -d)"
|
|
cleanup() { rm -rf "${WORKDIR}"; }
|
|
trap cleanup EXIT
|
|
|
|
tar -xf "${DATASET}" -C "${WORKDIR}"
|
|
|
|
for required in linksets.ndjson advisory_chunks.ndjson manifest.json; do
|
|
if [[ ! -f "${WORKDIR}/${required}" ]]; then
|
|
echo "Missing ${required} in dataset" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
manifest="${WORKDIR}/manifest.json"
|
|
expected_linksets=$(python - <<'PY' "${manifest}"
|
|
import json, sys
|
|
with open(sys.argv[1], "r", encoding="utf-8") as f:
|
|
data = json.load(f)
|
|
print(data["records"]["linksets"])
|
|
PY
|
|
)
|
|
expected_chunks=$(python - <<'PY' "${manifest}"
|
|
import json, sys
|
|
with open(sys.argv[1], "r", encoding="utf-8") as f:
|
|
data = json.load(f)
|
|
print(data["records"]["advisory_chunks"])
|
|
PY
|
|
)
|
|
expected_linksets_sha=$(python - <<'PY' "${manifest}"
|
|
import json, sys
|
|
with open(sys.argv[1], "r", encoding="utf-8") as f:
|
|
data = json.load(f)
|
|
print(data["sha256"]["linksets.ndjson"])
|
|
PY
|
|
)
|
|
expected_chunks_sha=$(python - <<'PY' "${manifest}"
|
|
import json, sys
|
|
with open(sys.argv[1], "r", encoding="utf-8") as f:
|
|
data = json.load(f)
|
|
print(data["sha256"]["advisory_chunks.ndjson"])
|
|
PY
|
|
)
|
|
|
|
actual_linksets=$(wc -l < "${WORKDIR}/linksets.ndjson" | tr -d '[:space:]')
|
|
actual_chunks=$(wc -l < "${WORKDIR}/advisory_chunks.ndjson" | tr -d '[:space:]')
|
|
actual_linksets_sha=$(sha256sum "${WORKDIR}/linksets.ndjson" | awk '{print $1}')
|
|
actual_chunks_sha=$(sha256sum "${WORKDIR}/advisory_chunks.ndjson" | awk '{print $1}')
|
|
|
|
if [[ "${expected_linksets}" != "${actual_linksets}" ]]; then
|
|
echo "linksets count mismatch: expected ${expected_linksets}, got ${actual_linksets}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${expected_chunks}" != "${actual_chunks}" ]]; then
|
|
echo "advisory_chunks count mismatch: expected ${expected_chunks}, got ${actual_chunks}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${expected_linksets_sha}" != "${actual_linksets_sha}" ]]; then
|
|
echo "linksets sha mismatch: expected ${expected_linksets_sha}, got ${actual_linksets_sha}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${expected_chunks_sha}" != "${actual_chunks_sha}" ]]; then
|
|
echo "advisory_chunks sha mismatch: expected ${expected_chunks_sha}, got ${actual_chunks_sha}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "Dataset validation succeeded:"
|
|
echo " linksets: ${actual_linksets}"
|
|
echo " advisory_chunks: ${actual_chunks}"
|
|
echo " linksets.sha256=${actual_linksets_sha}"
|
|
echo " advisory_chunks.sha256=${actual_chunks_sha}"
|