Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/uu/id/src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// http://www.opensource.apple.com/source/shell_cmds/shell_cmds-118/id/id.c
//
// * This was partially rewritten in order for stdout/stderr/exit_code
// to be conform with GNU coreutils (8.32) testsuite for `id`.
// to be conform with GNU coreutils (8.32) test suite for `id`.
//
// * This supports multiple users (a feature that was introduced in coreutils 8.31)
//
// * This passes GNU's coreutils Testsuite (8.32)
// * This passes GNU's coreutils Test suite (8.32)
// for "tests/id/uid.sh" and "tests/id/zero/sh".
//
// * Option '--zero' does not exist for BSD's `id`, therefore '--zero' is only
Expand All @@ -26,7 +26,7 @@
// * Help text based on BSD's `id` manpage and GNU's `id` manpage.
//

// spell-checker:ignore (ToDO) asid auditid auditinfo auid cstr egid emod euid getaudit getlogin gflag nflag pline rflag termid uflag gsflag zflag testsuite
// spell-checker:ignore (ToDO) asid auditid auditinfo auid cstr egid emod euid getaudit getlogin gflag nflag pline rflag termid uflag gsflag zflag

#![allow(non_camel_case_types)]
#![allow(dead_code)]
Expand Down Expand Up @@ -242,7 +242,7 @@ pub fn uumain(args: impl uucore::Args) -> i32 {
crash!(1, "cannot print only names or real IDs in default format");
}
if (state.zflag) && default_format {
// NOTE: GNU testsuite "id/zero.sh" needs this stderr output:
// NOTE: GNU test suite "id/zero.sh" needs this stderr output:
crash!(1, "option --zero not permitted in default format");
}

Expand Down
14 changes: 7 additions & 7 deletions tests/by-util/test_id.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use crate::common::util::*;

// spell-checker:ignore (ToDO) testsuite coreutil
// spell-checker:ignore (ToDO) coreutil

// These tests run the GNU coreutils `(g)id` binary in `$PATH` in order to gather reference values.
// If the `(g)id` in `$PATH` doesn't include a coreutils version string,
// or the version is too low, the test is skipped.

// The reference version is 8.32. Here 8.30 was chosen because right now there's no
// ubuntu image for github action available with a higher version than 8.30.
const VERSION_EXPECTED: &str = "8.30"; // Version expected for the reference `id` in $PATH
const VERSION_MULTIPLE_USERS: &str = "8.31";
const VERSION_MIN: &str = "8.30"; // minimum Version for the reference `id` in $PATH
const VERSION_MIN_MULTIPLE_USERS: &str = "8.31"; // this feature was introduced in GNU's coreutils 8.31
const UUTILS_WARNING: &str = "uutils-tests-warning";
const UUTILS_INFO: &str = "uutils-tests-info";

Expand Down Expand Up @@ -210,13 +210,13 @@ fn test_id_multiple_users() {
let util_name = util_name!();
#[cfg(all(unix, not(target_os = "linux")))]
let util_name = &format!("g{}", util_name!());
let version_check_string = check_coreutil_version(util_name, VERSION_MULTIPLE_USERS);
let version_check_string = check_coreutil_version(util_name, VERSION_MIN_MULTIPLE_USERS);
if version_check_string.starts_with(UUTILS_WARNING) {
println!("{}\ntest skipped", version_check_string);
return;
}

// Same typical users that GNU testsuite is using.
// Same typical users that GNU test suite is using.
let test_users = ["root", "man", "postfix", "sshd", &whoami()];

let scene = TestScenario::new(util_name!());
Expand Down Expand Up @@ -278,7 +278,7 @@ fn test_id_multiple_users_non_existing() {
let util_name = util_name!();
#[cfg(all(unix, not(target_os = "linux")))]
let util_name = &format!("g{}", util_name!());
let version_check_string = check_coreutil_version(util_name, VERSION_MULTIPLE_USERS);
let version_check_string = check_coreutil_version(util_name, VERSION_MIN_MULTIPLE_USERS);
if version_check_string.starts_with(UUTILS_WARNING) {
println!("{}\ntest skipped", version_check_string);
return;
Expand Down Expand Up @@ -467,7 +467,7 @@ fn expected_result(args: &[&str]) -> Result<CmdResult, String> {
#[cfg(all(unix, not(target_os = "linux")))]
let util_name = &format!("g{}", util_name!());

let version_check_string = check_coreutil_version(util_name, VERSION_EXPECTED);
let version_check_string = check_coreutil_version(util_name, VERSION_MIN);
if version_check_string.starts_with(UUTILS_WARNING) {
return Err(version_check_string);
}
Expand Down