Commit Graph
49 Commits
Author SHA1 Message Date
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
Daniel Hofstetter 6988eb7ec6 tests: expand wildcard imports 2023-03-20 15:32:35 +01:00
Sylvestre LedruandGitHub 49eb9a2e91 Merge branch 'main' into cp-pathbuf 2023-03-05 16:22:21 +01:00
Thayne McCombs 17f9507e17 Add tests for non-utf8 2023-02-21 22:58:39 -07:00
Joining7943 1c230fd779 tests/util: Refactor UCommand and TestScenario.
Summary of changes in UCommand:
* Extend UCommand by builder methods and simplify methods in TestScenario
* Simplify code structures where possible. Add documentation.
* Store bin_path as PathBuf and util_name as String in all structs
* Remove UCommand::util and make bin_path, temp_dir private
* Rename UCommand::with_limit -> UCommand::limit

Summary of changes in TestScenario:
* Rename some parameters in TestScenario methods to be more descriptive
* Remove ucmd_keepenv, cmd_keepenv from TestScenario. Use UCommand::keep_env instead.
2023-02-18 23:38:20 +01:00
Daniel Hofstetter f6b646e4e5 clippy: fix warnings introduced with Rust 1.67.0 2023-01-27 17:37:56 +01:00