From: Balbir Singh Date: Wed, 17 Dec 2008 15:10:21 +0000 (+0000) Subject: libcgroup Test: change test call X-Git-Tag: v0.34~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef02aae5122ff74836b3bba28d19c10b31578036;p=thirdparty%2Flibcgroup.git 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 git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@254 4f4bb910-9a46-0410-90c8-c897d4f1cd53 --- diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c index 85bcdd1c..2aa881e1 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)); @@ -315,19 +335,6 @@ int main(int argc, char *argv[]) else 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.