summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDhaval Giani <dhaval@linux.vnet.ibm.com>2008-07-02 09:08:37 +0000
committerDhaval Giani <dhaval@linux.vnet.ibm.com>2008-07-02 09:08:37 +0000
commit53aed66c758cc2309ed5b2a0bb3151ff7278310f (patch)
treea91fade7fc298e5a4bbf355e89e020479911a3d5 /tests
parent688123a268cdcc198fc49f85c4dbf3e9ceb42f7a (diff)
downloadlibcg-53aed66c758cc2309ed5b2a0bb3151ff7278310f.tar.gz
libcg-53aed66c758cc2309ed5b2a0bb3151ff7278310f.tar.xz
libcg-53aed66c758cc2309ed5b2a0bb3151ff7278310f.zip
libcgroup: Fix test cases to use CPU controller if available
The test cases used the memory controller. This is not a good idea since most distro kernels don't enable it by default. For the moment I'm setting it to use CPU if memory is not found, but in the longer term I am planning to set it to use CPU first and then memory. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@97 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests')
-rw-r--r--tests/libcgrouptest01.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c
index 80d8951..e144e6c 100644
--- a/tests/libcgrouptest01.c
+++ b/tests/libcgrouptest01.c
@@ -240,8 +240,16 @@ int main(int argc, char *argv[])
retval = set_controller(MEMORY, controller_name, control_file);
strncpy(val_string, "40960000", sizeof(val_string));
- if (retval)
- fprintf(stderr, "Setting controller failled\n");
+ if (retval) {
+ retval = set_controller(CPU, controller_name,
+ control_file);
+ strncpy(val_string, "2048", sizeof(val_string));
+ if (retval) {
+ fprintf(stderr, "Failed to set any controllers "
+ "Tests dependent on this structure will"
+ " fail\n");
+ }
+ }
cgroup1 = new_cgroup(group, controller_name,
control_file, STRING);