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
4 changes: 1 addition & 3 deletions tests/by-util/test_chown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
// file that was distributed with this source code.
// spell-checker:ignore (words) agroupthatdoesntexist auserthatdoesntexist cuuser groupname notexisting passgrp

#[cfg(any(target_os = "linux", target_os = "android"))]
use uucore::process::geteuid;
use uutests::util::{CmdResult, TestScenario, is_ci, run_ucmd_as_root};
use uutests::util_name;
use uutests::{at_and_ucmd, new_ucmd};
Expand Down Expand Up @@ -750,7 +748,7 @@ fn test_root_preserve() {
#[cfg(any(target_os = "linux", target_os = "android"))]
#[test]
fn test_big_p() {
if geteuid() != 0 {
if !rustix::process::geteuid().is_root() {
new_ucmd!()
.arg("-RP")
.arg("bin")
Expand Down
14 changes: 7 additions & 7 deletions tests/by-util/test_date.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use jiff::tz::TimeZone;
use jiff::{Timestamp, ToSpan};
use regex::Regex;
#[cfg(all(unix, not(target_os = "macos")))]
use uucore::process::geteuid;
use rustix::process::geteuid;
use uutests::util::TestScenario;
#[cfg(unix)]
use uutests::util::is_locale_available;
Expand Down Expand Up @@ -425,7 +425,7 @@ fn test_date_format_literal() {
#[test]
#[cfg(all(unix, not(target_os = "macos")))]
fn test_date_set_valid() {
if geteuid() == 0 {
if geteuid().is_root() {
new_ucmd!()
.arg("--set")
.arg("2020-03-12 13:30:00+08:00")
Expand All @@ -446,7 +446,7 @@ fn test_date_set_invalid() {
#[test]
#[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))]
fn test_date_set_permissions_error() {
if !(geteuid() == 0 || uucore::os::is_wsl_1()) {
if !(geteuid().is_root() || uucore::os::is_wsl_1()) {
let result = new_ucmd!()
.arg("--set")
.arg("2020-03-11 21:45:00+08:00")
Expand All @@ -460,7 +460,7 @@ fn test_date_set_permissions_error() {
#[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))]
fn test_date_set_hyphen_prefixed_values() {
// test -s flag accepts hyphen-prefixed values like "-3 days"
if !(geteuid() == 0 || uucore::os::is_wsl_1()) {
if !(geteuid().is_root() || uucore::os::is_wsl_1()) {
let test_cases = vec!["-1 hour", "-2 days", "-3 weeks", "-1 month"];

for date_str in test_cases {
Expand Down Expand Up @@ -494,7 +494,7 @@ fn test_date_set_mac_unavailable() {
#[test]
#[cfg(all(unix, not(target_os = "macos")))]
fn test_date_set_valid_2() {
if geteuid() == 0 {
if geteuid().is_root() {
new_ucmd!()
.arg("--set")
.arg("Sat 20 Mar 2021 14:53:01 AWST") // spell-checker:disable-line
Expand Down Expand Up @@ -575,7 +575,7 @@ fn test_date_for_file_mtime() {
#[test]
#[cfg(all(unix, not(target_os = "macos")))]
fn test_date_set_valid_3() {
if geteuid() == 0 {
if geteuid().is_root() {
new_ucmd!()
.arg("--set")
.arg("Sat 20 Mar 2021 14:53:01") // Local timezone
Expand All @@ -588,7 +588,7 @@ fn test_date_set_valid_3() {
#[test]
#[cfg(all(unix, not(target_os = "macos")))]
fn test_date_set_valid_4() {
if geteuid() == 0 {
if geteuid().is_root() {
new_ucmd!()
.arg("--set")
.arg("2020-03-11 21:45:00") // Local timezone
Expand Down
Loading