diff --git a/tests/test_uptime.rs b/tests/test_uptime.rs new file mode 100644 index 000000000..95436fb25 --- /dev/null +++ b/tests/test_uptime.rs @@ -0,0 +1,14 @@ +use common::util::*; + +#[test] +fn test_uptime() { + let result = TestScenario::new(util_name!()).ucmd_keepenv().run(); + + println!("stdout = {}", result.stdout); + println!("stderr = {}", result.stderr); + + assert!(result.success); + assert!(result.stdout.contains("load average:")); + assert!(result.stdout.contains(" up ")); + // Don't check for users as it doesn't show in some CI +} diff --git a/tests/tests.rs b/tests/tests.rs index 432caf63f..b802bd4ea 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -31,6 +31,7 @@ unix_only! { "stdbuf", test_stdbuf; "uname", test_uname; "unlink", test_unlink; + "uptime", test_uptime; "users", test_users; "who", test_who; // Be aware of the trailing semicolon after the last item