The following patch adds a scenario for testing cgroup_get_cgroup() api. The test is called with a cgroup which has not been created yet.
Signed-off-by: Sudhir Kumar <[email protected]> Index: trunk/tests/libcgrouptest01.c =================================================================== --- trunk.orig/tests/libcgrouptest01.c +++ trunk/tests/libcgrouptest01.c @@ -1417,6 +1417,17 @@ void test_cgroup_get_cgroup(int i) else message(i++, FAIL, "get_cgroup()", ret, info[NULLGRP]); + /* Test with invalid name filled cgroup(non existing) */ + cgroup_filled = cgroup_new_cgroup("nogroup"); + if (!cgroup_filled) + message(i++, FAIL, "new_cgroup()", 0, info[NOMESSAGE]); + + ret = cgroup_get_cgroup(cgroup_filled); + if (ret) + message(i++, PASS, "get_cgroup()", ret, info[NOTCRTDGRP]); + else + message(i++, FAIL, "get_cgroup()", ret, info[NOTCRTDGRP]); + /* Test with name filled cgroup */ cgroup_filled = cgroup_new_cgroup("group1"); if (!cgroup_filled) ------------------------------------------------------------------------------ _______________________________________________ Libcg-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libcg-devel
