From 952183580cc874db99230534f7e38b75f57f3d88 Mon Sep 17 00:00:00 2001 From: Dhaval Giani Date: Tue, 1 Jul 2008 13:51:52 +0000 Subject: From: Sudhir Kumar libcgroup: libcgroup testcases for cgroup_attach_task() This patch adds testcases for libcgroup API cgroup_create_cgroup() and cgroup_delete_cgroup() testing. The APIs are called under the same but two conditions(FS_MOUNTED=0/1) and return values are checked. The cgroup is created and freed using the wrapper APIs. Testcases for FS_MOUNTED=2 have to be added. Signed-off-by: Sudhir Kumar Signed-off-by: Dhaval Giani git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@90 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- tests/libcgrouptest.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/libcgrouptest.h') diff --git a/tests/libcgrouptest.h b/tests/libcgrouptest.h index b35c7a9..9d3da5d 100644 --- a/tests/libcgrouptest.h +++ b/tests/libcgrouptest.h @@ -18,6 +18,8 @@ #ifndef __LIBCGROUPTEST_H #define __LIBCGROUPTEST_H +#include +#include #include #include #include @@ -25,12 +27,25 @@ #include +int cpu = 0, memory = 0; + enum cgroup_mount_t { FS_NOT_MOUNTED, FS_MOUNTED, FS_MULTI_MOUNTED, }; +enum controller_t { + MEMORY, + CPU, + /* Add new controllers here */ +}; + +void get_controllers(char *name, int *exist); +static int group_exist(char *path_group); +static int set_controller(int controller, char *controller_name, + char *control_file, char *control_val, char *value); + static inline pid_t cgrouptest_gettid() { return syscall(__NR_gettid); -- cgit