summaryrefslogtreecommitdiffstats
path: root/tests/libcgrouptest01.c
diff options
context:
space:
mode:
authorBalbir Singh <balbir@linux.vnet.ibm.com>2008-12-17 15:22:50 +0000
committerBalbir Singh <balbir@linux.vnet.ibm.com>2008-12-17 15:22:50 +0000
commited931c233d9b4d8064ec0a7176b309b5643b6271 (patch)
tree61c4da2c6102312e6c04ca4e81a03142be774b7d /tests/libcgrouptest01.c
parentd335dc3def8568d7b2518d4c037cdce89da4ee29 (diff)
downloadlibcg-ed931c233d9b4d8064ec0a7176b309b5643b6271.tar.gz
libcg-ed931c233d9b4d8064ec0a7176b309b5643b6271.tar.xz
libcg-ed931c233d9b4d8064ec0a7176b309b5643b6271.zip
libcgroup Test: address earlier comments
This patch addresses the comments on testcases sent earlier. Some of the corrections have been made in the coming patches which create functions to test an api under different scenarios. The simple reason behind that is to avoid the patches that contain only noise. For ex const strn* warnings. I got one of the comments from Balbir Singh "I wonder if we should also verify the cgroup_modify_cgroup() changes by reading back the values using cgroup_get_cgroup()" I have not used this approach for now because of two reasons(however it would have made life easy for me :)) 1. In case cgroup_get_cgroup() fails, cgroup_modify_cgroup() test also will fail. 2. If cgroup_get_cgroup() becomes deprecated or dropped, then the testcase will become obsolete. However I am still open to the idea. Your thoughts again?? Second comment was "Each test case needs to be an induvidual function (can be called from threads or other processes via a library interface)" And the coming patches do that. The next imp comment for me was "I'll try and find a good test case infrastructure, if one exists that can meet our needs." I am eager to see some tool like that. TODO: Removing the hard coding of control values using config file is under progress Signed-off-by: Sudhir Kumar <skumar@linux.vnet.ibm.com> git-svn-id: https://libcg.svn.sourceforge.net/svnroot/libcg/trunk@277 4f4bb910-9a46-0410-90c8-c897d4f1cd53
Diffstat (limited to 'tests/libcgrouptest01.c')
-rw-r--r--tests/libcgrouptest01.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/libcgrouptest01.c b/tests/libcgrouptest01.c
index 690b8fe..5439d4f 100644
--- a/tests/libcgrouptest01.c
+++ b/tests/libcgrouptest01.c
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
strncpy(mountpoint, argv[4], sizeof(mountpoint));
dbg("C:DBG: mountpoint1 as recieved from script=%s\n",
mountpoint);
- if (fs_mounted == 2) {
+ if (fs_mounted == FS_MULTI_MOUNTED) {
strncpy(mountpoint2, argv[5], sizeof(mountpoint2));
dbg("C:DBG: mountpoint2 as recieved from script=%s\n",
mountpoint2);
@@ -1275,12 +1275,12 @@ static inline void build_path(char *target, char *mountpoint,
strncpy(target, mountpoint, FILENAME_MAX);
if (group) {
- strncat(target, "/", sizeof("/"));
+ strncat(target, "/", FILENAME_MAX);
strncat(target, group, FILENAME_MAX);
}
if (file) {
- strncat(target, "/", sizeof("/"));
+ strncat(target, "/", FILENAME_MAX);
strncat(target, file, FILENAME_MAX);
}
}