diff --git a/crates/ecstore/src/error.rs b/crates/ecstore/src/error.rs index 504f33570..e20d1e6be 100644 --- a/crates/ecstore/src/error.rs +++ b/crates/ecstore/src/error.rs @@ -1036,6 +1036,28 @@ mod tests { assert!(!is_err_not_initialized(&StorageError::DecommissionAlreadyRunning)); } + #[test] + fn test_classify_system_path_failure_reason() { + assert_eq!(classify_system_path_failure_reason(&StorageError::ConfigNotFound), "config_not_found"); + assert_eq!(classify_system_path_failure_reason(&StorageError::ErasureReadQuorum), "read_quorum"); + assert_eq!( + classify_system_path_failure_reason(&StorageError::InsufficientReadQuorum( + "bucket".to_string(), + "object".to_string() + )), + "read_quorum" + ); + assert_eq!( + classify_system_path_failure_reason(&StorageError::Io(IoError::new(ErrorKind::TimedOut, "probe"))), + "timeout" + ); + assert_eq!( + classify_system_path_failure_reason(&StorageError::Io(IoError::new(ErrorKind::PermissionDenied, "probe"))), + "io" + ); + assert_eq!(classify_system_path_failure_reason(&StorageError::DiskFull), "other"); + } + #[test] fn test_storage_error_from_disk_error() { // Test conversion from DiskError