History log of /external/ltp/testcases/kernel/containers/pidns/pidns03.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c1b438d4e1091d0e37da5ab0cdeacd51af3ba5eb 09-May-2017 Helge Deller <deller@gmx.de> Add terminating NUL after calling readlink()

readlink() does not append a NUL byte to the target buffer. Fix it in
the pidns03 and fsstress testcases to avoid wrong test results.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
38e181cbc686d59dcfd1b1b90ee0d8e5f1dd7505 25-Jul-2016 Cyril Hrubis <chrubis@suse.cz> containers,tomoyo: Fix order of included headers

Since the test.h defined clone(...) macro in order to avoid direct use
of the function it has to be included after all system headers,
otherwise the definition of clone() function in sched.h will be replaced
as well.

This wasn't the case for most of the containers/*/*.c testcases which
included test.h followed by foo_helper.h header that included sched.h.
The code in question compiled by a pure luck as the clone function
definition was replaced by a garbage which had been syntactically
correct.

This patch moves the test.h header after the foo_helper.h and also
removes a few duplicated includes as well.

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
d1e794d62b1bf619df8390535e4c2a58899b1145 30-Jul-2015 Cyril Hrubis <chrubis@suse.cz> lib: Get rid of unused tst_require_root() callback

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
d832cc184604c4e744f30fc819928175c6366317 26-Jun-2015 Yuan Sun <sunyuan3@huawei.com> pidns: Update TCID from pid_namespace to pidns.

Signed-off-by: Yuan Sun <sunyuan3@huawei.com>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
d6d11d08678aac1ed2c370ea8e42e5f45aea07be 09-Mar-2015 Cyril Hrubis <chrubis@suse.cz> Introduce tst_parse_opts()

The pattern that was used in all testcases is:

const char *msg;

msg = parse_opts(...);
if (msg)
tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);

This change simplifies the steps to just calling:

tst_parse_opts(...);

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
aabb8340f63ed31afe995fd97795e542dc68b93c 04-Feb-2015 Cyril Hrubis <chrubis@suse.cz> Include usctest.h in test.h

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
ed991ae835a3a59fe7c3f08c076b8805be79148d 29-Jul-2014 Jan Stancek <jstancek@redhat.com> extract pidns tests from runpidnstest.sh to runtest/containers

Extract pinds testcases from container_test.sh and list
all separately in containers runtest.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
fd5e693b8802792c3be8b0ba15911b4ac4b2ca03 25-Jul-2014 Matus Marhefka <mmarhefk@redhat.com> containers: added pidns/pidns03.c

* Clones a new child process with CLONE_NEWPID flag - the new child
* process mounts procfs to a "proc" directory and checks if it belongs
* to a new pid namespace by:
* 1. reading value of "proc/self", which is symlink
* to directory named after current pid number
* 2. comparing read value (PID) with "1"

