mirror of
https://github.com/kata-containers/cgroups-rs.git
synced 2026-08-05 02:13:23 +00:00
change *limit* in memory from u64 to i64
Signed-off-by: bin liu <bin@hyper.sh>
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
//! Integration test about setting resources using `apply()`
|
||||
use cgroups::pid::{PidController, PidMax};
|
||||
use cgroups::{Cgroup, PidResources, Resources};
|
||||
use cgroups::pid::{PidController};
|
||||
use cgroups::{Cgroup, Hierarchy, MaxValue, PidResources, Resources};
|
||||
|
||||
#[test]
|
||||
fn pid_resources() {
|
||||
let hier = cgroups::hierarchies::V1::new();
|
||||
let cg = Cgroup::new(&hier, String::from("pid_resources"));
|
||||
let h = cgroups::hierarchies::auto();
|
||||
let h = Box::new(&*h);
|
||||
let cg = Cgroup::new(h, String::from("pid_resources"));
|
||||
{
|
||||
let res = Resources {
|
||||
pid: PidResources {
|
||||
update_values: true,
|
||||
maximum_number_of_processes: PidMax::Value(512),
|
||||
maximum_number_of_processes: MaxValue::Value(512),
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
@@ -20,7 +21,7 @@ fn pid_resources() {
|
||||
let pidcontroller: &PidController = cg.controller_of().unwrap();
|
||||
let pid_max = pidcontroller.get_pid_max();
|
||||
assert_eq!(pid_max.is_ok(), true);
|
||||
assert_eq!(pid_max.unwrap(), PidMax::Value(512));
|
||||
assert_eq!(pid_max.unwrap(), MaxValue::Value(512));
|
||||
}
|
||||
cg.delete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user