2020-05-25 17:05:26 +00:00
|
|
|
use crate::common::util::*;
|
2020-04-30 22:24:06 +00:00
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_uname_compatible() {
|
|
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
|
|
|
|
let result = ucmd.arg("-a").run();
|
|
|
|
assert!(result.success);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_uname_name() {
|
|
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
|
|
|
|
let result = ucmd.arg("-n").run();
|
|
|
|
assert!(result.success);
|
|
|
|
}
|
2020-05-05 13:52:17 +00:00
|
|
|
|
2020-12-11 21:46:36 +00:00
|
|
|
#[test]
|
|
|
|
fn test_uname_processor() {
|
|
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
|
|
|
|
let result = ucmd.arg("-p").run();
|
|
|
|
assert!(result.success);
|
|
|
|
assert_eq!(result.stdout.trim_end(), "unknown");
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_uname_hwplatform() {
|
|
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
|
|
|
|
let result = ucmd.arg("-i").run();
|
|
|
|
assert!(result.success);
|
|
|
|
assert_eq!(result.stdout.trim_end(), "unknown");
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_uname_machine() {
|
|
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
|
|
|
|
let result = ucmd.arg("-m").run();
|
|
|
|
assert!(result.success);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn test_uname_kernel_version() {
|
|
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
|
|
|
|
let result = ucmd.arg("-v").run();
|
|
|
|
assert!(result.success);
|
|
|
|
}
|
|
|
|
|
2020-05-05 13:52:17 +00:00
|
|
|
#[test]
|
|
|
|
fn test_uname_kernel() {
|
|
|
|
let (_, mut ucmd) = at_and_ucmd!();
|
|
|
|
|
|
|
|
let result = ucmd.arg("-o").run();
|
|
|
|
assert!(result.success);
|
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
assert!(result.stdout.to_lowercase().contains("linux"));
|
|
|
|
}
|