Hi Peter,

On Sun, 2008-11-02 at 08:38 +0800, Peter Teoh wrote:
> On Sun, Nov 2, 2008 at 1:25 AM, Rishikesh K. Rajak
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi veerendra,
> >
> > Thanks for patch. And apologies for delay as i could not review because i
> > was busy with some other stuffs.
> >
> > Just have one Q: How this testcase ( pidns04.c ) is different from pidns01.c
> > which is already with LTP ?
> > >From my point of view it is quite similar. If some enhancement is require
> > we can modify pidns01.c itself. No need to add separate .c file.
> >
> > And FYI, I am getting failure as below with latest kernel. Is it expected
> > behavior ?
> >
> > x330a:~/ltp-full-20081031 # ./testcases/kernel/containers/pidns/pidns04
> > pid_namespace4    0  INFO  :  PIDNS test is running inside container
> > pid_namespace4    1  FAIL  :  Container init is killed by SIGKILL !!!
> > pid_namespace4    2  FAIL  :  Container init pid got killed by signal 9
> > x330a:~/ltp-full-20081031 # strace
> > ./testcases/kernel/containers/pidns/pidns04
> > execve("./testcases/kernel/containers/pidns/pidns04",
> > ["./testcases/kernel/containers/pi"...], [/* 55 vars */]) = 0
> > brk(0)                                  = 0x8053000
> > access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
> > directory)
> > open("/etc/ld.so.cache", O_RDONLY)      = 3
> > fstat64(3, {st_mode=S_IFREG|0644, st_size=55281, ...}) = 0
> > mmap2(NULL, 55281, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fdd000
> > close(3)                                = 0
> > open("/lib/libc.so.6", O_RDONLY)        = 3
> > read(3,
> > "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`h\1\0004\0\0\0@"..., 512) =
> > 512
> > fstat64(3, {st_mode=S_IFREG|0755, st_size=1415512, ...}) = 0
> > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> > 0xb7fdc000
> > mmap2(NULL, 1414736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) =
> > 0xb7e82000
> > fadvise64(3, 0, 1414736, POSIX_FADV_WILLNEED) = 0
> > mmap2(0xb7fd6000, 12288, PROT_READ|PROT_WRITE,
> > MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x154) = 0xb7fd6000
> > mmap2(0xb7fd9000, 9808, PROT_READ|PROT_WRITE,
> > MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7fd9000
> > close(3)                                = 0
> > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> > 0xb7e81000
> > set_thread_area({entry_number:-1 -> 6, base_addr:0xb7e816c0, limit:1048575,
> > seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1,
> > seg_not_present:0, useable:1}) = 0
> > open("/dev/urandom", O_RDONLY)          = 3
> > read(3, "\224\21\256\4"..., 4)          = 4
> > close(3)                                = 0
> > mprotect(0xb7fd6000, 8192, PROT_READ)   = 0
> > mprotect(0x804d000, 4096, PROT_READ)    = 0
> > mprotect(0xb8009000, 4096, PROT_READ)   = 0
> > munmap(0xb7fdd000, 55281)               = 0
> > pipe([3, 4])                            = 0
> > brk(0)                                  = 0x8053000
> > brk(0x8078000)                          = 0x8078000
> > clone(pid_namespace4    0  INFO  :  PIDNS test is running inside container
> > child_stack=0x8056fe4, flags=0x20000000|SIGCHLD) = 19610
> > wait4(-1, [{WIFSIGNALED(s) && WTERMSIG(s) == SIGKILL}], 0, NULL) = 19610
> > --- SIGCHLD (Child exited) @ 0 (0) ---
> > close(4)                                = 0
> > read(3, ""..., 80)                      = 0
> > fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 1), ...}) = 0
> > mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
> > 0xb7fea000
> > write(1, "pid_namespace4    1  FAIL  :  Con"..., 70pid_namespace4    1
> > FAIL  :  Container init is killed by SIGKILL !!!
> > ) = 70
> > write(1, "pid_namespace4    2  FAIL  :  Con"..., 72pid_namespace4    2
> > FAIL  :  Container init pid got killed by signal 9
> > ) = 72
> > exit_group(1)                           = ?
> > x330a:~/ltp-full-20081031 # uname -a
> > Linux x330a 2.6.27.4-2-pae #1 SMP 2008-10-28 22:32:39 +0100 i686 i686 i386
> > GNU/Linux
> > x330a:~/ltp-full-20081031 #
> >
> >
> >
> > - Rishi
> >
> > On Tue, 2008-10-14 at 11:27 +0530, Veerendra wrote:
> >
> > Hi
> >
> >    Attaching the patch for the testcase on PIDNS.
> >
> > Assertion:
> > 1. kill -9 1 from inside a container does not kill container
> > Steps:
> > a) create container
> > b) kill -9 1
> > c) Should not kill the containers
> >
> > Test Result: Currently this is failing, which eventually be passed.
> >
> > # ./pidns04
> > pid_namespace4    0  INFO  :  PIDNS test is running inside container
> > pid_namespace4    1  FAIL  :  Container init is killed by SIGKILL !!!
> > pid_namespace4    2  FAIL  :  Container init pid got killed by signal 9
> >
> > Regards
> > Veerendra C
> 
> This is my first post here, please forgive me if anything is wrong.
> 
> Qs:
> 
> 1.   Does the testcase itself check for containers namespace built
> into the kernel?   I don't see test_containers.sh checking for
> this....should it be done here?   (or can it be done at all?)   but
> since many userspace application using this feature will need to check
> for this, it should be a testcase by itself?

See these:

http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/containers/check_for_unshare.c,
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/containers/netns/check_netns_enabled.c,
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/containers/pidns/check_pidns_enabled.c,
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/containers/sysvipc/check_ipcns_enabled.c,
 &
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/containers/utsname/check_utsns_enabled.c


> 2.   As a comment, it will be good if references can be made on how to
> set up the test scenario......which seemingly is not present in many
> of the scripts.   For eg, for containers, I can find this:
> 
> http://lxc.sourceforge.net/network/configuration.php
> 
> on how to setup/built the containers namespace, but then again not
> sure if it is updated or not.   (kernel features evolved very fast, so
> the dilemma is that it is hard to keep tract too....)....i guessed
> this will never be possible.....
> 

You need to build the kernel with certain options, to enable the
CONTAINERS features, info which is available at:

http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/containers/README,
 &
http://ltp.cvs.sourceforge.net/viewvc/*checkout*/ltp/ltp/README.

Regards--
Subrata

> THanks.
> 
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to