()
| 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 | } |
nothing calls this directly
no test coverage detected