1 use nix::sys::sysinfo::*;
2 
3 #[test]
sysinfo_works()4 fn sysinfo_works() {
5     let info = sysinfo().unwrap();
6 
7     let (l1, l5, l15) = info.load_average();
8     assert!(l1 >= 0.0);
9     assert!(l5 >= 0.0);
10     assert!(l15 >= 0.0);
11 
12     info.uptime();  // just test Duration construction
13 
14     assert!(info.swap_free() <= info.swap_total(),
15             "more swap available than installed (free: {}, total: {})",
16             info.swap_free(),
17             info.swap_total());
18 }
19