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

Integration test for spawn command with no name field

parent 13a18184
extern crate cuttr;
use cuttr::random::random_string;
use std::fs;
use std::path;
use std::rc::Rc;
......@@ -233,3 +234,45 @@ fn test_spawn_cpuset() {
assert!(paths.iter().all(|p| !p.exists()));
// TODO: need cpuset cgroup: make it more generic (or robust)
fn test_spawn_cpuset_no_name() {
let result_file = format!("{}{}", SPAWN_CPUSET_RESULT_FILE, random_string(12));
let json = format!(
"-c", "echo $(nproc) > {}"
let controllers = Rc::new(configuration::sysfscontroller::get_sys_fs_controllers().unwrap());
let paths = controllers
.map(|path| path.join(SPAWN_CPUSET_NAME))
let mut commands = parsing::parse_json(&json, controllers).unwrap();
let result_path = path::Path::new(&result_file);
assert_eq!(fs::read_to_string(&result_path).unwrap().trim(), "1");
assert!(paths.iter().all(|p| !p.exists()));
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