mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-31 09:18:28 +00:00
test(ecstore): cover system path failure classifier (#2874)
This commit is contained in:
@@ -1036,6 +1036,28 @@ mod tests {
|
|||||||
assert!(!is_err_not_initialized(&StorageError::DecommissionAlreadyRunning));
|
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]
|
#[test]
|
||||||
fn test_storage_error_from_disk_error() {
|
fn test_storage_error_from_disk_error() {
|
||||||
// Test conversion from DiskError
|
// Test conversion from DiskError
|
||||||
|
|||||||
Reference in New Issue
Block a user