Commit Graph
54 Commits
Author SHA1 Message Date
Lorenzo RossiandGitHub cfc6457681 chown: restrict no-dereference symlink ctime test to Linux (#12556) 2026-06-03 17:40:14 +02:00
Nikola LukovicandGitHub 3fbcb79a30 chmod/chown: symlink cycles detection (#11805) 2026-06-01 15:13:58 +02:00
Lorenzo RossiandGitHub ed15a26a6a chown: -h on symlink to directory operates on link, not target (#12522)
closes: #11887
2026-05-30 14:29:58 +02:00
Sylvestre LedruandDaniel Hofstetter f057cc6a01 tests: replace .no_stdout().no_stderr() chains with .no_output()
Bulk rename of the antipattern across 19 test files (136 occurrences).
.no_output() is the established shorthand in the uutests framework
for asserting both empty stdout and empty stderr.
2026-05-12 09:31:31 +02:00
oech3andDaniel Hofstetter 529467d8e5 reduce usage of nix::unistd::geteuid 2026-05-06 11:41:38 +02:00
Eyüp Can AkmanandDaniel Hofstetter f6451c7d20 chown: warn when '.' is used as owner:group separator
When the spec contains '.' but no ':', emit a warning matching GNU
coreutils behavior and re-parse with '.' as separator so both owner
and group are applied.

Closes #11352
2026-03-31 10:29:24 +02:00
oech3andGitHub 2b05f2fa8c Remove duplicated features (#11510) 2026-03-27 09:52:28 +01:00
Adrian Kretz 4a2890a07c test/chown: don't chown if user is in wheel group 2025-10-27 20:36:31 +01:00
Adrian Kretz ce90685e8a test/chown: use wheel group on BSD 2025-10-27 19:35:31 +01:00
Alen AntonyandGitHub 2c9a27c2de Merge pull request #8492 from Anonymous-AAA/fix-chown-reference-file
chown: fix --reference file syntax
2025-09-02 12:30:12 +02:00
Sylvestre Ledru a0179ea239 uutests: adjust the tests to use them 2025-03-28 21:40:31 +01:00
Sylvestre Ledru a85539f530 Run cargo fmt on the tree 2025-03-24 21:33:12 +01:00
Daniel Hofstetter df4dfea852 tests: replace run() with succeeds() or fails() 2025-03-09 16:53:56 +01:00
Sylvestre Ledru 18cb7dcf9e Use the new function fails_with_code
Done with
```
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs
$ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs
$ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs
...
```
2025-03-01 17:26:20 +01:00
Laurent Cheylus 62ec71d6fa tests: disable failed tests for chown on OpenBSD
Signed-off-by: Laurent Cheylus <foxy@free.fr>
2024-07-06 22:29:12 +02:00
n4n5 ab67947321 fix clippy tests 2024-06-30 16:27:08 +02:00
Daniel HofstetterandBen Wiederhake 29e5d0b42b clippy: fix redundant_clone lint warnings in tests 2024-04-21 01:26:50 +02:00
Sylvestre LedruandGitHub d8f28364f0 Merge pull request #5168 from cakebaker/chown_remove_duplication_in_tests
chown: remove some duplication in tests
2023-08-21 12:22:32 +02:00
Sylvestre Ledru bfca6bf70f Add license headers on all files 2023-08-21 10:49:27 +02:00
Daniel Hofstetter 8b9509a55b chown: remove some duplication in tests 2023-08-18 16:11:11 +02:00
Daniel Hofstetter 29f011e28c Remove users crate 2023-06-04 14:55:16 +02:00
Moïse ValvassoriandGitHub b29f8b011b chown: show "ownership of 'foo' retained" message
* Display a message when the owner is not changed.

* Display a message when the current user/group doesn't match those specified in the `--from` args.

* print messages to stdout

* Show the message "ownership of 'foo' retained as 'bar'" for every path entry when `chown -v -R --from=`

* fix chown tests: test stdout and not stderr

* factorize duplicate code in a function

* Display a message when the owner is not changed.

* Display a message when the current user/group doesn't match those specified in the `--from` args.

* print messages to stdout

* Show the message "ownership of 'foo' retained as 'bar'" for every path entry when `chown -v -R --from=`

* fix chown tests: test stdout and not stderr

* factorize duplicate code in a function

* display the retained ownership details according to the destination ownership.
2023-05-24 09:45:19 +02:00
0130a07579 chown: show message if file doesn't exist
* print the message "failed to change ownership of" when we try to change a non existing file.

* replace the 4-tuple returned by parse_gid_uid_and_filter by GidUidOwnerFilter struct.

* chain the test in one expression.

* chown: remove unused var "result" in test

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
2023-05-21 17:54:32 +02:00
Daniel Hofstetter 7a888da409 tests: remove all "extern crate" statements 2023-04-10 08:31:31 +02:00
Miles Liu 81a4e8fb7d Remove keep_env from the test framework 2023-03-24 14:25:37 +08:00