mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-05 21:07:43 +00:00
test(admin): cover pool used-size saturation (#2863)
This commit is contained in:
@@ -647,6 +647,27 @@ mod tests {
|
||||
assert_eq!(item.status, "active");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn admin_pool_list_item_saturates_used_size_when_current_exceeds_total() {
|
||||
let pool = PoolStatus {
|
||||
id: 0,
|
||||
cmd_line: "pool-0".to_string(),
|
||||
last_update: OffsetDateTime::UNIX_EPOCH,
|
||||
decommission: Some(PoolDecommissionInfo {
|
||||
total_size: 100,
|
||||
current_size: 150,
|
||||
..Default::default()
|
||||
}),
|
||||
};
|
||||
|
||||
let item = DefaultAdminUsecase::pool_list_item_from_status(pool);
|
||||
|
||||
assert_eq!(item.total_size, 100);
|
||||
assert_eq!(item.current_size, 150);
|
||||
assert_eq!(item.used_size, 0);
|
||||
assert_eq!(item.used, 0.0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn admin_pool_list_item_maps_running_decommission_status() {
|
||||
let pool = PoolStatus {
|
||||
|
||||
Reference in New Issue
Block a user