(pgdata_archive: &Path)
| 5687 | } |
| 5688 | |
| 5689 | fn verify_pgdata_template_hash(pgdata_archive: &Path) -> Result<()> { |
| 5690 | let manifest_path = Path::new(GENERATED_ASSETS_DIR).join("prepopulated/pgdata-template.json"); |
| 5691 | ensure!( |
| 5692 | manifest_path.exists() && pgdata_archive.exists(), |
| 5693 | "generated assets must include the bundled PGDATA template required by the default runtime; expected both {} and {}", |
| 5694 | manifest_path.display(), |
| 5695 | pgdata_archive.display() |
| 5696 | ); |
| 5697 | let text = fs::read_to_string(&manifest_path) |
| 5698 | .with_context(|| format!("read {}", manifest_path.display()))?; |
| 5699 | let manifest: serde_json::Value = serde_json::from_str(&text) |
| 5700 | .with_context(|| format!("parse {}", manifest_path.display()))?; |
| 5701 | let expected = manifest |
| 5702 | .get("archiveSha256") |
| 5703 | .and_then(serde_json::Value::as_str) |
| 5704 | .ok_or_else(|| anyhow!("{} is missing archiveSha256", manifest_path.display()))?; |
| 5705 | verify_file_sha256(pgdata_archive, expected, "PGDATA template archive")?; |
| 5706 | Ok(()) |
| 5707 | } |
| 5708 | |
| 5709 | fn verify_root_asset_metadata( |
| 5710 | manifest: &AssetManifestOut, |
no test coverage detected