MCPcopy Create free account
hub / github.com/bootc-dev/bootc / test_check_disk_space_inner

Function test_check_disk_space_inner

crates/lib/src/deploy.rs:1510–1528  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1508 }
1509 #[test]
1510 fn test_check_disk_space_inner() -> Result<()> {
1511 let td = cap_std_ext::cap_tempfile::TempDir::new(cap_std::ambient_authority())?;
1512 let imgref = ImageReference {
1513 image: "quay.io/exampleos/exampleos:latest".into(),
1514 transport: "registry".into(),
1515 signature: None,
1516 };
1517
1518 // 0 bytes needed always passes
1519 check_disk_space_inner(&*td, 0, 0, &imgref)?;
1520
1521 // u64::MAX bytes needed always fails
1522 assert!(check_disk_space_inner(&*td, u64::MAX, 0, &imgref).is_err());
1523
1524 // With min_free consuming all usable space, even a tiny fetch fails
1525 assert!(check_disk_space_inner(&*td, 1, u64::MAX, &imgref).is_err());
1526
1527 Ok(())
1528 }
1529}

Callers

nothing calls this directly

Calls 2

check_disk_space_innerFunction · 0.85
intoMethod · 0.45

Tested by

no test coverage detected