mirror of
https://github.com/rustfs/rustfs.git
synced 2026-09-06 20:19:14 +00:00
test(startup): encode observation digests with shared hex helper
This commit is contained in:
@@ -399,7 +399,7 @@ mod tests {
|
||||
}
|
||||
hash.update(&buf[..len]);
|
||||
}
|
||||
Ok(format!("{:x}", hash.finalize()))
|
||||
Ok(rustfs_utils::crypto::hex(hash.finalize()))
|
||||
}
|
||||
|
||||
fn startup_cas_git(args: &[&str]) -> std::io::Result<String> {
|
||||
|
||||
@@ -5519,7 +5519,7 @@ where
|
||||
let observation = std::env::var_os("RUSTFS_E2E_STARTUP_CAS_NONCE").map(|_| {
|
||||
serde_json::json!({
|
||||
"kind": "cas", "object": object, "phase": phase,
|
||||
"payload_sha256": format!("{:x}", Sha256::digest(&data)),
|
||||
"payload_sha256": rustfs_utils::crypto::hex(Sha256::digest(&data)),
|
||||
"if_match": opts.http_preconditions.as_ref().and_then(|p| p.if_match.as_deref()),
|
||||
"if_none_match": opts.http_preconditions.as_ref().and_then(|p| p.if_none_match.as_deref()),
|
||||
"tail_drained": opts.write_completion == crate::object_api::WriteCompletion::TailDrained,
|
||||
@@ -6843,7 +6843,7 @@ impl PoolMeta {
|
||||
#[cfg(feature = "e2e-test-hooks")]
|
||||
startup_cas_test_observe(serde_json::json!({
|
||||
"kind": "confirmed", "object": POOL_META_NAME,
|
||||
"payload_sha256": format!("{:x}", Sha256::digest(&durable)),
|
||||
"payload_sha256": rustfs_utils::crypto::hex(Sha256::digest(&durable)),
|
||||
"generation": confirmed.revision.generation,
|
||||
"transaction_id": confirmed.revision.transaction_id,
|
||||
}));
|
||||
|
||||
@@ -56,7 +56,7 @@ fn startup_cas_rename_observation(
|
||||
"target": match target { LocalMutationTarget::Ready(_) => "ready", LocalMutationTarget::Bootstrap(_) => "bootstrap", LocalMutationTarget::Unbound => "unbound" },
|
||||
"disk": request.disk, "src_volume": request.src_volume, "src_path": request.src_path,
|
||||
"dst_volume": request.dst_volume, "dst_path": request.dst_path,
|
||||
"body_sha256": format!("{:x}", Sha256::digest(body)),
|
||||
"body_sha256": rustfs_utils::crypto::hex(Sha256::digest(body)),
|
||||
"etag": file_info.metadata.get("etag"),
|
||||
"mod_time": file_info.mod_time.map(|time| time.unix_timestamp_nanos().to_string()),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user