coreutils/tests/by-util/test_logname.rs

25 lines
688 B
Rust
Raw Normal View History

2020-06-07 15:41:48 +00:00
use crate::common::util::*;
use std::env;
#[test]
fn test_normal() {
let (_, mut ucmd) = at_and_ucmd!();
let result = ucmd.run();
println!("result.stdout = {}", result.stdout);
println!("result.stderr = {}", result.stderr);
println!("env::var(CI).is_ok() = {}", env::var("CI").is_ok());
for (key, value) in env::vars() {
println!("{}: {}", key, value);
}
if is_ci() && result.stderr.contains("error: no login name") {
2020-06-07 15:41:48 +00:00
// In the CI, some server are failing to return logname.
// As seems to be a configuration issue, ignoring it
return;
}
assert!(result.success);
assert!(!result.stdout.trim().is_empty());
}