summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* libcgroup: Fix test cases to use new APIs.Dhaval Giani2008-08-131-2/+9
| | | | | | | | | | | | The APIs changed and we could no longer smoke test the library. Updating it now. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: Sudhir Kumar <skumar@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@132 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Ensure global data is protectedDhaval Giani2008-07-211-1/+1
| | | | | | | | | | | Add rwlock to ensure access to cg_mount_table is serialized. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Cc: Vivek Goyal <vgoyal@redhat.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@110 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: fix wrong malloc size in testcaseDhaval Giani2008-07-041-1/+1
| | | | | | | | | | | | | | | From: Sudhir Kumar <skumar@linux.vnet.ibm.com> This patch fixes a small mistake in the previous patch for malloc size. Of course the size should not be of the pointer but the structure. 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@98 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix test cases to use CPU controller if availableDhaval Giani2008-07-021-2/+10
| | | | | | | | | | | | | The test cases used the memory controller. This is not a good idea since most distro kernels don't enable it by default. For the moment I'm setting it to use CPU if memory is not found, but in the longer term I am planning to set it to use CPU first and then memory. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> Acked-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@97 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* libcgroup: Fix invalid pid test case.Dhaval Giani2008-07-011-1/+1
| | | | | | | | | | | 0 is a valid PID for cgroup filesystem. It moves the current task into the cgroup. Let's try -1 instead. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@96 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-012-0/+36
| | | | | | | | | | | | | | libcgroup: adds sanity check in libcgroup testcases binary This patch adds a sanity check on cgroup file system info in testcases. If cgroup filesystem is not mounted and script sends the info as mounted, then the binar would have failed. This patch handles that. 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@95 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-011-4/+65
| | | | | | | | | | | | | | | | | | libcgroup: testcases for cgroup_modify_cgroup() This patch adds testcases for libcgroup API cgroup_modify_cgroup() testing. The API is called with filesystem mounted (FS_MOUNTED=1) and return values are checked. The API is first called with the same cgroup(the one which is existing in the file system, and with all the same parameters). The second time it is called with a null cgroup. Third time it is called with a new cgroup having different controller. The filesystem is checked if the values have been modified. 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@94 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-012-65/+86
| | | | | | | | | | | | | | | libcgroup: put common code in a function This patch puts the common code for creating cgroup structure into a function struct cgroup *new_cgroup(). The function uses few global variables which are changed before the function call and takes few variables as arguments. 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@93 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-012-6/+113
| | | | | | | | | | | | | | | | | libcgroup: testcases for wrapper api and cgroup_modify_cgroup() This patch creates a valid cgroup structure to be passed as the parameter for cgroup_modify_cgroup() function and calls this function. The return values are checked and on that basis the test is declared as pass or fail. The patch adds the code that check if the parameter changed reflect in the filesystem. 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@92 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-011-0/+38
| | | | | | | | | | | | | | | | libcgroup: further testcases for create_cgroup() and delete_cgroup() This patch adds testcases for libcgroup API cgroup_create_cgroup() and cgroup_delete_cgroup() testing. The APIs are called under the same but two conditions(FS_MOUNTED=0/1) and return values are checked. The test checks if these APIs can handle a null cgroup and hence passes a nulll cgroup as parameter. 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@91 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-012-2/+199
| | | | | | | | | | | | | | | | | libcgroup: libcgroup testcases for cgroup_attach_task() This patch adds testcases for libcgroup API cgroup_create_cgroup() and cgroup_delete_cgroup() testing. The APIs are called under the same but two conditions(FS_MOUNTED=0/1) and return values are checked. The cgroup is created and freed using the wrapper APIs. Testcases for FS_MOUNTED=2 have to be added. 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@90 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-011-2/+84
| | | | | | | | | | | | | | | | | | | | | libcgroup: libcgroup testcases for cgroup_attach_task() This patch adds 3 testcases for libcgroup API cgroup_attach_task() testing. The API is called under the same but two conditions(FS_MOUNTED=0/1) and return values are checked. For FS_MOUNTED=1 the API is first called without intializing ie without calling cgroup_init(), and then after cg_init(). Each time the null cgroup is passed. The task is checked if it exists under the root group's tasks file. The 4th testcase calls cgroup_attach_task_pid() with an invalid pid. Testcases for FS_MOUNTED=2 have to be added. 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@89 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-011-9/+37
| | | | | | | | | | | | | | libcgroup: libcgroup testcase for cgroup_init() This patch adds total 3 testcases for libcgroup API cgroup_init() testing.The API is called under the same three conditions(FS_MOUNTED=0/1/2) and return values are checked. Testcases for FS_MOUNTED=2 have to be updated and added. 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@88 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-014-1/+333
| | | | | | | | | | | | | | | | | | | | | | | | | libcgroup: framework for libcgroup testcases This Patch creates the basic infrastructure for libcgroup testcases. This patch adds a script which runs the binary(C) file. The script does all the environment setup to run the tests and passes this info to the C file through command line arguments. The binary runs the test cases calling the API's in different environment conditions. The Makefile compiles the test. The top level Makefile.in is edited to support make test make testclean The script runs this binary total 3 times, each time with diff varaible. FS_MOUNTED=0 # cgroup fs not mounted FS_MOUNTED=1 # cgroup fs mounted FS_MOUNTED=2 # cgroup fs mounted at multiple points 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@87 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Missed some files while trying to commit the test cases to trunk.Dhaval Giani2008-07-011-9/+0
| | | | | | | | | Reverting that change, and trying again. Signed-off-by: Dhaval Giani <dhaval@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@86 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* From: Sudhir Kumar <skumar@linux.vnet.ibm.com>Dhaval Giani2008-07-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | libcgroup: framework for libcgroup testcases This Patch creates the basic infrastructure for libcgroup testcases. This patch adds a script which runs the binary(C) file. The script does all the environment setup to run the tests and passes this info to the C file through command line arguments. The binary runs the test cases calling the API's in different environment conditions. The Makefile compiles the test. The top level Makefile.in is edited to support make test make testclean The script runs this binary total 3 times, each time with diff varaible. FS_MOUNTED=0 # cgroup fs not mounted FS_MOUNTED=1 # cgroup fs mounted FS_MOUNTED=2 # cgroup fs mounted at multiple points 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@85 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Fix api.c warnings, include wrapper.c in Makefile. More changes toBalbir Singh2008-05-301-1/+2
| | | | | | | | | | | spec file based on bugzilla input. Removed %makeinstall Signed-off-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/tags/v0.1b@67 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Add v0.1b tagBalbir Singh2008-05-242-38/+24
| | | | git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/tags/v0.1b@49 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Multiple mount point support. Patches built on top of Dhaval'a patches.Balbir Singh2008-05-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Works for me on my testing. NOTE: The testing is insufficient as we only test cg_control_create_cgroup() and not delete_cgroup() or attach_task(). Sudhir's new test cases should really help Several coding style fixes and changes, enhancements to make the code work. NOTE: Since this is development release -DDEBUG is back in the makefile. Once this is committed, I'll bump up the version to 0.05 if no one objects. Test report ----------- debug log from the library matched cpuacct:cpuacct Found cgroup option rw,relatime,cpuacct, count 0 matched cpu:cpu Found cgroup option rw,relatime,cpu, count 1 tuid 0, tgid 0, cuid 1000, cgid 1000 path is /tmp/container_cpu/database/ path is /tmp/container_cpuacct/database/ NOTE: The database directory was created as expected on both mount points /tmp/container_cpu and /tmp/container_cpuacct balbir@localhost:~/deliverables/nextgen/libcg/branches/balbir/tests$ ls -al /tmp/container_cpuacct/ total 424 drwxrwxrwt 5 root root 0 2008-05-17 21:27 . drwxrwxrwt 32 root root 425984 2008-05-17 21:26 .. drwxr-xr-x 2 root root 0 2008-05-17 17:09 class1 drwxr-xr-x 2 balbir balbir 0 2008-05-17 17:09 class2 -rw-r--r-- 1 root root 0 2008-05-17 17:09 cpuacct.usage drwxr-xr-x 2 balbir balbir 0 2008-05-17 21:27 database -rw-r--r-- 1 root root 0 2008-05-17 17:09 notify_on_release -rw-r--r-- 1 root root 0 2008-05-17 17:09 releasable -rw-r--r-- 1 root root 0 2008-05-17 17:09 release_agent -rwxrwxrwx 1 root root 0 2008-05-17 17:09 tasks balbir@localhost:~/deliverables/nextgen/libcg/branches/balbir/tests$ ls -al /tmp/container_cpu total 424 drwxrwxrwt 5 root root 0 2008-05-17 21:27 . drwxrwxrwt 32 root root 425984 2008-05-17 21:26 .. drwxr-xr-x 2 root root 0 2008-05-17 17:09 class1 drwxr-xr-x 2 balbir balbir 0 2008-05-17 17:09 class2 -rw-r--r-- 1 root root 0 2008-05-17 17:09 cpu.rt_runtime_us -rw-r--r-- 1 root root 0 2008-05-17 17:09 cpu.shares drwxr-xr-x 2 balbir balbir 0 2008-05-17 21:27 database -rw-r--r-- 1 root root 0 2008-05-17 17:09 notify_on_release -rw-r--r-- 1 root root 0 2008-05-17 17:09 releasable -rw-r--r-- 1 root root 0 2008-05-17 17:09 release_agent -rwxrwxrwx 1 root root 0 2008-05-17 21:10 tasks Signed-off-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/branches/balbir@30 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Merge with Dhaval's branchBalbir Singh2008-05-111-3/+0
| | | | | | | | | Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@26 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* use getgrnam() for groupsBalbir Singh2008-04-161-6/+7
| | | | | | | | | Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@17 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* api.c | 23 +++++++++++++++--------Balbir Singh2008-04-161-1/+1
| | | | | | | | | | | | | | libcg.h | 4 ++-- tests/libcg_ba.cpp | 2 +- Added additional parameters for create and destroy cgroup. Fixed a cg_init segfault (faulty, if-else check) Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@15 4f4bb910-9a46-0410-90c8-c897d4f1cd53
* Several bug fixes, some API enhancements.Balbir Singh2008-04-112-0/+136
The first basic acceptance test is under development and first prototype is released api.c | 161 +++++++++++++++++++++++++++++++++++++++++++---------- libcg.h | 14 +--- tests/Makefile | 9 ++ tests/libcg_ba.cpp | 127 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 274 insertions(+), 37 deletions(-) Signed-off-by: Balbir Singh <balbir@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/branches/balbir@12 4f4bb910-9a46-0410-90c8-c897d4f1cd53