diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-12-17 15:16:20 +0000 |
---|---|---|
committer | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-12-17 15:16:20 +0000 |
commit | 7c24ef00d7fc13b7c10147803d19293f2285caa5 (patch) | |
tree | 8f70849ecab4e1644133ad2c0680329ca65de866 | |
parent | be9bc9f12e399828a1a5292fd74f90507b55f836 (diff) | |
download | libcg-7c24ef00d7fc13b7c10147803d19293f2285caa5.tar.gz libcg-7c24ef00d7fc13b7c10147803d19293f2285caa5.tar.xz libcg-7c24ef00d7fc13b7c10147803d19293f2285caa5.zip |
libcgroup Test: libcgroup-modify_cgroup-test2-for-multimnt
This patch adds a testcase for libcgroup api cgroup_modify_cgroup() for
multiple mount scenario for second controller.
Again the challenge is to handle the control value as diff controllers put diff
upper limit on control value and we pick the controller dynamicaly.
So thoughts ???
Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@263 4f4bb910-9a46-0410-90c8-c897d4f1cd53
-rw-r--r-- | tests/libcgrouptest01.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index 4104157..7b65fe4 100644 --- a/tests/libcgrouptest01.c +++ b/tests/libcgrouptest01.c @@ -749,7 +749,39 @@ int main(int argc, char *argv[]) message(++i, FAIL, "modify_cgroup()", retval, extra); /* - * Test10: delete cgroups + * Create another valid cgroup structure with same group name + * to modify the existing group ctl2_group1 + * Exp outcome: no error. 0 return value + */ + strncpy(group, "ctl2_group1", sizeof(group)); + retval = set_controller(ctl2, controller_name, control_file); + strncpy(val_string, "7000000", sizeof(val_string)); + + if (retval) { + fprintf(stderr, "Setting controller failled " + " Exiting without running further testcases\n"); + exit(1); + } + + mod_ctl2_cgroup1 = new_cgroup(group, controller_name, + control_file, STRING); + + /* + * Test10: modify existing cgroup with this new cgroup + * Exp outcome: zero return value and control value modified + */ + build_path(path_control_file, mountpoint2, + "ctl2_group1", control_file); + + retval = cgroup_modify_cgroup(mod_ctl2_cgroup1); + /* Check if the values are changed */ + if (!retval && !group_modified(path_control_file, STRING)) + message(++i, PASS, "modify_cgroup()", retval, extra); + else + message(++i, FAIL, "modify_cgroup()", retval, extra); + + /* + * Test11: delete cgroups * Exp outcome: zero return value */ retval = cgroup_delete_cgroup(ctl1_cgroup1, 1); |