Repository navigation
mknod: test FIFO umask and existing-file handling - #16348
mattsu2020 wants to merge 3 commits into
Conversation
| ts.ucmd() | ||
| .args(&["test_file", "p"]) | ||
| .fails() | ||
| .stderr_contains("File exists"); |
There was a problem hiding this comment.
What is the reason you cannot use .stderr_is? (I don't ask to fix at here.)
There was a problem hiding this comment.
It looks like using libc::EEXIST could make the code cleaner.
There was a problem hiding this comment.
But it contains (os error ... too. No?
There was a problem hiding this comment.
coreutils/src/uu/mknod/src/mknod.rs
Lines 121 to 128 in aa68999
I think it's fine because the implementation uses io::Error::from(err).
c79327f to
d9aca1e
Compare
| } | ||
|
|
||
| #[test] | ||
| fn test_mknod_fifo_umask() { |
There was a problem hiding this comment.
this is already covered by test_mknod_fifo_with_umask and test_mknod_fifo_with_mode_and_umask, no?
please remove it or extend those
| .args(&["test_file", "p"]) | ||
| .fails() | ||
| .stderr_is(format!( | ||
| "{} mknod: {}\n", |
There was a problem hiding this comment.
this locks in a bad message: no file name and a trailing "(os error 17)"
GNU shows "mknod: test_file: File exists", could you please fix mknod and test that instead?
e10d467 to
87877c8
Compare
Add FIFO tests for umask handling with and without
-m, and check that a failed creation leaves an existing file unchanged.Related to #8342. Split from #12321 following #12321 (comment).