Signed-off-by: Matus Marhefka <mmarhefk@redhat.com>
Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
Reviewed-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
b47b875e00fbea4bb3398ac2f3ef4b4dd32826f0 16-Aug-2010 Subrata Modak <subratamodak@subratamodak.linux.ibm.com> drop test pidns03 ?
I am not sure about the original intent of pidns03 test case but I think the test is expected to fail :-( The header for this test says:
* Verify that:
* 1. When parent, clone a process with flag CLONE_NEWPID, see the
* process id of the parent is existing after mounting /proc

The test passes in the parent-pid from init-pid-ns and looks for that pid in the child's mount of /proc. But for the CLONE_NEWPID child, parent process should appear to have a pid == 0. The pid of the parent in the initial pid namespace must NOT be visible to the child - in fact a different process can have that pid.
I am not surprised the test fails - I am curious to know the version of the kernel when this test reliably passed - if at all. I tried this on 2.6.29 and 2.6.34-rc5 and it fails reliably.
I dug through my history and see that this test was part of a 6-patch set, We did have some comments on the coding style on the set, but we seem to have missed the intent of this test :-(.
Do we have any other history of this test ? If not, I think we should either drop the test or modify the test to verify the opposite (i.e. verify that the opendir() in the test fails with ENOENT). Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>, Signed-off-by: Subrata Modak <subrata@linux.vnet.ibm.com>,
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
7f140ab215a66e7ed9a195591b756cf6cdfde38c 06-Dec-2009 yaberauneya <yaberauneya> Polish up clean logic a bit further. Later versions of gcc (rightfully) whine more about function attributes, et all.

Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
b15aafd4f07a07e790ac504343cf8d9bd77963af 20-Oct-2008 subrata_modak <subrata_modak> Hi,

This patch fixes most of warnings and badness including the following,

libnetns.c: In function ‘create_net_namespace’:
libnetns.c:65: warning: implicit declaration of function ‘tst_kvercmp’
shmnstest.c: In function ‘main’:
shmnstest.c:71: warning: unused variable ‘pid’
pidns03.c: In function ‘main’:
pidns03.c:83: warning: passing argument 4 of ‘do_clone_unshare_test’ makes pointer from integer
without a cast
cpuctl_test01.c: In function ‘main’:
cpuctl_test01.c:133: warning: implicit declaration of function ‘open’
cpuctl_test01.c:195: warning: unknown conversion type character ‘)’ in format
cpuctl_test01.c:195: warning: unknown conversion type character ‘)’ in format
cpuctl_test02.c: In function ‘main’:
cpuctl_test02.c:146: warning: implicit declaration of function ‘open’
cpuctl_test02.c:207: warning: unknown conversion type character ‘)’ in format
cpuctl_test02.c:207: warning: unknown conversion type character ‘)’ in format
cpuctl_test02.c:207: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 8 has
type ‘unsigned int’
cpuctl_test03.c: In function ‘main’:
cpuctl_test03.c:144: warning: implicit declaration of function ‘open’
cpuctl_test03.c:205: warning: unknown conversion type character ‘)’ in format
cpuctl_test03.c:205: warning: unknown conversion type character ‘)’ in format
cpuctl_test04.c: In function ‘main’:
cpuctl_test04.c:147: warning: implicit declaration of function ‘open’
cpuctl_test04.c:208: warning: unknown conversion type character ‘)’ in format
cpuctl_test04.c:208: warning: unknown conversion type character ‘)’ in format
cpuctl_test04.c:208: warning: format ‘%3lu’ expects type ‘long unsigned int’, but argument 8 has
type ‘unsigned int’
memctl_test01.c: In function ‘allocate_memory’:
memctl_test01.c:171: warning: assignment from incompatible pointer type
doio.c: In function ‘main’:
doio.c:477: warning: ‘sigblock’ is deprecated (declared at /usr/include/signal.h:181)
growfiles.c: In function ‘growfile’:
growfiles.c:2064: warning: pointer targets in passing argument 2 of ‘databingen’ differ in
signedness
growfiles.c:2066: warning: pointer targets in passing argument 2 of ‘databingen’ differ in
signedness
growfiles.c:2068: warning: pointer targets in passing argument 2 of ‘databingen’ differ in
signedness
growfiles.c:2070: warning: pointer targets in passing argument 2 of ‘databingen’ differ in
signedness
growfiles.c:2072: warning: pointer targets in passing argument 2 of ‘databingen’ differ in
signedness
growfiles.c:2074: warning: pointer targets in passing argument 2 of ‘databingen’ differ in
signedness
childmain.c: In function ‘ChildMain’:
childmain.c:551: warning: cast to pointer from integer of different size
childmain.c:559: warning: cast to pointer from integer of different size
childmain.c:569: warning: cast to pointer from integer of different size
childmain.c:838: warning: cast to pointer from integer of different size
dump.c: In function ‘format_str’:
dump.c:54: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
dump.c:55: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:55: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:55: warning: pointer targets in passing argument 2 of ‘__builtin_strncat’ differ in
signedness
dump.c:57: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:57: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:58: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:58: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:59: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
dump.c:60: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:60: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:60: warning: pointer targets in passing argument 2 of ‘__builtin_strncat’ differ in
signedness
dump.c:63: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:63: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:64: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:64: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:65: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:65: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:67: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:67: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:69: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
dump.c:70: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:70: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:70: warning: pointer targets in passing argument 2 of ‘__builtin_strncat’ differ in
signedness
dump.c: In function ‘format_raw’:
dump.c:91: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
dump.c:92: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:92: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:92: warning: pointer targets in passing argument 2 of ‘__builtin_strncat’ differ in
signedness
dump.c:94: warning: pointer targets in passing argument 1 of ‘sprintf’ differ in signedness
dump.c:95: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
dump.c:95: warning: pointer targets in passing argument 1 of ‘__builtin_strncat’ differ in
signedness
dump.c:95: warning: pointer targets in passing argument 2 of ‘__builtin_strncat’ differ in
signedness
main.c: In function ‘threadedMain’:
main.c:258: warning: cast to pointer from integer of different size
main.c:259: warning: cast to pointer from integer of different size
main.c:266: warning: cast to pointer from integer of different size
main.c:365: warning: cast to pointer from integer of different size
timer.c: In function ‘ChildTimer’:
timer.c:196: warning: cast to pointer from integer of different size
signal_test_01.c: In function ‘main’:
signal_test_01.c:195: warning: ‘sigsetmask’ is deprecated (declared at /usr/include/signal.h:184)
signal_test_01.c:232: warning: ‘sigblock’ is deprecated (declared at /usr/include/signal.h:181)
signal_test_03.c: In function ‘main’:
signal_test_03.c:119: warning: ‘sigblock’ is deprecated (declared at /usr/include/signal.h:181)
signal_test_03.c:144: warning: ‘sigsetmask’ is deprecated (declared at /usr/include/signal.h:184)
libipc.c: In function ‘init_buf’:
libipc.c:120: warning: cast from pointer to integer of different size
mallocstress.c: In function ‘alloc_mem’:
mallocstress.c:272: warning: cast from pointer to integer of different size
mallocstress.c:275: warning: cast from pointer to integer of different size
mallocstress.c:276: warning: cast to pointer from integer of different size
mallocstress.c: In function ‘main’:
mallocstress.c:316: warning: cast from pointer to integer of different size
mallocstress.c:327: warning: cast from pointer to integer of different size
mallocstress.c:368: warning: cast to pointer from integer of different size
shm_test.c: In function ‘shmat_rd_wr’:
shm_test.c:207: warning: cast to pointer from integer of different size
shm_test.c:221: warning: cast to pointer from integer of different size
shm_test.c:266: warning: cast to pointer from integer of different size
shm_test.c:270: warning: cast to pointer from integer of different size
shm_test.c: In function ‘main’:
shm_test.c:315: warning: cast from pointer to integer of different size
shm_test.c:326: warning: cast from pointer to integer of different size
pthserv.c: In function ‘main’:
pthserv.c:146: warning: pointer targets in passing argument 3 of ‘accept’ differ in signedness
pthserv.c:156: warning: cast to pointer from integer of different size
trace_sched.c: In function ‘get_proc_num’:
trace_sched.c:154: warning: cast from pointer to integer of different size
trace_sched.c: In function ‘main’:
trace_sched.c:348: warning: cast from pointer to integer of different size
trace_sched.c:381: warning: cast from pointer to integer of different size
check_simple_capset.c:23:28: error: sys/capability.h: No such file or directory
check_simple_capset.c: In function ‘main’:
check_simple_capset.c:27: error: ‘cap_t’ undeclared (first use in this function)
check_simple_capset.c:27: error: (Each undeclared identifier is reported only once
check_simple_capset.c:27: error: for each function it appears in.)
check_simple_capset.c:27: error: expected ‘;’ before ‘caps’
check_simple_capset.c:30: error: ‘caps’ undeclared (first use in this function)
check_simple_capset.c:31: error: ‘caps2’ undeclared (first use in this function)
clone03.c: In function ‘main’:
clone03.c:138: warning: cast from pointer to integer of different size
clone04.c: In function ‘main’:
clone04.c:147: warning: cast from pointer to integer of different size
clone06.c: In function ‘main’:
clone06.c:143: warning: cast from pointer to integer of different size
fmtmsg01.c: In function ‘clearbuf’:
fmtmsg01.c:82: warning: cast from pointer to integer of different size
libipc.c: In function ‘init_buf’:
libipc.c:116: warning: cast from pointer to integer of different size
msgget01.c: In function ‘check_functionality’:
msgget01.c:144: warning: cast from pointer to integer of different size
lib.c: In function ‘test_ENAMETOOLONG_path’:
lib.c:224: warning: cast from pointer to integer of different size
lib64.c: In function ‘test_ENAMETOOLONG_path’:
lib64.c:224: warning: cast from pointer to integer of different size
endian_switch01.c:64: warning: ‘setup’ defined but not used
crash01.c: In function ‘badboy_loop’:
crash01.c:344: warning: pointer targets in passing argument 1 of ‘castaway’ differ in signedness
crash01.c: In function ‘compute_badboy’:
crash01.c:529: warning: pointer targets in passing argument 1 of ‘castaway’ differ in signedness
crash01.c:537: warning: pointer targets in passing argument 1 of ‘castaway’ differ in signedness
crash01.c:543: warning: pointer targets in passing argument 1 of ‘castaway’ differ in signedness
netsync.c: In function ‘setupConnectionServeur’:
netsync.c:80: warning: pointer targets in passing argument 3 of ‘accept’ differ in signedness
test_1_to_1_threads.c: In function ‘main’:
test_1_to_1_threads.c:177: warning: cast to pointer from integer of different size
test_sctp_sendrecvmsg.c: In function ‘main’:
test_sctp_sendrecvmsg.c:150: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ
in signedness
test_sctp_sendrecvmsg.c:224: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ
in signedness
test_timetolive.c: In function ‘main’:
test_timetolive.c:152: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ in
signedness
test_timetolive.c:260: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ in
signedness
test_sctp_sendrecvmsg.c: In function ‘main’:
test_sctp_sendrecvmsg.c:150: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ
in signedness
test_sctp_sendrecvmsg.c:224: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ
in signedness
test_timetolive.c: In function ‘main’:
test_timetolive.c:152: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ in
signedness
test_timetolive.c:260: warning: pointer targets in passing argument 5 of ‘getsockopt’ differ in
signedness
ltpClient.c: In function ‘network_listener’:
ltpClient.c:377: warning: pointer targets in passing argument 6 of ‘recvfrom’ differ in signedness
ltpClient.c: In function ‘ping_network’:
ltpClient.c:507: warning: pointer targets in passing argument 6 of ‘recvfrom’ differ in signedness
ltpClient.c: In function ‘ltp_traceroute’:
ltpClient.c:596: warning: pointer targets in passing argument 6 of ‘recvfrom’ differ in signedness
ltpServer.c: In function ‘ltp_udp_server_queue’:
ltpServer.c:235: warning: pointer targets in passing argument 6 of ‘recvfrom’ differ in signedness
ltpServer.c: In function ‘ltp_tcp_server_queue’:
ltpServer.c:268: warning: pointer targets in passing argument 3 of ‘accept’ differ in signedness
ltpServer.c: In function ‘tcp_receive_buffer’:
ltpServer.c:318: warning: pointer targets in passing argument 6 of ‘recvfrom’ differ in signedness
ltpServer.c: In function ‘ltp_multi_server_queue’:
ltpServer.c:383: warning: pointer targets in passing argument 6 of ‘recvfrom’ differ in signedness
Compiled successfully on Fedora 10 Beta x86_64.
Signed-off-by: CAI Qian <caiqian@cclom.cn>.
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
a2af6a3ca488e0f05a7fe93d219426ca73383ef0 15-Oct-2008 subrata_modak <subrata_modak> If we unshare pidns without unsharing mounts namespace, and then do a mount -t proc none /proc, then the new proc sits over the original proc for the whole system. Since pidns03 wasn't using CLONE_NEWNS, when it exited /proc showed zero tasks. This can be fixed by doing 'umount -l /proc', but 'umount /proc' is insufficient. More to the point, pidns03 wasn't trying to clean up /proc at all. So make it use CLONE_NEWNS so its private procfs will be automatically cleaned up. Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>.
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
cd92d5436afb7bfd6e5a2861913afab7519386ed 08-Sep-2008 subrata_modak <subrata_modak> Now that they are in it's best to drop the noltp junk leftover from the LTP port of the container tests.
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>,
Acked-by: Serge Hallyn <serue@us.ibm.com>.
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
1e9d84b1c4da16705e6c67baa46e250a9d5fa66c 06-Feb-2008 subrata_modak <subrata_modak> Some code cleanup in PID & SYSVIPC namespace testcases, by, "Rishikesh K. Rajak" <risrajak@linux.vnet.ibm.com>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c
c7d5c36eaaa959644ccb424962db5d1b99ff0ab0 28-Dec-2007 subrata_modak <subrata_modak> Initial set of PID Namespace testcase contributed by "Rishikesh K. Rajak" <risrajak@linux.vnet.ibm.com>
/external/ltp/testcases/kernel/containers/pidns/pidns03.c