mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
Implement ::std::error::Error
This commit is contained in:
committed by
Levente Kurusa
parent
84ae587360
commit
7826b798bd
+3
-3
@@ -1,7 +1,8 @@
|
||||
extern crate cgroups;
|
||||
|
||||
use cgroups::cpuset::CpuSetController;
|
||||
use cgroups::{Cgroup, CgroupError};
|
||||
use cgroups::error::ErrorKind;
|
||||
use cgroups::Cgroup;
|
||||
|
||||
#[test]
|
||||
fn test_cpuset_memory_pressure_root_cg() {
|
||||
@@ -12,8 +13,7 @@ fn test_cpuset_memory_pressure_root_cg() {
|
||||
|
||||
// This is not a root control group, so it should fail via InvalidOperation.
|
||||
let res = cpuset.set_enable_memory_pressure(true);
|
||||
assert!(res.is_err());
|
||||
assert_eq!(res.unwrap_err(), CgroupError::InvalidOperation);
|
||||
assert_eq!(res.unwrap_err().kind(), &ErrorKind::InvalidOperation);
|
||||
}
|
||||
cg.delete();
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
extern crate cgroups;
|
||||
use cgroups::pid::{PidController, PidMax};
|
||||
use cgroups::Controller;
|
||||
use cgroups::{Cgroup, CgroupError, CgroupPid, PidResources, Resources};
|
||||
use cgroups::{Cgroup, CgroupPid, PidResources, Resources};
|
||||
|
||||
extern crate nix;
|
||||
use nix::sys::wait::{waitpid, WaitStatus};
|
||||
|
||||
Reference in New Issue
Block a user