Commit graph

1106 commits

Author SHA1 Message Date
Jan Scheer 92bc647ac3
Merge branch 'master' into id_selinux_context 2021-07-12 17:30:21 +02:00
Sylvestre Ledru caf984bd55 fix various clippy issues 2021-07-11 11:22:33 +02:00
Sylvestre Ledru 52c6593ef5
Merge pull request #2486 from hbina/hbina-tr-return-err-when-extra-args
`tr` should error out when if user provides more than 2 sets
2021-07-10 20:51:27 +02:00
Jan Scheer 30b80d0c82
tr: fix squeeze and complement with two sets (#2485) 2021-07-09 23:05:00 +02:00
Hanif Bin Ariffin c4c6819dae Reimplemented simply using args
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
2021-07-09 23:51:37 +08:00
Sylvestre Ledru 2177b8dc37
Merge pull request #2481 from Funky185540/fix/test_du_bytes_nondynamic_on_linux
test: du: Skip nondynamic comparison on linux for test_du_bytes
2021-07-09 09:11:52 +02:00
Jan Scheer cf2c712e6b
Merge branch 'master' into id_selinux_context 2021-07-09 00:21:05 +02:00
Jan Scheer 14b348dd4b
tests: fix tests for CICD environment 2021-07-08 11:17:18 +02:00
Jan Scheer d59cd4fc4a
Merge branch 'master' into refactor_expected_result 2021-07-08 00:44:32 +02:00
Jan Scheer d57f474ae1
test_whoami: refactor use expected_result and whoami from common/util.rs 2021-07-08 00:21:28 +02:00
Jan Scheer abc59fbe85
tests/common: refactor: use TestScenario instead of util_name for expected_result() 2021-07-07 22:46:16 +02:00
Jan Scheer 31aa8b2062
test_du: refactor use expected_result from common/util.rs 2021-07-07 22:09:01 +02:00
Jan Scheer 735ec4014e
test_who: refactor use expected_result from common/util.rs 2021-07-07 17:26:59 +02:00
Jan Scheer 805e024794
test_stat: refactor use expected_result from common/util.rs 2021-07-07 15:54:03 +02:00
Jan Scheer 90de4257b1
test_pinky: refactor use expected_result from common/util.rs 2021-07-07 15:53:46 +02:00
Jan Scheer c2bd7ae9b1
test_id: refactor use expected_result from common/util.rs 2021-07-07 15:53:26 +02:00
Jan Scheer 9631d8cf2b
test_groups: refactor use expected_result from common/util.rs 2021-07-07 15:52:56 +02:00
Sylvestre Ledru df683f8c84
Merge pull request #2465 from miDeb/install-test
[: install test as [ as well
2021-07-07 15:43:38 +02:00
Jan Scheer c447863c8d
tests/common: refactor to reduce duplicate code
* move fn expected_result to common/util.rs
* move fn check_coreutil_version to common/util.rs
* move fn whoami to common/util.rs
* move macro unwrap_or_return to common/macros.rs
* add documentation
* add tests
2021-07-07 14:59:14 +02:00
Sylvestre Ledru 7018ff8925
Merge pull request #2477 from dhodder/uname_target_env
uname: don't report OS as "GNU/Linux" without GNU
2021-07-07 08:46:50 +02:00
Dave Hodder 330f797378 tests/uname: add --operating-system test 2021-07-06 23:40:38 +01:00
Andreas Hartmann f64b708410 test: du: Skip nondynamic comparison on linux for test_du_bytes
The `test_du_bytes` testcase for the `du --bytes` command is written to perform
a dynamic comparison on linux hosts, i.e. it compares the output of the command
to that of the hosts `du` from the GNU coreutils.

Previously the test was written such that it would *first* perform the dynamic
comparison, and *after that* continue to a static comparison which may fail for
specific hosts that have a filesystem different from what the test expects.

This patch excludes linux hosts from the static comparison to ensure the test
performs only the dynamic comparison.
2021-07-06 19:45:06 +02:00
Michael Debertol 8ace291b32 sort: make -k only take one argument per flag
This makes it so that `sort -k 1 file` treats `file` as the input file
and not the second key.
2021-07-06 15:47:32 +02:00
Jan Scheer e53f4db33a Merge branch 'master' into id_selinux_context 2021-07-06 13:29:50 +02:00
Michael Debertol bc0727cc4d [: add support for --help and --version
I copied the help text verbatim from GNU, I hope that's ok.
2021-07-06 13:15:07 +02:00
Sylvestre Ledru 1136221f6f rustfmt the recent change 2021-07-04 13:01:31 +02:00
Sylvestre Ledru ae1935c3cb
Merge branch 'master' into master 2021-07-04 11:57:59 +02:00
Sylvestre Ledru 91078cfcb3
Merge pull request #2445 from syukronrm/du-inodes
du: add `--inodes`
2021-07-04 11:28:03 +02:00
Sylvestre Ledru d3652cc3c0
Merge pull request #2457 from Funky185540/install-implement-backup
install: implement --backup, -b and -S
2021-07-04 09:57:45 +02:00
Terts Diepraam 7a0a7aecc4
Merge pull request #2461 from miDeb/sort/check-no-out
sort: disable -o with -C and -c
2021-07-01 13:07:05 +02:00
Terts Diepraam 6213a2a967
Merge pull request #2462 from miDeb/sort/version
sort/ls: implement version cmp matching GNU spec
2021-07-01 13:02:59 +02:00
Terts Diepraam 73a7ead857 mktemp: adapt to standardized error handling 2021-06-28 13:55:55 +02:00
Syukron Rifail M 27e0507844 du: more tests 2021-06-28 07:51:17 +07:00
Syukron Rifail M d8a33da5b3 du: add --inodes 2021-06-28 07:51:17 +07:00
Michael Debertol d3732e08c4 sort: disable -o with -C and -c 2021-06-27 16:21:18 +02:00
Michael Debertol 233a778963 sort/ls: implement version cmp matching GNU spec
This reimplements version_cmp, which is used in sort and ls to sort
according to versions.
However, it is not bug-for-bug identical with GNU's implementation.
I reported a bug with GNU here:
https://lists.gnu.org/archive/html/bug-coreutils/2021-06/msg00045.html
This implementation does not contain the bugs regarding the handling of
file extensions and null bytes.
2021-06-27 15:29:17 +02:00
Andreas Hartmann 69e8838b27 tests: install: Add tests for '--backup'
Tests the '--backup' option for the install utility. Most of the code is
adapted from the respective tests for 'mv'.
2021-06-27 09:55:10 +02:00
Michael Debertol 548a895cd6 sort: compatibility of human-numeric sort
Closes #1985.
This makes human-numeric sort follow the same algorithm as GNU's/FreeBSD's sort.
As documented by GNU in https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html,
we first compare by sign, then by si unit and finally by the numeric value.
2021-06-25 18:19:00 +02:00
Sylvestre Ledru ab5d581fa4
Merge pull request #2439 from tertsdiepraam/numfmt/round-and-c-locale
`numfmt`: add `--round` and other minor improvements
2021-06-24 21:18:59 +02:00
Sylvestre Ledru 5d7cf61128
Merge pull request #2429 from miDeb/install/target-dir
install: support --target-directory
2021-06-24 21:06:44 +02:00
Sylvestre Ledru 3b2d0d17fa
Merge pull request #2446 from jhscheer/groups_gnu_testsuite
groups: fixes to pass GNU's Testsuite
2021-06-23 20:15:12 +02:00
Sylvestre Ledru 44c770d234
Merge pull request #2450 from jhscheer/id_refactor_identifier
id: refactor identifiers
2021-06-23 19:05:57 +02:00
Jan Scheer 11f36eae3b tests/groups: fix/add tests for (multiple) username(s) 2021-06-23 16:50:03 +02:00
Sylvestre Ledru d40fc65ee6
Merge branch 'master' into numfmt/round-and-c-locale 2021-06-23 12:39:55 +02:00
Sylvestre Ledru a73e71ba74
Merge pull request #2437 from miDeb/cp/reflink-auto
cp: default to --reflink=auto on linux and macos
2021-06-23 12:37:44 +02:00
Sylvestre Ledru 87eaf6e80a
Merge pull request #2447 from jhscheer/locale_c
fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
2021-06-23 12:36:40 +02:00
Jan Scheer 4b3da59b0e id: refactor identifiers
* change of identifier names and spelling according to the suggestions in the review of #2446
2021-06-23 12:27:01 +02:00
Jan Scheer c0be979611 fix some issues with locale (replace "LANGUAGE" with "LC_ALL")
`LANGUAGE=C` is not enough, `LC_ALL=C` is needed as the environment
variable that overrides all the other localization settings.

e.g.
```bash
$ LANGUAGE=C id foobar
id: ‘foobar’: no such user

$ LC_ALL=C id foobar
id: 'foobar': no such user
```

* replace `LANGUAGE` with `LC_ALL` as environment variable in the tests
* fix the the date string of affected uutils
* replace `‘` and `’` with `'`
2021-06-23 11:30:28 +02:00
Sylvestre Ledru 178399c20e
Merge pull request #2449 from miDeb/temp-win
Make tests pass on a windows VM
2021-06-23 08:40:30 +02:00
Michael Debertol ce0801db90 tests/mv: test uutils mv instead of system util
Calling `cmd_keepenv("mv")` spawned the system `mv` instead of
the uutils `mv`. Also, `keepenv` isn't necessary because it doesn't
need to inherit environment variables.
We now actually check the stderr, because previously the result of
`ends_with` was not used, making the test pass even when it shouldn't.

I disabled the test on windows because `mkdir` does not support `-m` on
windows, making the test fail because there will be no permission error.
On FreeBSD there isn't a permission error either, and `mv` succeeds.
2021-06-23 00:58:19 +02:00