From 2dbe9a29e91d3bf827f9f3fe761080a450a8f14d Mon Sep 17 00:00:00 2001 From: Balbir Singh Date: Wed, 17 Dec 2008 15:19:45 +0000 Subject: libcgroup Test: fix-modify_cgroup-failures-by-changing-cntl-values Since the cpu.shares now has a max limit, this patch fixes all cgroup_modify_cgroup() testcases that were failing because of this issue. This is not a permanent fix, however, i will be changing the approach to use a configuration file for control values and the patch will be out soon, once the function creation part is over. Signed-off-by: Sudhir Kumar git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@270 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- tests/libcgrouptest01.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'tests/libcgrouptest01.c') diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index af98d33..82b9b98 100644 --- a/tests/libcgrouptest01.c +++ b/tests/libcgrouptest01.c @@ -223,14 +223,14 @@ int main(int argc, char *argv[]) */ strncpy(group, "group1", sizeof(group)); retval = set_controller(ctl1, controller_name, control_file); - strncpy(val_string, "40960000", sizeof(val_string)); + strncpy(val_string, "250000", sizeof(val_string)); if (retval) { fprintf(stderr, "Failed to set first controller. " "Trying with second controller\n"); retval = set_controller(ctl2, controller_name, control_file); - strncpy(val_string, "2048000", sizeof(val_string)); + strncpy(val_string, "250000", sizeof(val_string)); if (retval) fprintf(stderr, "Failed to set any controllers " "Tests dependent on this structure will" @@ -285,7 +285,6 @@ int main(int argc, char *argv[]) build_path(path_control_file, mountpoint, "group1", control_file); - retval = cgroup_modify_cgroup(cgroup1); /* Check if the values are changed */ if (!retval && !group_modified(path_control_file, STRING)) @@ -301,14 +300,14 @@ int main(int argc, char *argv[]) */ strncpy(group, "group1", sizeof(group)); retval = set_controller(ctl1, controller_name, control_file); - strncpy(val_string, "81920000", sizeof(val_string)); + strncpy(val_string, "260000", sizeof(val_string)); if (retval) { fprintf(stderr, "Failed to set first controller. " "Trying with second controller\n"); retval = set_controller(ctl2, controller_name, control_file); - strncpy(val_string, "4096000", sizeof(val_string)); + strncpy(val_string, "260000", sizeof(val_string)); if (retval) fprintf(stderr, "Failed to set any controllers " "Tests dependent on this structure will" @@ -353,7 +352,7 @@ int main(int argc, char *argv[]) * to modify the existing group * Exp outcome: no error. 0 return value */ - val_int64 = 2048000; + val_int64 = 20480000; strncpy(group, "group1", sizeof(group)); retval = set_controller(ctl2, controller_name, control_file); if (retval) @@ -479,7 +478,7 @@ int main(int argc, char *argv[]) * Exp outcome: no error. 0 return value */ strncpy(group, "ctl1_group1", sizeof(group)); - strncpy(val_string, "4096000", sizeof(val_string)); + strncpy(val_string, "250000", sizeof(val_string)); retval = set_controller(ctl1, controller_name, control_file); /* * Since diff ctl will be mounted at different point, so exit @@ -617,7 +616,7 @@ int main(int argc, char *argv[]) */ strncpy(group, "ctl1_group1", sizeof(group)); retval = set_controller(ctl1, controller_name, control_file); - strncpy(val_string, "7000000", sizeof(val_string)); + strncpy(val_string, "250000", sizeof(val_string)); if (retval) { fprintf(stderr, "Setting controller failled " @@ -649,7 +648,7 @@ int main(int argc, char *argv[]) */ strncpy(group, "ctl2_group1", sizeof(group)); retval = set_controller(ctl2, controller_name, control_file); - strncpy(val_string, "7000000", sizeof(val_string)); + strncpy(val_string, "70000000", sizeof(val_string)); if (retval) { fprintf(stderr, "Setting controller failled " @@ -734,7 +733,7 @@ int main(int argc, char *argv[]) * Exp outcome: no error. 0 return value */ strncpy(group, "commongroup", sizeof(group)); - strncpy(val_string, "4096000", sizeof(val_string)); + strncpy(val_string, "250000", sizeof(val_string)); retval = set_controller(ctl1, controller_name, control_file); if (retval) { @@ -807,7 +806,7 @@ int main(int argc, char *argv[]) * Exp outcome: no error. 0 return value */ strncpy(group, "commongroup", sizeof(group)); - strncpy(val_string, "7000000", sizeof(val_string)); + strncpy(val_string, "260000", sizeof(val_string)); retval = set_controller(ctl1, controller_name, control_file); if (retval) { -- cgit