summaryrefslogtreecommitdiffstats
path: root/tests/test_functions.c
Commit message (Collapse)AuthorAgeFilesLines
* libcgrouptest: rename get_controller() to is_subsystem_enabled()Dhaval Giani2009-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | From: Sudhir Kumar <skumar@linux.vnet.ibm.com> This patch renames the function get_controllers() to a more meaningful name is_subsystem_enabled(). history: The code in the patch is part of a patch sent in an earlier patchset, which somehow got dropped (looks an older version of that patch was merged to the tree). Adding this patch makes everything upstream upto the discussion held on the list. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@314 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgrouptest: open may fail wrt permissions, so use statDhaval Giani2009-01-091-8/+17
| | | | | | | | | | | | | | | | | | | | From: Sudhir Kumar <skumar@linux.vnet.ibm.com> The patch was adding a warning "test_functions.c:359: warning: unused variable ‘ret’" Hence resending correcting it. open may fail in case there is not proper permissions and hence giving a wrong result. This patch uses stat instead which is always better. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@312 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgrouptest: let check_task() receive a pid as argumentDhaval Giani2009-01-091-4/+8
| | | | | | | | | | | | | | | | | | | | | From: Sudhir Kumar <skumar@linux.vnet.ibm.com> The patch would get a reject because of modifications in an earlier patch. Hence updating the patch by fixing the reject. This patch makes the function check_task() capable of checking if a pid other than the calling process is attached to a particlular group. Earlier it was checking for the calling process only. For optimization purpose 0 is used to indicate that the task to be attached is the current task and hence call cgroup_gettid() only once. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@311 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgrouptest:attach exclusive pid support in test_cgroup_attach_task() functionDhaval Giani2009-01-091-3/+11
| | | | | | | | | | | | | | | From: Sudhir Kumar <skumar@linux.vnet.ibm.com> The function test_attach_task_pid() was attaching the process calling the function to a group and did not have support to take any pid for attaching it to a group. This patch does that. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Acked-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@310 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgrouptest: Move functions into a new file to reuseDhaval Giani2009-01-091-0/+896
From: Sudhir Kumar <skumar@linux.vnet.ibm.com> There were some coding style warnings that have been fixed in this patch. Basicaly the ones reported by checkpatch.pl This patch puts the test functions in a separate file so that they can be reused for further testing. Some of the functions were static and hence changed to be non static. It also edits the Makefile so that the patch compiles. Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@309 4f4bb910-9a46-0410-90c8-c897d4f1cd53