diff options
author | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-12-17 15:10:21 +0000 |
---|---|---|
committer | Balbir Singh <balbir@linux.vnet.ibm.com> | 2008-12-17 15:10:21 +0000 |
commit | ef02aae5122ff74836b3bba28d19c10b31578036 (patch) | |
tree | 47709d8a50b8917170b38a554becb0dbb1f4c3a1 /tests/libcgrouptest01.c | |
parent | e6c94addf04ae6d515173b889877dd55b0072a39 (diff) | |
download | libcg-ef02aae5122ff74836b3bba28d19c10b31578036.tar.gz libcg-ef02aae5122ff74836b3bba28d19c10b31578036.tar.xz libcg-ef02aae5122ff74836b3bba28d19c10b31578036.zip |
libcgroup Test: change test call
Hi,
The api cgroup_modify_cgroup(cgroup1) had to be called before
cgroup_modify_cgroup(cgroup2). This patch does that.
Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com>
git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@254 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests/libcgrouptest01.c')
-rw-r--r-- | tests/libcgrouptest01.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index 85bcdd1..2aa881e 100644 --- a/tests/libcgrouptest01.c +++ b/tests/libcgrouptest01.c @@ -286,7 +286,27 @@ int main(int argc, char *argv[]) strncpy(extra, "\n", SIZE); /* - * Create another valid cgroup structure + * Test07: modify cgroup with the same cgroup + * Exp outcome: zero return value. No change. + */ + strncpy(extra, " Called with same cgroup argument\n", SIZE); + + strncpy(path_control_file, mountpoint, sizeof(mountpoint)); + strncat(path_control_file, "/group1", sizeof("/group1")); + strncat(path_control_file, "/", sizeof("/")); + strncat(path_control_file, control_file, sizeof(control_file)); + + retval = cgroup_modify_cgroup(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); + + strncpy(extra, "\n", SIZE); + + /* + * Create another valid cgroup structure with same group * Exp outcome: no error. 0 return value */ strncpy(group, "group1", sizeof(group)); @@ -300,7 +320,7 @@ int main(int argc, char *argv[]) control_file, STRING); /* - * Test07: modify cgroup + * Test08: modify cgroup with this new cgroup * Exp outcome: zero return value */ strncpy(path_control_file, mountpoint, sizeof(mountpoint)); @@ -316,19 +336,6 @@ int main(int argc, char *argv[]) message(++i, FAIL, "modify_cgroup()", retval, extra); /* - * Test08: modify cgroup with the same cgroup - * Exp outcome: zero return value - */ - - retval = cgroup_modify_cgroup(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); - - - /* * Test09: modify cgroup with the null cgroup * Exp outcome: zero return value. */ |