Commit d0a627fe authored by Alexis Janon's avatar Alexis Janon
Browse files

Remove root check for integration tests

It might not be needed to run as root: we only need to be able to write
in the cgroup sysfs, or have our own cgroup.
parent df2fee1a
......@@ -16,17 +16,9 @@ const PROPERTY: &str = "cpuset.cpus";
const CONTROLLER: &str = "cpuset";
const VALUE: &str = "0";
fn check_root() {
match env::var("USER") {
Ok(user) => assert_eq!(user, "root"),
Err(_) => panic!(),
}
}
#[allow(unused_must_use)]
#[test]
fn test_create() {
check_root();
let mut json = r#"{"commands":[{"command":"create","name":""#.to_owned();
json.push_str(CREATE_NAME);
json.push_str(r#""}]}"#);
......@@ -51,7 +43,6 @@ fn test_create() {
#[allow(unused_must_use)]
#[test]
fn test_remove() {
check_root();
let mut json = r#"{"commands":[{"command":"remove","name":""#.to_owned();
json.push_str(DELETE_NAME);
json.push_str(r#""}]}"#);
......@@ -77,7 +68,6 @@ fn test_remove() {
#[test]
// TODO: need cpuset cgroup: make it more generic (or robust)
fn test_modify() {
check_root();
let mut json = r#"{"commands":[{"command":"modify","name":""#.to_owned();
json.push_str(MODIFY_NAME);
json.push_str(r#"", "properties":{""#);
......@@ -112,7 +102,6 @@ fn test_modify() {
#[test]
// TODO: need cpuset cgroup: make it more generic (or robust)
fn test_create_with_properties() {
check_root();
let mut json = r#"{"commands":[{"command":"modify","name":""#.to_owned();
json.push_str(CREATE_WITH_PROPERTIES_NAME);
json.push_str(r#"", "properties":{""#);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment