diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index bd81c5f76f2..bafe3e266ab 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -1057,7 +1057,7 @@ fn test_cp_reflink_always_failure_dest_cleanup() { #[test] #[cfg(target_os = "linux")] -fn test_cp_reflink_always_failure() { +fn test_cp_reflink_always_invalid_argument() { let scene = TestScenario::new(util_name!()); scene .ucmd() @@ -1065,12 +1065,22 @@ fn test_cp_reflink_always_failure() { .fails() .no_stdout() .stderr_contains("Invalid argument"); +} + +#[test] +#[cfg(target_os = "linux")] +fn test_cp_reflink_always_cross_device() { + let scene = TestScenario::new(util_name!()); scene .ucmd() .args(&["--reflink=always", "/dev/null", "target"]) .fails() .no_stdout() - .stderr_contains("ross-device link"); // cover both of glibc and musl + .stderr_contains(if cfg!(target_env = "musl") { + "'target': Cross-device link" + } else { + "Invalid cross-device link" + }); } #[test]