On Wed, Jan 07, 2009 at 11:35:21PM +0530, Sudhir Kumar wrote:
> This is a try to use a sample configuration file for running libcgroup
> testing. The patch attaches a sample configuration file to be used. The
> plan for testing each input api is to run a particular funcition with
> respect to that api. The function is supposed to test all possible
> scenarios for that api.(e.g. calling api without initializing cgroup,
> with diff invalid/NULL parameters, calling it twice etc).
> 
> I have couple of doubts with respect to the implementation:
> 1. How should the test be run? A script running the binary or just
> binary?
> 1a. If only binary then we may need a small string library as there
>       will be lot of string manipulations while parsing.
> 1b. If a script then how to fill data structure of binary if we parse in
>       script.
> 
> 2. How to ensure a clean state of the system in case of some failure.
> 3. Shall I put separate options in .conf file for no,single and
> multimount.
> 4. I am thinking to take input from user for the number of instances of
> test to be run. For ex if I say 
> api,cgroup_create_cgroup,15
> then there will be 15 tasks in the task list running the corresponding
> function. Is that good?
> 5. Any other fields that need to be added.
> 
> 
> This patch adds the sample configuration file for testing.
> 
> Signed-off-by: Sudhir Kumar <[email protected]>
> 
> ---
>  tests/sampletest.conf |   63 
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 63 insertions(+)
> 
> Index: trunk/tests/sampletest.conf
> ===================================================================
> --- /dev/null
> +++ trunk/tests/sampletest.conf
> @@ -0,0 +1,63 @@
> +#######################################################################
> +# Copyright IBM Corporation. 2009
> +#
> +# Author:    Sudhir Kumar <[email protected]>
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of version 2.1 of the GNU Lesser General
> +# Public License as published by the Free Software Foundation.
> +#
> +# This program is distributed in the hope that it would be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> +#
> +# Description: This is a sample configuration file that will be used
> +# by the test driver for testing libcgroup apis.
> +#######################################################################
> +
> +# If you are editing this file, it is assumed that you know what you
> +# are doing. Leave the file unchanged for a default run provided the
> +# below mentioned controllers are enabled in your kernel
> +
> +# configuration file format
> +# A "#" means it is a comment and hence ignored
> +# "," is a field separator
> +# no space between fields
> +# empty lines are ignored
> +# Any parsing error will simply stop running the test
> +
> +# Controller info:
> +# controller, name, control file, control values, which value
> +# "controller" is a keyword indicating this is a line with controller info
> +# All 4 formats of control value need to be given
> +# The 4 formats are int64_t, u_int64_t, bool, string
> +# which value is a number between 1-4, to choose 1 out of 4 values

I am not sure I understand the comment. So, 2000 is of type int64_t,
2000 is of type u_int64_t, 1 is of bool and 2000 is of string? I am a
bit confused since I cannot make out what the last 1 is for. (BTW 1 is
not a valid value for the cpu controller).

> +controller,cpu,cpu.shares,2000,2000,1,2000,1
> +
> +# Only 1 control file expected per controller. If a controller has more than
> +# 1 control file each control file needs to be given in a separate line in
> +# the similar format. For example if in the above mentioned case if cpu
> +# controller had 1 more control file then It would have been given as
> +controller,cpu,cpu.hardlimit,10,10,1,10,2
> +

So you will set all the control files that are mentioned in the config
file?

> +# Permissions:
> +# All the four permissions other than root to be used for testing

As in, this should always be non-root?

> +# Sequence is control_uid, control_gid, tasks_uid, tasks_gid
> +# "permission" is a keyword indicating this is a line with permission info
> +permission,0,0,0,0
> +
> +# threads:
> +# threads,50,10
> +# How many threads to be run concurrently
> +# How many iterations of the test need to be run
> +threads,50,10
> +
> +# api
> +# api api_name
> +# An error will occur if there is any typo i.e. parsing error
> +# You can give only one api per line
> +# Giving an api does not mean only that api will be tested. It simply means
> +# that particular api will be tested with special focus under different
> +# scenarios, while other apis too will also be called

Can you please elaborate a bit more on special focus, and such?

> +api,cgroup_get_cgroup
> +api,cgroup_modify_cgroup
> 

While the configuration file looks fine, the thing I am worried about
is, are we looking at too much in one place. Do you have some code
parsing this file? I suspect, we will face a few issues with it. But
since you have the disclaimer that "it is assumed you know what you are
doing", we should be OK with it. I was just wondering why you had the no
space restriction. I feel it might be easier for you to parse with
spaces, but then again, it would be better to see an implementation.

thanks,
-- 
regards,
Dhaval

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to