diff options
Diffstat (limited to 'tests/libcg_ba.cpp')
-rw-r--r-- | tests/libcg_ba.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/libcg_ba.cpp b/tests/libcg_ba.cpp index b8df520..967b1ff 100644 --- a/tests/libcg_ba.cpp +++ b/tests/libcg_ba.cpp @@ -22,6 +22,8 @@ using namespace std; #include <sys/types.h> #include <pwd.h> #include <errno.h> +#include <stdlib.h> +#include <string.h> namespace cgtest { @@ -91,6 +93,20 @@ struct cgroup *cg::makenode(const string &name, const string &task_uid, calloc(1, sizeof(struct control_value)); strcpy(ccg->controller[0]->values[0]->name,"cpu.shares"); strcpy(ccg->controller[0]->values[0]->value, "100"); + + ccg->controller[1] = (struct controller *) + calloc(1, sizeof(struct controller)); + strcpy(ccg->controller[1]->name, "memory"); + ccg->controller[1]->values[0] = (struct control_value *) + calloc(1, sizeof(struct control_value)); + strcpy(ccg->controller[1]->values[0]->name,"memory.limit_in_bytes"); + strcpy(ccg->controller[1]->values[0]->value, "102400"); + + strcpy(ccg->controller[2]->name, "cpuacct"); + ccg->controller[2]->values[0] = (struct control_value *) + calloc(1, sizeof(struct control_value)); + strcpy(ccg->controller[2]->values[0]->name,"cpuacct.usage"); + strcpy(ccg->controller[2]->values[0]->value, "0"); ccg->tasks_uid = tuid; ccg->tasks_gid = tgid; ccg->control_uid = cuid; |