Skip to content

Commit 2735e8d

Browse files
committed
test(*sum): test IOerror handling in checkfile
1 parent ce978a3 commit 2735e8d

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

tests/by-util/test_cksum.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
5-
// spell-checker:ignore (words) asdf algo algos asha mgmt xffname hexa GFYEQ HYQK Yqxb dont
5+
// spell-checker:ignore (words) asdf algo algos asha mgmt xffname hexa GFYEQ HYQK Yqxb dont checkfile
66

77
use uutests::at_and_ucmd;
88
use uutests::new_ucmd;
@@ -3060,3 +3060,17 @@ fn test_check_file_with_io_error() {
30603060
.stderr_contains("Input/output error")
30613061
.stdout_contains("FAILED open or read");
30623062
}
3063+
3064+
#[test]
3065+
#[cfg(all(target_os = "linux", not(target_env = "musl")))]
3066+
fn test_check_checkfile_with_io_error() {
3067+
// /proc/self/mem causes EIO when read without proper seeking
3068+
new_ucmd!()
3069+
.arg("-a")
3070+
.arg("md5")
3071+
.arg("--check")
3072+
.arg("/proc/self/mem")
3073+
.fails()
3074+
.stderr_contains("/proc/self/mem: read error")
3075+
.no_stdout();
3076+
}

0 commit comments

Comments
 (0)