From ad99850aa9bdf9270c40a2d4c26ed0bc4b6c0778 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Mon, 14 Sep 2026 13:56:39 +0900 Subject: [PATCH] test_install.rs: add test case for eCryptfs --- tests/by-util/test_install.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/by-util/test_install.rs b/tests/by-util/test_install.rs index 4d17d58d21..c50d62efe9 100644 --- a/tests/by-util/test_install.rs +++ b/tests/by-util/test_install.rs @@ -3161,3 +3161,31 @@ fn test_install_d_parallel_mkdir_race() { } } } + +#[test] +#[cfg(target_os = "linux")] +fn test_install_target_without_splice_support() { + // Does eCryptfs not support splice on some kernel? + use std::process::Command; + if Command::new("strace") + .args(["-e", "inject=splice:error=EINVAL:when=2", "true"]) + .output() + .is_err() + { + return; // missing strace + } + let coreutils = uutests::util::get_tests_binary(); + Command::new("strace") + .args([ + "-e", + "inject=splice:error=EINVAL:when=2", + coreutils, + "install", + coreutils, + "target_file", + ]) + .output() + .unwrap(); + // properly copied with fallback from splice? + assert!(uucore::fs::are_files_identical(coreutils, "target_file").unwrap()); +}