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
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
Anirban Halder
924d40867c
chroot: make group option self overwriting
2025-01-12 01:08:38 +05:30
Daniel Hofstetter
e5e589afd5
chroot: remove short option "-G"
2025-01-02 13:35:19 +01:00
Jeffrey Finkelstein
5bd5cdb7c1
chroot: fix parsing of --userspec argument
...
Fix the parsing of the `--userspec=USER:GROUP` argument so that the
both the user and the group are optional, and update the error message
to match that of GNU `chroot`. This commit also removes the incorrect
`clap` arguments for `--user` and `--group`. In `chroot --user=USER`,
the `--user` is an abbreviation of `--userspec`, and in `chroot
--group=GROUP`, the `--group` is an abbreviation of `--groups`.
Closes #7040 .
2025-01-02 10:26:13 +01:00
Sylvestre Ledru
7d628c65d3
chroot: handle the error when invalid user
...
Currently fails with:
```
2024-12-28T14:55:18.9330231Z thread 'main' panicked at src/uu/chroot/src/chroot.rs:284:46:
2024-12-28T14:55:18.9330718Z called `Result::unwrap()` on an `Err` value: Custom { kind: NotFound, error: "Not found: nobody:+65535" }
2024-12-28T14:55:18.9331305Z note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
2024-12-28 22:29:27 +01:00
Daniel Hofstetter
29e5d0b42b
clippy: fix redundant_clone lint warnings in tests
2024-04-21 01:26:50 +02:00
Sylvestre Ledru
764ea34c37
dd/chroot: improve the skip message (not root)
2023-12-28 00:44:19 +01:00
Sylvestre Ledru
bfca6bf70f
Add license headers on all files
2023-08-21 10:49:27 +02:00
Miles Liu
2bcdae124c
chroot: fix unused import on Android
2023-03-22 12:02:01 +08:00
Daniel Hofstetter
6988eb7ec6
tests: expand wildcard imports
2023-03-20 15:32:35 +01:00
Daniel Hofstetter
3eeb5dda30
tests: adapt to clap's modified error messages
2023-03-09 10:06:20 +01:00
Thayne McCombs
17f9507e17
Add tests for non-utf8
2023-02-21 22:58:39 -07:00
Daniel Hofstetter
f6b646e4e5
clippy: fix warnings introduced with Rust 1.67.0
2023-01-27 17:37:56 +01:00
Joining7943
1fadeb43b2
tests/util: Do not trim stderr in CmdResult::stderr_is. Add method stderr_trimmed_is.
...
Fix tests assert whitespace instead of trimming it. Disable some tests in `test_tr` because `tr`
produces too many newlines.
2023-01-22 14:56:19 +01:00
Sylvestre Ledru
d768b19f2b
chroot: improve support of --skip-chdir
...
Should unbreak tests/misc/chroot-fail.sh
2022-10-10 14:07:45 +02:00
Sylvestre Ledru
3cda177d34
Disable test_preference_of_userspec on android
2022-10-04 17:17:01 +02:00
Sylvestre Ledru
69b52b4a1b
chroot: add a new test to verify that 'chroot / ls -al' works
2022-09-21 19:47:01 +02:00
Sylvestre Ledru
2e26e1d2bd
chroot: implement --skip-chdir
2022-09-21 19:46:58 +02:00
Sylvestre Ledru
3654efe8e7
chroot: add more tests
2022-09-21 14:53:50 +02:00
Terts Diepraam
51bd8a2ba8
chroot: set exit codes to 125, 126 or 127 for errors from chroot itself
2022-09-11 12:02:54 +02:00
Terts Diepraam
9177cb7b24
all: add tests for usage error exit code
2022-09-10 20:59:42 +02:00
Justin Tracey
2a0d58d060
get android builds to compile and pass tests
2022-04-20 08:44:49 +02:00
Jan Scheer
30c8a43788
test_chroot: add comments
2021-09-22 13:53:57 +02:00
Jan Scheer
8db8d8ac4e
chroot: add 'test_default_shell`
2021-09-19 22:21:29 +02:00
Jan Verbeek
259f18fcab
Update message quoting and filename printing
2021-09-07 19:49:01 +02:00
Roy Ivy III
4e20dedf58
tests ~ refactor/polish spelling (comments, names, and exceptions)
2021-05-31 08:23:57 -05:00
Yağız can Değirmenci
071899d24d
tests: delete 'error:' prefix from the tests
2021-05-26 02:45:53 +03:00
Jan Scheer
646c6cacbc
refactor tests ( #1982 )
2021-04-23 02:28:46 +02:00
Gilad Naaman
81d42aa2b3
Fix some tests to not use CmdResult fields
2021-04-10 23:30:50 +03:00
Yagiz Degirmenci
f60790dd41
chroot: move to clap from getopts ( #1792 )
...
+ add tests
2021-03-21 16:18:47 +01:00
Roy Ivy III
1b3bb56e66
tests ~ add missing test_UTIL module files (with 'ToDO' comments)
...
- common_core utils
- additional 'windows' utils
- additional 'unix' utils
2020-06-02 11:25:09 -05:00