You can subscribe to this list here.
2010 |
Jan
|
Feb
|
Mar
(16) |
Apr
(25) |
May
(8) |
Jun
(22) |
Jul
(71) |
Aug
(36) |
Sep
(22) |
Oct
(31) |
Nov
(88) |
Dec
(40) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2011 |
Jan
(128) |
Feb
(35) |
Mar
(28) |
Apr
(33) |
May
(18) |
Jun
(8) |
Jul
(21) |
Aug
(18) |
Sep
(6) |
Oct
(19) |
Nov
(12) |
Dec
(44) |
2012 |
Jan
(31) |
Feb
(48) |
Mar
(31) |
Apr
(11) |
May
(13) |
Jun
(15) |
Jul
(13) |
Aug
(18) |
Sep
(7) |
Oct
(25) |
Nov
(21) |
Dec
(13) |
2013 |
Jan
(17) |
Feb
(18) |
Mar
(21) |
Apr
(35) |
May
(30) |
Jun
(4) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(30) |
Nov
(13) |
Dec
|
From: Subrata <ris...@li...> - 2010-06-02 12:48:34
|
The branch, master, has been updated via 7f20a3add6c7f2166dbab5a712713ae8b5943448 (commit) via 76ec975d298e3890a4ab2f9471940e164de0c643 (commit) from 91f337f9ee05b028af8506c7e83dc1b8c23a3b32 (commit) - Log ----------------------------------------------------------------- commit 7f20a3add6c7f2166dbab5a712713ae8b5943448 Author: Subrata Modak <sub...@su...> Date: Wed Jun 2 18:16:46 2010 +0530 Fix ext4_subdir_limit fix: We get the following error results since the if condition in ext4_subdir_limit_tset.sh does not work fine. The patch fixes this issue. [root@bsd086 ltp]# ./runltp -f fs_ext4 <snip> Ext4 subdir limit test ext4-subdir-limit 0 TINFO : Num of dirs to create: 65537, Dir name len: long name, mkdir: No space left on device ext4-subdir-limit 2 TFAIL : failed to create directories - 19118 <snip> ext4-subdir-limit 0 TINFO : Num of dirs to create: 65537, Dir name len: long name, mkdir: No space left on device ext4-subdir-limit 4 TFAIL : failed to create directories - 19592 Signed-off-by: Akira Fujita <a-f...@rs...>, commit 76ec975d298e3890a4ab2f9471940e164de0c643 Author: Subrata Modak <sub...@su...> Date: Wed Jun 2 18:15:19 2010 +0530 Fix for UTIMENSAT test fails hugely: This patch installs the trap for cleanup_test which removes the sudoers file only if it was installed by utimensat script, and also takes care of detecting whether sudo knows about the -n option. Signed-Off-By: <hy...@mv...>. ----------------------------------------------------------------------- Summary of changes: .../ext4-subdir-limit/ext4_subdir_limit_test.sh | 3 +- .../kernel/syscalls/utimensat/utimensat_tests.sh | 51 +++++++++++++++----- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh index 5631fe5..f0a3b50 100755 --- a/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh +++ b/testcases/kernel/fs/ext4-new-features/ext4-subdir-limit/ext4_subdir_limit_test.sh @@ -152,7 +152,8 @@ for ((i = 0; i < 3; i++)) { for ((k = 0; k < 2; k++)) { - if [ $i -eq $LONG_DIR -a $k -eq 1024 ]; then + if [ ${DIR_LEN[$k]} -eq $LONG_DIR -a \ + ${BLOCK_SIZE[$i]} -eq 1024 ]; then continue fi ext4_run_case 65537 ${DIR_LEN[$k]} ${PARENT_DIR[$j]} \ diff --git a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh index 87514d8..4246d1a 100644 --- a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh +++ b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh @@ -64,13 +64,13 @@ setup_file() # Make sure any old version of file is deleted if test -e $FILE; then - sudo -n chattr -ai $FILE || return $? - sudo -n rm -f $FILE || return $? + sudo $s_arg chattr -ai $FILE || return $? + sudo $s_arg rm -f $FILE || return $? fi # Create file and make atime and mtime zero. - sudo -n -u $user_tester touch $FILE || return $? + sudo $s_arg -u $user_tester touch $FILE || return $? if ! $TEST_PROG -q $FILE 0 0 0 0 > $RESULT_FILE; then echo "Failed to set up test file $FILE" 1>&2 exit 1 @@ -86,19 +86,19 @@ setup_file() # Set owner, permissions, and EFAs for file. if test -n "$2"; then - sudo -n chown $2 $FILE || return $? + sudo $s_arg chown $2 $FILE || return $? fi - sudo -n chmod $3 $FILE || return $? + sudo $s_arg chmod $3 $FILE || return $? if test -n "$4"; then - sudo -n chattr $4 $FILE || return $? + sudo $s_arg chattr $4 $FILE || return $? fi # Display file setup, for visual verification ls -l $FILE | awk '{ printf "Owner=%s; perms=%s; ", $3, $1}' - if ! sudo -n lsattr -l $FILE | sed 's/, /,/g' | awk '{print "EFAs=" $2}' + if ! sudo $s_arg lsattr -l $FILE | sed 's/, /,/g' | awk '{print "EFAs=" $2}' then return $? fi @@ -215,7 +215,7 @@ run_test() cp $LTPROOT/testcases/bin/$TEST_PROG ./ CMD="./$TEST_PROG -q $FILE $4" echo "$CMD" - sudo -n -u $user_tester $CMD > $RESULT_FILE + sudo $s_arg -u $user_tester $CMD > $RESULT_FILE check_result $? $5 $6 $7 echo @@ -224,7 +224,7 @@ run_test() setup_file $FILE "$1" "$2" "$3" CMD="./$TEST_PROG -q -d $FILE NULL $4" echo "$CMD" - sudo -n -u $user_tester $CMD > $RESULT_FILE + sudo $s_arg -u $user_tester $CMD > $RESULT_FILE check_result $? $5 $6 $7 echo fi @@ -237,18 +237,43 @@ run_test() setup_file $FILE "$1" "$2" "$3" CMD="./$TEST_PROG -q -w -d $FILE NULL $4" echo "$CMD" - sudo -n -u $user_tester $CMD > $RESULT_FILE + sudo $s_arg -u $user_tester $CMD > $RESULT_FILE check_result $? $5 $6 $7 echo fi - sudo -n chattr -ai $FILE - sudo -n rm -f $FILE + sudo $s_arg chattr -ai $FILE + sudo $s_arg rm -f $FILE +} + +cleanup_test() +{ + if test $sudoers_clean; then + sudo rm -f $sudoers + fi } #===================================================================== user_tester=nobody -sudo -n -u $user_tester mkdir -p $TEST_DIR +echo "test sudo for -n option, non-interactive" +sudo -n true +if test $? -eq 0; then + s_arg="-n" + echo "sudo supports -n" +else + s_arg= + echo "sudo does not support -n" +fi +sudoers=/etc/sudoers +if test ! -e $sudoers +then + echo "root ALL=(ALL) ALL" > $sudoers + sudoers_clean=1 + chmod 440 $sudoers + trap 'trap "" EXIT; cleanup_test' EXIT +fi + +sudo $s_arg -u $user_tester mkdir -p $TEST_DIR cd $TEST_DIR chown root $LTPROOT/testcases/bin/$TEST_PROG chmod ugo+x,u+s $LTPROOT/testcases/bin/$TEST_PROG hooks/post-receive -- ltp |
From: Subrata <ris...@li...> - 2010-05-28 08:07:46
|
The branch, master, has been updated via 91f337f9ee05b028af8506c7e83dc1b8c23a3b32 (commit) via 6a19cb6ea8f0b160438288f87a96f57d8e63aad2 (commit) via 4e94765d753c0ea91b4745ffac30df427a4d9202 (commit) via 82f8e8fdfe892266d7346792b71783ac23bfa1a2 (commit) via e1c39ef4f1d61c05f176d063d1afa6f704bc6740 (commit) via c81df6233bca8b3ad601a3a7dd6c02319a32a76b (commit) via 4aafc2802f0c2c05e4891cea1f721f414b41ac67 (commit) from e75668f99ade62e18e34891b2c522c8d97ee982b (commit) - Log ----------------------------------------------------------------- commit 91f337f9ee05b028af8506c7e83dc1b8c23a3b32 Author: Subrata Modak <sub...@su...> Date: Fri May 28 12:57:36 2010 +0530 fix io_xxxx Makefiles: Makefiles for io_xxx syscall tests contains line: LDFLAGS += $(AIO_LIBS) Which leads to wrong order of flags passed to the linker and compilation failure on certain linux systems. Changing these lines to: LDLIBS += $(AIO_LIBS) Fixes this problem. Patch is attached. Signed-off-by: Cyril Hrubis ch...@su... commit 6a19cb6ea8f0b160438288f87a96f57d8e63aad2 Author: Subrata Modak <sub...@su...> Date: Fri May 28 12:53:59 2010 +0530 It seems like file runtest/fs_perms_simple doesn't made it into ltp-dev git tree (also it seems to be included in the patch). see: http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp-dev.git;a=commit;h=ca758b73afff8200df5e1a24e9abe8a6468c9e06 -- Cyril Hrubis ch...@su... commit 4e94765d753c0ea91b4745ffac30df427a4d9202 Author: Subrata Modak <sub...@su...> Date: Fri May 28 12:50:38 2010 +0530 Timer related syscalls for LTP test: Signed-off-by: Suzuki K P <su...@in...>, Fix timer_t argument for timer related direct syscalls. The tests timer_getoverrun and timer_gettime should be moved to testcases/kernel/timers directory. If that is done, then we could use the definition in the common_timers.h, like the other tests. /* Description */ There is a mismatch in the "timer_t" type defined by the Linux kernel and the GNU Libc. Linux kernel defines it as an int for all architectures. include/linux/types.h : typedef __kernel_timer_t timer_t; arch/powerpc/include/asm/posix_types.h : typedef int __kernel_timer_t; Now, the glibc provides a wrapper to the timer related system calls. While providing the wrapper, Glibc stores some internal data associated with the timer. So it defines the "timer_t" as a pointer (void*) as below: /usr/include/time.h : /* Timer ID returned by `timer_create'. */ typedef __timer_t timer_t; in /usr/include/bits/types.h : /* Timer ID returned by `timer_create'. */ __STD_TYPE __TIMER_T_TYPE __timer_t; in /usr/include/bits/typesizes.h So that leads to the definiton of timer_t as void* by glibc. And this cannot be changed. But the glibc uses the "proper" typed argument for the syscalls it issues by defining a kernel_timer_t. On 32bit machines the difference is not noticed, since both the timer_t in userspace and the kernel space are of the same size. But on 64bit machines this is different. Userspace has a width of 64bit and the kernel has 32bit width. Now, when we pass the pointer to timer_t to the kernel, things get complicated and on Big endian machines, ppc64, s390x, this leads to a problem. As the value kept is not available when we try to dereference it as a 32bit and this leads to undesired results. commit 82f8e8fdfe892266d7346792b71783ac23bfa1a2 Author: Subrata Modak <sub...@su...> Date: Fri May 28 12:45:16 2010 +0530 Following set of patches applies functional changes in pi-tests for better reliability in recent kernels and their order is: [PATCH 1/6] realtime: reuse init_pi_mutex from librttest [PATCH 2/6] realtime: add test descriptions [PATCH 3/6] realtime: threads need not set cpu affinity while main does [PATCH 4/6] realtime: use busy_work_ms from librttest to burn cpu cycles [PATCH 5/6] realtime: remove thread_stop which is not used anywhere [PATCH 6/6] realtime: synchronization fixes for high priority noise thread All need to be applied in their order on top or code clean up patch series sent previously. Signed-off-by: Gowrishankar <gow...@in...>, Tested-by: Gowrishankar <gow...@in...>, Acked-by: Darren Hart <dv...@us...>, commit e1c39ef4f1d61c05f176d063d1afa6f704bc6740 Author: Subrata Modak <sub...@su...> Date: Fri May 28 12:36:06 2010 +0530 realtime: code cleanup on pi-tests to adapt C coding standard: Following bulk of patches applies the coding style in pi-tests to follow the C coding standard. All are tested and they go in order: [PATCH 1/5] realtime: code cleanup on pi-test 0 [PATCH 2/5] realtime: code cleanup on pi-test 1 [PATCH 3/5] realtime: code cleanup on pi-test 2 [PATCH 4/5] realtime: code cleanup on pi-test 5 [PATCH 5/5] realtime: code cleanup on pi-test 6 Signed-off-by: Gowrishankar <gow...@in...>, Tested-by: Gowrishankar <gow...@in...>, Acked-by: John Stultz <joh...@us...>, Acked-by: Darren Hart <dv...@us...>, commit c81df6233bca8b3ad601a3a7dd6c02319a32a76b Author: Subrata Modak <sub...@su...> Date: Fri May 28 12:25:20 2010 +0530 Following patch adds "return NULL;" to the function returning void* in math float tests. This change silences compiler warnings. Signed-off-by: Cyril Hrubis ch...@su.... commit 4aafc2802f0c2c05e4891cea1f721f414b41ac67 Author: Subrata Modak <sub...@su...> Date: Fri May 28 12:22:02 2010 +0530 The mq_timedreceive01.c test defines _XOPEN_SOURCE 500 on the beginning but this causes missing prototypes for seteuid() and mq_timedreceive() as they need _XOPEN_SOURCE >= 600. Following patch fixes that. Signed-off-by: Cyril Hrubis ch...@su.... ----------------------------------------------------------------------- Summary of changes: runtest/fs_perms_simple | 26 ++ testcases/kernel/syscalls/io_cancel/Makefile | 2 +- testcases/kernel/syscalls/io_destroy/Makefile | 2 +- testcases/kernel/syscalls/io_getevents/Makefile | 2 +- testcases/kernel/syscalls/io_setup/Makefile | 2 +- testcases/kernel/syscalls/io_submit/Makefile | 2 +- .../syscalls/mq_timedreceive/mq_timedreceive01.c | 2 +- .../syscalls/timer_getoverrun/timer_getoverrun01.c | 7 +- .../syscalls/timer_gettime/timer_gettime01.c | 7 +- testcases/kernel/timers/include/common_timers.h | 5 + .../kernel/timers/timer_create/timer_create02.c | 2 +- .../kernel/timers/timer_create/timer_create03.c | 2 +- .../kernel/timers/timer_create/timer_create04.c | 6 +- .../kernel/timers/timer_delete/timer_delete02.c | 2 +- .../kernel/timers/timer_delete/timer_delete03.c | 2 +- .../kernel/timers/timer_settime/timer_settime02.c | 2 +- .../kernel/timers/timer_settime/timer_settime03.c | 4 +- testcases/misc/math/float/main.c | 4 +- testcases/realtime/func/pi-tests/testpi-0.c | 67 +++-- testcases/realtime/func/pi-tests/testpi-1.c | 318 +++++++++----------- testcases/realtime/func/pi-tests/testpi-2.c | 318 +++++++++----------- testcases/realtime/func/pi-tests/testpi-5.c | 80 +++--- testcases/realtime/func/pi-tests/testpi-6.c | 76 +++--- 23 files changed, 473 insertions(+), 467 deletions(-) create mode 100644 runtest/fs_perms_simple diff --git a/runtest/fs_perms_simple b/runtest/fs_perms_simple new file mode 100644 index 0000000..cc986bd --- /dev/null +++ b/runtest/fs_perms_simple @@ -0,0 +1,26 @@ +# +# These tests are setting file permissions/group/uid and are trying to +# open/write/execute the file. +# +# +# +# fs_perms file_mode file_uid file_gid test_uid test_gid mode (r|w|x) expected_result +# +fs_perms01 fs_perms 001 99 99 12 100 x 0 +fs_perms02 fs_perms 010 99 99 200 99 x 0 +fs_perms03 fs_perms 100 99 99 99 500 x 0 +fs_perms04 fs_perms 002 99 99 12 100 w 0 +fs_perms05 fs_perms 020 99 99 200 99 w 0 +fs_perms06 fs_perms 200 99 99 99 500 w 0 +fs_perms07 fs_perms 004 99 99 12 100 r 0 +fs_perms08 fs_perms 040 99 99 200 99 r 0 +fs_perms09 fs_perms 400 99 99 99 500 r 0 +fs_perms10 fs_perms 000 99 99 99 99 r 1 +fs_perms11 fs_perms 000 99 99 99 99 w 1 +fs_perms12 fs_perms 000 99 99 99 99 x 1 +fs_perms13 fs_perms 010 99 99 99 500 x 1 +fs_perms14 fs_perms 100 99 99 200 99 x 1 +fs_perms15 fs_perms 020 99 99 99 500 w 1 +fs_perms16 fs_perms 200 99 99 200 99 w 1 +fs_perms17 fs_perms 040 99 99 99 500 r 1 +fs_perms18 fs_perms 400 99 99 200 99 r 1 diff --git a/testcases/kernel/syscalls/io_cancel/Makefile b/testcases/kernel/syscalls/io_cancel/Makefile index 9b6eae8..268d2e7 100644 --- a/testcases/kernel/syscalls/io_cancel/Makefile +++ b/testcases/kernel/syscalls/io_cancel/Makefile @@ -20,6 +20,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -LDFLAGS += $(AIO_LIBS) +LDLIBS += $(AIO_LIBS) include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_destroy/Makefile b/testcases/kernel/syscalls/io_destroy/Makefile index 9b6eae8..268d2e7 100644 --- a/testcases/kernel/syscalls/io_destroy/Makefile +++ b/testcases/kernel/syscalls/io_destroy/Makefile @@ -20,6 +20,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -LDFLAGS += $(AIO_LIBS) +LDLIBS += $(AIO_LIBS) include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_getevents/Makefile b/testcases/kernel/syscalls/io_getevents/Makefile index 9b6eae8..268d2e7 100644 --- a/testcases/kernel/syscalls/io_getevents/Makefile +++ b/testcases/kernel/syscalls/io_getevents/Makefile @@ -20,6 +20,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -LDFLAGS += $(AIO_LIBS) +LDLIBS += $(AIO_LIBS) include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_setup/Makefile b/testcases/kernel/syscalls/io_setup/Makefile index 9b6eae8..268d2e7 100644 --- a/testcases/kernel/syscalls/io_setup/Makefile +++ b/testcases/kernel/syscalls/io_setup/Makefile @@ -20,6 +20,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -LDFLAGS += $(AIO_LIBS) +LDLIBS += $(AIO_LIBS) include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/io_submit/Makefile b/testcases/kernel/syscalls/io_submit/Makefile index 9b6eae8..268d2e7 100644 --- a/testcases/kernel/syscalls/io_submit/Makefile +++ b/testcases/kernel/syscalls/io_submit/Makefile @@ -20,6 +20,6 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk -LDFLAGS += $(AIO_LIBS) +LDLIBS += $(AIO_LIBS) include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c index eb3232f..25f7cb1 100644 --- a/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c +++ b/testcases/kernel/syscalls/mq_timedreceive/mq_timedreceive01.c @@ -45,7 +45,7 @@ /* History: Porting from Crackerjack to LTP is done by */ /* Manas Kumar Nayak mak...@in...> */ /******************************************************************************/ -#define _XOPEN_SOURCE 500 +#define _XOPEN_SOURCE 600 #include <sys/syscall.h> #include <sys/types.h> #include <sys/stat.h> diff --git a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c index e303040..a0112e7 100644 --- a/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c +++ b/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c @@ -49,6 +49,11 @@ #include "usctest.h" #include "linux_syscall_numbers.h" +/* timer_t in kernel(int) is different from Glibc definition(void*). + * Use the kernel definition. + */ +typedef int kernel_timer_t; + /* Extern Global Variables */ extern int Tst_count; /* counter for tst_xxx routines. */ extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ @@ -120,7 +125,7 @@ int block = 1; int main(int ac, char **av) { int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - timer_t created_timer_id; + kernel_timer_t created_timer_id; struct sigevent ev; /* parse standard options */ diff --git a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c index 38262ba..23b269e 100644 --- a/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c +++ b/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c @@ -48,6 +48,11 @@ #include "usctest.h" #include "linux_syscall_numbers.h" +/* timer_t in kernel(int) is different from Glibc definition(void*). + * Use the kernel definition. + */ +typedef int kernel_timer_t; + /* Extern Global Variables */ extern int Tst_count; /* counter for tst_xxx routines. */ extern char *TESTDIR; /* temporary dir created by tst_tmpdir() */ @@ -122,7 +127,7 @@ int main(int ac, char **av) { int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - timer_t created_timer_id; + kernel_timer_t created_timer_id; struct sigevent ev; struct itimerspec spec; diff --git a/testcases/kernel/timers/include/common_timers.h b/testcases/kernel/timers/include/common_timers.h index d9b7cb9..30d2dca 100644 --- a/testcases/kernel/timers/include/common_timers.h +++ b/testcases/kernel/timers/include/common_timers.h @@ -64,4 +64,9 @@ const char *get_clock_str(const int clock_id) #include <time.h> #include <unistd.h> +/* timer_t in kernel(int) is different from Glibc definition(void*). + * Use the kernel definition for syscall tests + */ +typedef int kernel_timer_t; + #endif diff --git a/testcases/kernel/timers/timer_create/timer_create02.c b/testcases/kernel/timers/timer_create/timer_create02.c index cef7cbe..c089562 100755 --- a/testcases/kernel/timers/timer_create/timer_create02.c +++ b/testcases/kernel/timers/timer_create/timer_create02.c @@ -86,7 +86,7 @@ main(int ac, char **av) { int lc, i, j; /* loop counter */ char *msg; /* message returned from parse_opts */ - timer_t created_timer_id; /* holds the returned timer_id */ + kernel_timer_t created_timer_id; /* holds the returned timer_id */ char *message[3] = { "SIGEV_SIGNAL", "NULL", diff --git a/testcases/kernel/timers/timer_create/timer_create03.c b/testcases/kernel/timers/timer_create/timer_create03.c index 521be9a..a46f442 100755 --- a/testcases/kernel/timers/timer_create/timer_create03.c +++ b/testcases/kernel/timers/timer_create/timer_create03.c @@ -100,7 +100,7 @@ main(int ac, char **av) { int lc, i; /* loop counter */ char *msg; /* message returned from parse_opts */ - timer_t created_timer_id; /* holds the returned timer_id */ + kernel_timer_t created_timer_id; /* holds the returned timer_id */ char *message[] = { "SIGEV_SIGNAL", "NULL", diff --git a/testcases/kernel/timers/timer_create/timer_create04.c b/testcases/kernel/timers/timer_create/timer_create04.c index 3b6f6db..b9c6640 100755 --- a/testcases/kernel/timers/timer_create/timer_create04.c +++ b/testcases/kernel/timers/timer_create/timer_create04.c @@ -111,7 +111,7 @@ main(int ac, char **av) { int lc, i; /* loop counter */ char *msg; /* message returned from parse_opts */ - timer_t timer_id, *temp_id; /* stores the returned timer_id */ + kernel_timer_t timer_id, *temp_id; /* stores the returned timer_id */ struct sigevent *temp_ev; /* used for bad address test case */ clockid_t clocks[6] = { @@ -158,7 +158,7 @@ main(int ac, char **av) switch (i) { case 2: /* make the timer_id bad address */ - temp_id = (timer_t *) -1; + temp_id = (kernel_timer_t *) -1; break; case 3: /* make the event bad address */ @@ -167,7 +167,7 @@ main(int ac, char **av) case 4: /* Produce an invalid timer_id address. */ if(tst_kvercmp(2, 6, 12) >= 0) - temp_id = (timer_t *) -1; + temp_id = (kernel_timer_t *) -1; break; case 5: /* Produce an invalid event address. */ diff --git a/testcases/kernel/timers/timer_delete/timer_delete02.c b/testcases/kernel/timers/timer_delete/timer_delete02.c index 159e7d8..3730d91 100755 --- a/testcases/kernel/timers/timer_delete/timer_delete02.c +++ b/testcases/kernel/timers/timer_delete/timer_delete02.c @@ -84,7 +84,7 @@ main(int ac, char **av) { int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ - timer_t timer_id; + kernel_timer_t timer_id; /* parse standard options */ if ((msg = parse_opts (ac, av, (option_t *) NULL, NULL)) != diff --git a/testcases/kernel/timers/timer_delete/timer_delete03.c b/testcases/kernel/timers/timer_delete/timer_delete03.c index d408f65..fbef79b 100755 --- a/testcases/kernel/timers/timer_delete/timer_delete03.c +++ b/testcases/kernel/timers/timer_delete/timer_delete03.c @@ -73,7 +73,7 @@ #include "usctest.h" #include "common_timers.h" -#define INVALID_ID ((timer_t)-1) +#define INVALID_ID ((kernel_timer_t)-1) static void setup(); diff --git a/testcases/kernel/timers/timer_settime/timer_settime02.c b/testcases/kernel/timers/timer_settime/timer_settime02.c index 8dd5bc0..157a960 100755 --- a/testcases/kernel/timers/timer_settime/timer_settime02.c +++ b/testcases/kernel/timers/timer_settime/timer_settime02.c @@ -81,7 +81,7 @@ int TST_TOTAL = 4; /* Total number of test cases. */ extern int Tst_count; /* Test Case counter for tst_* routines */ static struct itimerspec new_set, old_set, *old_temp; -static timer_t timer; +static kernel_timer_t timer; static int flag; int diff --git a/testcases/kernel/timers/timer_settime/timer_settime03.c b/testcases/kernel/timers/timer_settime/timer_settime03.c index e3408ea..e44c85d 100755 --- a/testcases/kernel/timers/timer_settime/timer_settime03.c +++ b/testcases/kernel/timers/timer_settime/timer_settime03.c @@ -81,7 +81,7 @@ int TST_TOTAL; /* Total number of test cases. */ extern int Tst_count; /* Test Case counter for tst_* routines */ static struct itimerspec new_set, old_set, *old_temp, *new_temp; -static timer_t timer, tim; +static kernel_timer_t timer, tim; static int exp_enos[] = {EINVAL, EFAULT, 0}; @@ -168,7 +168,7 @@ setup_test(int option) break; case 3: /* make timer_id invalid */ - tim = (timer_t)-1; + tim = (kernel_timer_t)-1; new_set.it_value.tv_nsec = 0; break; case 4: diff --git a/testcases/misc/math/float/main.c b/testcases/misc/math/float/main.c index 0223219..2b81d51 100644 --- a/testcases/misc/math/float/main.c +++ b/testcases/misc/math/float/main.c @@ -393,7 +393,9 @@ static void *handle_signals (void *arg) default: exit (-1); } - }while (TRUE); + } while (TRUE); + + return NULL; } /*---------------------------------------------------------------------+ | error () | diff --git a/testcases/realtime/func/pi-tests/testpi-0.c b/testcases/realtime/func/pi-tests/testpi-0.c index 3c56588..cf0a24d 100644 --- a/testcases/realtime/func/pi-tests/testpi-0.c +++ b/testcases/realtime/func/pi-tests/testpi-0.c @@ -30,6 +30,7 @@ * * * HISTORY + * 2010-04-22 Code cleanup by Gowrishankar (gow...@in...) * * *****************************************************************************/ @@ -45,53 +46,57 @@ void usage(void) { - rt_help(); - printf("testpi-0 specific options:\n"); - printf("testpi-0 doesn't require any commandline options\n"); + rt_help(); + printf("testpi-0 specific options:\n"); + printf("testpi-0 doesn't require any commandline options\n"); } int parse_args(int c, char *v) { - int handled = 1; - switch (c) { - case 'h': - usage(); - exit(0); - default: - handled = 0; - break; - } - return handled; + int handled = 1; + switch (c) { + case 'h': + usage(); + exit(0); + default: + handled = 0; + break; + } + return handled; } /* * Test pthread creation at different thread priorities. */ -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { - char *pathbuf; size_t n; + char *pathbuf; size_t n; - rt_init("h",parse_args,argc,argv); + rt_init("h", parse_args, argc, argv); - n = confstr(_CS_GNU_LIBC_VERSION, NULL, (size_t)0); - if ((pathbuf = malloc(n)) == NULL) abort(); - confstr(_CS_GNU_LIBC_VERSION, pathbuf, n); + n = confstr(_CS_GNU_LIBC_VERSION, NULL, (size_t)0); + pathbuf = malloc(n); + if (!pathbuf) + abort(); + confstr(_CS_GNU_LIBC_VERSION, pathbuf, n); - printf("LIBC_VERSION: %s\n", pathbuf); - free(pathbuf); + printf("LIBC_VERSION: %s\n", pathbuf); + free(pathbuf); - n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, (size_t)0); - if ((pathbuf = malloc(n)) == NULL) abort(); - confstr(_CS_GNU_LIBPTHREAD_VERSION, pathbuf, n); + n = confstr(_CS_GNU_LIBPTHREAD_VERSION, NULL, (size_t)0); + pathbuf = malloc(n); + if (!pathbuf) + abort(); + confstr(_CS_GNU_LIBPTHREAD_VERSION, pathbuf, n); - printf("LIBPTHREAD_VERSION: %s\n", pathbuf); - free(pathbuf); + printf("LIBPTHREAD_VERSION: %s\n", pathbuf); + free(pathbuf); - if (sysconf(_SC_THREAD_PRIO_INHERIT) == -1) { - printf("No Prio inheritance support\n"); - } - printf("Prio inheritance support present\n"); + if (sysconf(_SC_THREAD_PRIO_INHERIT) == -1) + printf("No Prio inheritance support\n"); - return 0; + printf("Prio inheritance support present\n"); + + return 0; } diff --git a/testcases/realtime/func/pi-tests/testpi-1.c b/testcases/realtime/func/pi-tests/testpi-1.c index dc6081b..5d18f29 100644 --- a/testcases/realtime/func/pi-tests/testpi-1.c +++ b/testcases/realtime/func/pi-tests/testpi-1.c @@ -20,8 +20,8 @@ * testpi-1.c * * DESCRIPTION - * - * + * This testcase verifies if the low priority SCHED_OTHER thread can preempt + * the high priority SCHED_RR thread via priority inheritance. * * USAGE: * Use run_auto.sh script in current directory to build and run test. @@ -30,7 +30,9 @@ * * * HISTORY - * + * 2010-04-22 Code cleanup and thread synchronization changes by using + * conditional variables, + * by Gowrishankar(gow...@in...). * *****************************************************************************/ @@ -48,23 +50,22 @@ pthread_barrier_t barrier; void usage(void) { - rt_help(); - printf("testpi-1 specific options:\n"); + rt_help(); + printf("testpi-1 specific options:\n"); } int parse_args(int c, char *v) { - - int handled = 1; - switch (c) { - case 'h': - usage(); - exit(0); - default: - handled = 0; - break; - } - return handled; + int handled = 1; + switch (c) { + case 'h': + usage(); + exit(0); + default: + handled = 0; + break; + } + return handled; } int gettid(void) @@ -72,173 +73,148 @@ int gettid(void) return syscall(__NR_gettid); } -typedef void* (*entrypoint_t)(void*); - -#define THREAD_STOP 1 - +typedef void *(*entrypoint_t)(void *); pthread_mutex_t glob_mutex; +static pthread_mutex_t cond_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t cond_var = PTHREAD_COND_INITIALIZER; -void* func_nonrt(void* arg) +void *func_nonrt(void *arg) { - struct thread* pthr = (struct thread* )arg; - int rc, i, j, tid = gettid(); - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - - rc = sched_setaffinity(0, sizeof(mask), &mask); - if (rc < 0) { - printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); - exit(-1); - } - - printf("Thread %d started running with priority %d\n", tid, pthr->priority); - pthread_mutex_lock(&glob_mutex); - printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); - /* Wait for other RT threads to start up */ - pthread_barrier_wait(&barrier); - - for (i=0;i<10000;i++) { - if (i%100 == 0) { - printf("Thread %d loop %d pthread pol %d pri %d\n", tid, i, pthr->policy, pthr->priority); - fflush(NULL); - } - pthr->id++; - for (j=0;j<5000;j++) { - pthread_mutex_lock(&(pthr->mutex)); - pthread_mutex_unlock(&(pthr->mutex)); - } - } - pthread_mutex_unlock(&glob_mutex); - return NULL; + struct thread *pthr = (struct thread *)arg; + int i, tid = gettid(); + + printf("Thread %d started running with priority %d\n", tid,\ + pthr->priority); + pthread_mutex_lock(&glob_mutex); + printf("Thread %d at start pthread pol %d pri %d - Got global lock\n",\ + tid, pthr->policy, pthr->priority); + /* Wait for other RT threads to start up */ + pthread_barrier_wait(&barrier); + + /* Wait for the high priority noise thread to start and signal us */ + pthread_mutex_lock(&cond_mutex); + pthread_cond_wait(&cond_var, &cond_mutex); + pthread_mutex_unlock(&cond_mutex); + + for (i = 0; i < 10000; i++) { + if (i%100 == 0) { + printf("Thread %d loop %d pthread pol %d pri %d\n",\ + tid, i, pthr->policy, pthr->priority); + fflush(NULL); + } + busy_work_ms(1); + } + pthread_mutex_unlock(&glob_mutex); + return NULL; } -void* func_rt(void* arg) +void *func_rt(void *arg) { - struct thread* pthr = (struct thread* )arg; - int rc, i, j, tid = gettid(); - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - - rc = sched_setaffinity(0, sizeof(mask), &mask); - if (rc < 0) { - printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); - exit(-1); - } - - printf("Thread %d started running with prio %d\n", tid, pthr->priority); - pthread_barrier_wait(&barrier); - pthread_mutex_lock(&glob_mutex); - printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); - - /* we just use the mutex as something to slow things down */ - /* say who we are and then do nothing for a while. The aim - * of this is to show that high priority threads make more - * progress than lower priority threads.. - */ - for (i=0;i<1000;i++) { - if (i%100 == 0) { - printf("Thread %d loop %d pthread pol %d pri %d\n", tid, i, pthr->policy, pthr->priority); - fflush(NULL); - } - pthr->id++; - for (j=0;j<5000;j++) { - pthread_mutex_lock(&(pthr->mutex)); - pthread_mutex_unlock(&(pthr->mutex)); - } - } - pthread_mutex_unlock(&glob_mutex); - return NULL; + struct thread *pthr = (struct thread *)arg; + int i, tid = gettid(); + + printf("Thread %d started running with prio %d\n", tid, pthr->priority); + pthread_barrier_wait(&barrier); + pthread_mutex_lock(&glob_mutex); + printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", + tid, pthr->policy, pthr->priority); + + /* We just use the mutex as something to slow things down, + * say who we are and then do nothing for a while. The aim + * of this is to show that high priority threads make more + * progress than lower priority threads.. + */ + for (i = 0; i < 1000; i++) { + if (i%100 == 0) { + printf("Thread %d loop %d pthread pol %d pri %d\n",\ + tid, i, pthr->policy, pthr->priority); + fflush(NULL); + } + busy_work_ms(1); + } + pthread_mutex_unlock(&glob_mutex); + return NULL; } -void* func_noise(void* arg) +void *func_noise(void *arg) { - struct thread* pthr = (struct thread* )arg; - int rc, i, j, tid = gettid(); - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - - rc = sched_setaffinity(0, sizeof(mask), &mask); - if (rc < 0) { - printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); - exit(-1); - } - - printf("Noise Thread %d started running with prio %d\n", tid, pthr->priority); - pthread_barrier_wait(&barrier); - - for (i=0;i<10000;i++) { - if (i%100 == 0) { - printf("Noise Thread %d loop %d pthread pol %d pri %d\n", tid, i, pthr->policy, pthr->priority); - fflush(NULL); - } - pthr->id++; - for (j=0;j<5000;j++) { - pthread_mutex_lock(&(pthr->mutex)); - pthread_mutex_unlock(&(pthr->mutex)); - } - } - return NULL; + struct thread *pthr = (struct thread *)arg; + int i, tid = gettid(); + + printf("Noise Thread %d started running with prio %d\n", tid, + pthr->priority); + pthread_barrier_wait(&barrier); + + /* Let others wait at conditional variable */ + usleep(1000); + + /* Noise thread begins the test */ + pthread_mutex_lock(&cond_mutex); + pthread_cond_broadcast(&cond_var); + pthread_mutex_unlock(&cond_mutex); + + for (i = 0; i < 10000; i++) { + if (i%100 == 0) { + printf("Noise Thread %d loop %d pthread pol %d "\ + "pri %d\n", tid, i, pthr->policy,\ + pthr->priority); + fflush(NULL); + } + busy_work_ms(1); + } + return NULL; } /* * Test pthread creation at different thread priorities. */ -int main(int argc, char* argv[]) { - pthread_mutexattr_t mutexattr; - int i, retc, protocol, nopi = 0; - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - setup(); - - rt_init("h",parse_args,argc,argv); - - if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { - printf("pthread_barrier_init failed: %s\n", strerror(retc)); - exit(retc); - } - - retc = sched_setaffinity(0, sizeof(mask), &mask); - if (retc < 0) { - printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); - exit(-1); - } - for (i=0;i<argc;i++) { - if (strcmp(argv[i],"nopi") == 0) nopi = 1; - } - - printf("Start %s\n",argv[0]); - - if (!nopi) { - if (pthread_mutexattr_init(&mutexattr) != 0) { - printf("Failed to init mutexattr\n"); - } - if (pthread_mutexattr_setprotocol(&mutexattr, PTHREAD_PRIO_INHERIT) != 0) { - printf("Can't set protocol prio inherit\n"); - } - if (pthread_mutexattr_getprotocol(&mutexattr, &protocol) != 0) { - printf("Can't get mutexattr protocol\n"); - } else { - printf("protocol in mutexattr is %d\n", protocol); - } - if ((retc = pthread_mutex_init(&glob_mutex, &mutexattr)) != 0) { - printf("Failed to init mutex: %d\n", retc); - } - } - - create_other_thread(func_nonrt,NULL); - create_rr_thread(func_rt, NULL, 20); - create_rr_thread(func_rt, NULL, 30); - create_rr_thread(func_rt, NULL, 40); - create_rr_thread(func_noise, NULL, 40); - - printf("Joining threads\n"); - join_threads(); - printf("Done\n"); - printf("Criteria:Low Priority Thread should Preempt Higher Priority Noise Thread\n"); - - return 0; +int main(int argc, char *argv[]) +{ + int i, retc, nopi = 0; + cpu_set_t mask; + CPU_ZERO(&mask); + CPU_SET(0, &mask); + setup(); + + rt_init("h", parse_args, argc, argv); + + retc = pthread_barrier_init(&barrier, NULL, 5); + if (retc) { + printf("pthread_barrier_init failed: %s\n", strerror(retc)); + exit(retc); + } + + retc = sched_setaffinity(0, sizeof(mask), &mask); + if (retc < 0) { + printf("Main Thread: Can't set affinity: %d %s\n", retc,\ + strerror(retc)); + exit(-1); + } + + for (i = 0; i < argc; i++) { + if (strcmp(argv[i], "nopi") == 0) + nopi = 1; + } + + printf("Start %s\n", argv[0]); + + if (!nopi) + init_pi_mutex(&glob_mutex); + + create_other_thread(func_nonrt, NULL); + create_rr_thread(func_rt, NULL, 20); + create_rr_thread(func_rt, NULL, 30); + create_rr_thread(func_rt, NULL, 40); + create_rr_thread(func_noise, NULL, 40); + + printf("Joining threads\n"); + join_threads(); + printf("Done\n"); + printf("Criteria:Low Priority Thread should Preempt Higher Priority "\ + "Noise Thread\n"); + + pthread_mutex_destroy(&glob_mutex); + pthread_mutex_destroy(&cond_mutex); + pthread_cond_destroy(&cond_var); + return 0; } diff --git a/testcases/realtime/func/pi-tests/testpi-2.c b/testcases/realtime/func/pi-tests/testpi-2.c index f824c94..55b391b 100644 --- a/testcases/realtime/func/pi-tests/testpi-2.c +++ b/testcases/realtime/func/pi-tests/testpi-2.c @@ -20,8 +20,9 @@ * testpi-2.c * * DESCRIPTION - * - * + * This testcase verifies if the low priority SCHED_RR thread can preempt + * the high priority SCHED_RR thread multiple times via priority + * inheritance. * * USAGE: * Use run_auto.sh script in current directory to build and run test. @@ -30,7 +31,9 @@ * * * HISTORY - * + * 2010-04-22 Code cleanup and thread synchronization changes by using + * conditional variables, + * by Gowrishankar(gow...@in...). * *****************************************************************************/ @@ -48,196 +51,171 @@ pthread_barrier_t barrier; void usage(void) { - rt_help(); - printf("testpi-2 specific options:\n"); + rt_help(); + printf("testpi-2 specific options:\n"); } int parse_args(int c, char *v) { - int handled = 1; - switch (c) { - case 'h': - usage(); - exit(0); - default: - handled = 0; - break; - } - return handled; + int handled = 1; + switch (c) { + case 'h': + usage(); + exit(0); + default: + handled = 0; + break; + } + return handled; } int gettid(void) { - return syscall(__NR_gettid); + return syscall(__NR_gettid); } -typedef void* (*entrypoint_t)(void*); - -#define THREAD_STOP 1 - +typedef void *(*entrypoint_t)(void *); pthread_mutex_t glob_mutex; +static pthread_mutex_t cond_mutex = PTHREAD_MUTEX_INITIALIZER; +static pthread_cond_t cond_var = PTHREAD_COND_INITIALIZER; -void* func_lowrt(void* arg) +void *func_lowrt(void *arg) { - struct thread* pthr = (struct thread* )arg ; - int rc, i, j, tid = gettid(); - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - - rc = sched_setaffinity(0, sizeof(mask), &mask); - if (rc < 0) { - printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); - exit(-1); - } - - printf("Thread %d started running with priority %d\n", tid, pthr->priority); - pthread_mutex_lock(&glob_mutex); - printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); - /* Wait for other RT threads to start up */ - pthread_barrier_wait(&barrier); - - for (i=0;i<10000;i++) { - if (i%100 == 0) { - printf("Thread %d loop %d pthread pol %d pri %d\n", tid, i, pthr->policy, pthr->priority); - fflush(NULL); - } - pthr->id++; - for (j=0;j<5000;j++) { - pthread_mutex_lock(&(pthr->mutex)); - pthread_mutex_unlock(&(pthr->mutex)); - } - } - pthread_mutex_unlock(&glob_mutex); - return NULL; + struct thread *pthr = (struct thread *)arg; + int i, tid = gettid(); + + printf("Thread %d started running with priority %d\n", tid,\ + pthr->priority); + pthread_mutex_lock(&glob_mutex); + printf("Thread %d at start pthread pol %d pri %d - Got global lock\n",\ + tid, pthr->policy, pthr->priority); + /* Wait for other RT threads to start up */ + pthread_barrier_wait(&barrier); + + /* Wait for the high priority noise thread to start and signal us */ + pthread_mutex_lock(&cond_mutex); + pthread_cond_wait(&cond_var, &cond_mutex); + pthread_mutex_unlock(&cond_mutex); + + for (i = 0; i < 10000; i++) { + if (i%100 == 0) { + printf("Thread %d loop %d pthread pol %d pri %d\n",\ + tid, i, pthr->policy, pthr->priority); + fflush(NULL); + } + busy_work_ms(1); + } + pthread_mutex_unlock(&glob_mutex); + return NULL; } -void* func_rt(void* arg) +void *func_rt(void *arg) { - struct thread* pthr = (struct thread* )arg; - int rc, i, j, tid = gettid(); - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - - rc = sched_setaffinity(0, sizeof(mask), &mask); - if (rc < 0) { - printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); - exit(-1); - } - - printf("Thread %d started running with prio %d\n", tid, pthr->priority); - pthread_barrier_wait(&barrier); - pthread_mutex_lock(&glob_mutex); - printf("Thread %d at start pthread pol %d pri %d - Got global lock\n", tid, pthr->policy, pthr->priority); - - /* we just use the mutex as something to slow things down */ - /* say who we are and then do nothing for a while. The aim - * of this is to show that high priority threads make more - * progress than lower priority threads.. - */ - for (i=0;i<1000;i++) { - if (i%100 == 0) { - printf("Thread %d loop %d pthread pol %d pri %d\n", tid, i, pthr->policy, pthr->priority); - fflush(NULL); - } - pthr->id++; - for (j=0;j<5000;j++) { - pthread_mutex_lock(&(pthr->mutex)); - pthread_mutex_unlock(&(pthr->mutex)); - } - } - pthread_mutex_unlock(&glob_mutex); - return NULL; + struct thread *pthr = (struct thread *)arg; + int i, tid = gettid(); + + printf("Thread %d started running with prio %d\n", tid, pthr->priority); + pthread_barrier_wait(&barrier); + pthread_mutex_lock(&glob_mutex); + printf("Thread %d at start pthread pol %d pri %d - Got global lock\n",\ + tid, pthr->policy, pthr->priority); + + /* We just use the mutex as something to slow things down, + * say who we are and then do nothing for a while. The aim + * of this is to show that high priority threads make more + * progress than lower priority threads.. + */ + for (i = 0; i < 1000; i++) { + if (i%100 == 0) { + printf("Thread %d loop %d pthread pol %d pri %d\n",\ + tid, i, pthr->policy, pthr->priority); + fflush(NULL); + } + busy_work_ms(1); + } + pthread_mutex_unlock(&glob_mutex); + return NULL; } -void* func_noise(void* arg) +void *func_noise(void *arg) { - struct thread* pthr = (struct thread* )arg; - int rc, i, j, tid = gettid(); - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - - rc = sched_setaffinity(0, sizeof(mask), &mask); - if (rc < 0) { - printf("Thread %d: Can't set affinity: %d %s\n", tid, rc, strerror(rc)); - exit(-1); - } - - printf("Noise Thread %d started running with prio %d\n", tid, pthr->priority); - pthread_barrier_wait(&barrier); - - for (i=0;i<10000;i++) { - if (i%100 == 0) { - printf("Noise Thread %d loop %d pthread pol %d pri %d\n", tid, i, pthr->policy, pthr->priority); - fflush(NULL); - } - pthr->id++; - for (j=0;j<5000;j++) { - pthread_mutex_lock(&(pthr->mutex)); - pthread_mutex_unlock(&(pthr->mutex)); - } - } - return NULL; + struct thread *pthr = (struct thread *)arg; + int i, tid = gettid(); + + printf("Noise Thread %d started running with prio %d\n", tid,\ + pthr->priority); + pthread_barrier_wait(&barrier); + + /* Let others wait at conditional variable */ + usleep(1000); + + /* Noise thread begins the test */ + pthread_mutex_lock(&cond_mutex); + pthread_cond_broadcast(&cond_var); + pthread_mutex_unlock(&cond_mutex); + + for (i = 0; i < 10000; i++) { + if (i%100 == 0) { + printf("Noise Thread %d loop %d pthread pol %d "\ + "pri %d\n", tid, i, pthr->policy,\ + pthr->priority); + fflush(NULL); + } + busy_work_ms(1); + } + return NULL; } /* * Test pthread creation at different thread priorities. */ -int main(int argc, char* argv[]) { - pthread_mutexattr_t mutexattr; - int i, retc, protocol, nopi = 0; - cpu_set_t mask; - CPU_ZERO(&mask); - CPU_SET(0, &mask); - setup(); - rt_init("h",parse_args,argc,argv); - - if ((retc = pthread_barrier_init(&barrier, NULL, 5))) { - printf("pthread_barrier_init failed: %s\n", strerror(retc)); - exit(retc); - } - - retc = sched_setaffinity(0, sizeof(mask), &mask); - if (retc < 0) { - printf("Main Thread: Can't set affinity: %d %s\n", retc, strerror(retc)); - exit(-1); - } - - for (i=0;i<argc;i++) { - if (strcmp(argv[i],"nopi") == 0) nopi = 1; - } - - printf("Start %s\n",argv[0]); - - if (!nopi) { - if (pthread_mutexattr_init(&mutexattr) != 0) { - printf("Failed to init mutexattr\n"); - }; - if (pthread_mutexattr_setprotocol(&mutexattr, PTHREAD_PRIO_INHERIT) != 0) { - printf("Can't set protocol prio inherit\n"); - } - if (pthread_mutexattr_getprotocol(&mutexattr, &protocol) != 0) { - printf("Can't get mutexattr protocol\n"); - } else { - printf("protocol in mutexattr is %d\n", protocol); - } - if ((retc = pthread_mutex_init(&glob_mutex, &mutexattr)) != 0) { - printf("Failed to init mutex: %d\n", retc); - } - } - - create_rr_thread(func_lowrt, NULL, 10); - create_rr_thread(func_rt, NULL, 20); - create_fifo_thread(func_rt, NULL, 30); - create_fifo_thread(func_rt, NULL, 40); - create_rr_thread(func_noise, NULL, 40); - - printf("Joining threads\n"); - join_threads(); - printf("Done\n"); - printf("Criteria: Low Priority Thread and High Priority Thread should prempt each other multiple times\n"); - return 0; +int main(int argc, char *argv[]) +{ + int i, retc, nopi = 0; + cpu_set_t mask; + CPU_ZERO(&mask); + CPU_SET(0, &mask); + setup(); + rt_init("h", parse_args, argc, argv); + + retc = pthread_barrier_init(&barrier, NULL, 5); + if (retc) { + printf("pthread_barrier_init failed: %s\n", strerror(retc)); + exit(retc); + } + + retc = sched_setaffinity(0, sizeof(mask), &mask); + if (retc < 0) { + printf("Main Thread: Can't set affinity: %d %s\n", retc,\ + strerror(retc)); + exit(-1); + } + + for (i = 0; i < argc; i++) { + if (strcmp(argv[i], "nopi") == 0) + nopi = 1; + } + + printf("Start %s\n", argv[0]); + + if (!nopi) + init_pi_mutex(&glob_mutex); + + create_rr_thread(func_lowrt, NULL, 10); + create_rr_thread(func_rt, NULL, 20); + create_fifo_thread(func_rt, NULL, 30); + create_fifo_thread(func_rt, NULL, 40); + create_rr_thread(func_noise, NULL, 40); + + printf("Joining threads\n"); + join_threads(); + printf("Done\n"); + printf("Criteria: Low Priority Thread and High Priority Thread "\ + "should prempt each other multiple times\n"); + + pthread_mutex_destroy(&glob_mutex); + pthread_mutex_destroy(&cond_mutex); + pthread_cond_destroy(&cond_var); + return 0; } diff --git a/testcases/realtime/func/pi-tests/testpi-5.c b/testcases/realtime/func/pi-tests/testpi-5.c index faf3d8d..1330dfd 100644 --- a/testcases/realtime/func/pi-tests/testpi-5.c +++ b/testcases/realtime/func/pi-tests/testpi-5.c @@ -20,8 +20,8 @@ * testpi-5.c * * DESCRIPTION - * - * + * This testcase verifies if a thread can lock the priority inheritance + * mutex multiple times. * * USAGE: * Use run_auto.sh script in current directory to build and run test. @@ -30,6 +30,7 @@ * * * HISTORY + * 2010-04-22 Code cleanup by Gowrishankar * * *****************************************************************************/ @@ -39,54 +40,55 @@ #include <string.h> #include <unistd.h> #include <librttest.h> -pthread_mutex_t child_mutex; +pthread_mutex_t child_mutex; -void* child_thread (void* arg) +void *child_thread(void *arg) { - int ret; + int ret; - ret = pthread_mutex_lock(&child_mutex); - if (ret != 0) - printf("child thread: Failed to lock child_mutex: %d\n", ret); - else - printf("child_thread: got lock\n"); + ret = pthread_mutex_lock(&child_mutex); + if (ret != 0) + printf("child thread: Failed to lock child_mutex: %d\n", ret); + else + printf("child_thread: got lock\n"); - sleep(2); + sleep(2); - printf("child_thread: Trying to get lock 2nd time\n"); - ret = pthread_mutex_lock(&child_mutex); - if (ret != 0) - printf("child thread: Failed to lock child_mutex: %d\n", ret); - else - printf("child_thread: got lock 2nd time !!\n"); + printf("child_thread: Trying to get lock 2nd time\n"); + ret = pthread_mutex_lock(&child_mutex); + if (ret != 0) + printf("child thread: Failed to lock child_mutex: %d\n", ret); + else + printf("child_thread: got lock 2nd time !!\n"); - return NULL; + return NULL; } -int do_test(int argc, char ** argv) +int do_test(int argc, char **argv) { - pthread_mutexattr_t mutexattr; - int retc, protocol; + pthread_mutexattr_t mutexattr; + int retc, protocol; + + if (pthread_mutexattr_init(&mutexattr) != 0) + printf("Failed to init mutexattr\n"); + + if (pthread_mutexattr_setprotocol(&mutexattr,\ + PTHREAD_PRIO_INHERIT) != 0) + printf("Can't set protocol prio inherit\n"); + + if (pthread_mutexattr_getprotocol(&mutexattr, &protocol) != 0) + printf("Can't get mutexattr protocol\n"); + else + printf("protocol in mutexattr is %d\n", protocol); + + retc = pthread_mutex_init(&child_mutex, &mutexattr); + if (retc != 0) + printf("Failed to init mutex: %d\n", retc); - if (pthread_mutexattr_init(&mutexattr) != 0) { - printf("Failed to init mutexattr\n"); - }; - if (pthread_mutexattr_setprotocol(&mutexattr, PTHREAD_PRIO_INHERIT) != 0) { - printf("Can't set protocol prio inherit\n"); - } - if (pthread_mutexattr_getprotocol(&mutexattr, &protocol) != 0) { - printf("Can't get mutexattr protocol\n"); - } else { - printf("protocol in mutexattr is %d\n", protocol); - } - if ((retc = pthread_mutex_init(&child_mutex, &mutexattr)) != 0) { - printf("Failed to init mutex: %d\n", retc); - } + create_other_thread(child_thread, NULL); + join_threads(); - create_other_thread(child_thread, NULL); - join_threads(); - - return 0; + return 0; } #include "test-skeleton.c" diff --git a/testcases/realtime/func/pi-tests/testpi-6.c b/testcases/realtime/func/pi-tests/testpi-6.c index 560f45f..19c06ea 100644 --- a/testcases/realtime/func/pi-tests/testpi-6.c +++ b/testcases/realtime/func/pi-tests/testpi-6.c @@ -20,8 +20,8 @@ * testpi-6.c * * DESCRIPTION - * - * + * This testcase verifies if a thread can lock the robust mutex multiple + * times. * * USAGE: * Use run_auto.sh script in current directory to build and run test. @@ -30,6 +30,7 @@ * * * HISTORY + * 2010-04-22 Code cleanup by Gowrishankar * * *****************************************************************************/ @@ -39,54 +40,55 @@ #include <string.h> #include <unistd.h> #include <librttest.h> -pthread_mutex_t child_mutex; +pthread_mutex_t child_mutex; -void* child_thread (void* arg) +void *child_thread(void *arg) { - int ret; + int ret; - ret = pthread_mutex_lock(&child_mutex); - if (ret != 0) - printf("child thread: Failed to lock child_mutex: %d\n", ret); - else - printf("child_thread: got lock\n"); + ret = pthread_mutex_lock(&child_mutex); + if (ret != 0) + printf("child thread: Failed to lock child_mutex: %d\n", ret); + else + printf("child_thread: got lock\n"); - sleep(2); + sleep(2); - printf("child_thread: Trying to get lock 2nd time\n"); - ret = pthread_mutex_lock(&child_mutex); - if (ret != 0) - printf("child thread: Failed to lock child_mutex: %d\n", ret); - else - printf("child_thread: got lock 2nd time !!\n"); + printf("child_thread: Trying to get lock 2nd time\n"); + ret = pthread_mutex_lock(&child_mutex); + if (ret != 0) + printf("child thread: Failed to lock child_mutex: %d\n", ret); + else + printf("child_thread: got lock 2nd time !!\n"); - return NULL; + return NULL; } int do_test(int argc, char **argv) { - pthread_mutexattr_t mutexattr; - int retc, robust; + pthread_mutexattr_t mutexattr; + int retc, robust; + + if (pthread_mutexattr_init(&mutexattr) != 0) + printf("Failed to init mutexattr\n"); + + if (pthread_mutexattr_setrobust_np(&mutexattr,\ + PTHREAD_MUTEX_ROBUST_NP) != 0) + printf("Can't set robust mutex\n"); + + if (pthread_mutexattr_getrobust_np(&mutexattr, &robust) != 0) + printf("Can't get mutexattr protocol\n"); + else + printf("robust in mutexattr is %d\n", robust); - if (pthread_mutexattr_init(&mutexattr) != 0) { - printf("Failed to init mutexattr\n"); - }; - if (pthread_mutexattr_setrobust_np(&mutexattr, PTHREAD_MUTEX_ROBUST_NP) != 0) { - printf("Can't set robust mutex\n"); - } - if (pthread_mutexattr_getrobust_np(&mutexattr, &robust) != 0) { - printf("Can't get mutexattr protocol\n"); - } else { - printf("robust in mutexattr is %d\n", robust); - } - if ((retc = pthread_mutex_init(&child_mutex, &mutexattr)) != 0) { - printf("Failed to init mutex: %d\n", retc); - } + retc = pthread_mutex_init(&child_mutex, &mutexattr); + if (retc != 0) + printf("Failed to init mutex: %d\n", retc); - create_other_thread(child_thread, NULL); - join_threads(); + create_other_thread(child_thread, NULL); + join_threads(); - return 0; + return 0; } #include "test-skeleton.c" hooks/post-receive -- ltp |
From: Subrata <ris...@li...> - 2010-05-17 20:05:48
|
The branch, master, has been updated via e75668f99ade62e18e34891b2c522c8d97ee982b (commit) via 6e9c735833c19ad5031a4116b2e74ee77ff53424 (commit) via ca758b73afff8200df5e1a24e9abe8a6468c9e06 (commit) from 440fa0f6d857d4a15802b5ecdfdf6057e59975bf (commit) - Log ----------------------------------------------------------------- commit e75668f99ade62e18e34891b2c522c8d97ee982b Author: Subrata Modak <sub...@su...> Date: Tue May 18 01:34:04 2010 +0530 ftruncate04.c: cleanup mandatory locking check. The attached patch tries to cleanup the `mandatory locking' check in the ftruncate04.c testcase. The currently test is made with system(2) and involve calling some external tools ... to determine if the underlying filesystem has `mand' option set. The same result can be easily retrieved with a simple statvfs(2) call and examining the mount flags value. This has been successfully tested on a RHEL5 x86_64 machine. Signed-off-by: Nicolas Joly <nj...@pa...>. commit 6e9c735833c19ad5031a4116b2e74ee77ff53424 Author: Subrata Modak <sub...@su...> Date: Tue May 18 01:31:35 2010 +0530 New: open("a/", O_NOFOLLOW) fails with ELOOP if "a" is a symbolic link to a directory. Add O_NOFOLLOW open test with trailing slash. In a situation where symlink (say 's') points to a directory, open("s/", O_NOFOLLOW) should succeed. Check for this. Signed-off-by: Jan Kara <ja...@su...>. commit ca758b73afff8200df5e1a24e9abe8a6468c9e06 Author: Subrata Modak <sub...@su...> Date: Tue May 18 01:28:14 2010 +0530 fix fs_perms tests. Signed-off-by: Cyril Hrubis <ch...@su...>. ----------------------------------------------------------------------- Summary of changes: include/test.h | 5 + lib/get_path.c | 100 +++++++++ runltp | 1 + runtest/fs | 3 - testcases/kernel/fs/fs_perms/Makefile | 3 - testcases/kernel/fs/fs_perms/fs_perms.c | 235 +++++++++++++------- .../kernel/fs/fs_perms/fs_perms_simpletest.sh | 35 --- testcases/kernel/fs/fs_perms/testx.c | 4 - testcases/kernel/syscalls/ftruncate/ftruncate04.c | 12 +- testcases/kernel/syscalls/open/open07.c | 98 ++++++--- 10 files changed, 342 insertions(+), 154 deletions(-) create mode 100644 lib/get_path.c delete mode 100755 testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh delete mode 100644 testcases/kernel/fs/fs_perms/testx.c diff --git a/include/test.h b/include/test.h index e291b36..7ac182a 100644 --- a/include/test.h +++ b/include/test.h @@ -262,6 +262,11 @@ int ltp_clone_quick(unsigned long clone_flags, int (*fn)(void *arg), char *get_block_device(const char *path); char *get_mountpoint(const char *path); +/* + * Function from lib/get_path.c + */ +int tst_get_path(const char *prog_name, char *buf, size_t buf_len); + #ifdef TST_USE_COMPAT16_SYSCALL #define TCID_BIT_SUFFIX "_16" #elif TST_USE_NEWER64_SYSCALL diff --git a/lib/get_path.c b/lib/get_path.c new file mode 100644 index 0000000..89334a8 --- /dev/null +++ b/lib/get_path.c @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2010 Cyril Hrubis ch...@su... + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU 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. + * + * Further, this software is distributed without any warranty that it is + * free of the rightful claim of any third person regarding infringement + * or the like. Any license provided herein, whether implied or + * otherwise, applies only to this software file. Patent licenses, if + * any, provided herein do not apply to combinations of this program with + * other software, or any other product whatsoever. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + */ + + /* + * Looks for binary prog_name in $PATH. + * + * If such file exists and if you are able at least to read it, zero is + * returned and absolute path to the file is filled into buf. In case buf is + * too short to hold the absolute path + prog_name for the file we are looking + * for -1 is returned as well as when there is no such file in all paths in + * $PATH. + */ + +#include "test.h" + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> +#include <sys/stat.h> + +#define MIN(a, b) ((a)<(b)?(a):(b)) + +static int file_exist(const char *path) +{ + struct stat st; + + if (!access(path, R_OK) && !stat(path, &st) && S_ISREG(st.st_mode)) + return 1; + + return 0; +} + +int tst_get_path(const char *prog_name, char *buf, size_t buf_len) +{ + const char *path = (const char*) getenv("PATH"); + const char *start = path; + const char *end; + size_t size, ret; + + + if (path == NULL) + return -1; + + do { + end = strchr(start, ':'); + + if (end != NULL) + snprintf(buf, MIN(buf_len, (size_t)(end - start + 1)), "%s", start); + else + snprintf(buf, buf_len, "%s", start); + + size = strlen(buf); + + /* + * "::" inside $PATH, $PATH ending with ':' or $PATH strarting + * with ':' should be expanded into current working directory. + */ + if (size == 0) { + snprintf(buf, buf_len, "."); + size = strlen(buf); + } + + /* + * If there is no '/' ad the end of path from $PATH add it. + */ + if (buf[size - 1] != '/') + ret = snprintf(buf + size, buf_len - size, "/%s", prog_name); + else + ret = snprintf(buf + size, buf_len - size, "%s", prog_name); + + if (buf_len - size > ret && file_exist(buf)) + return 0; + + start = end + 1; + + } while (end != NULL); + + return -1; +} diff --git a/runltp b/runltp index 07994e9..7a8ac28 100755 --- a/runltp +++ b/runltp @@ -570,6 +570,7 @@ main() for SCENFILES in ${LTPROOT}/runtest/syscalls \ ${LTPROOT}/runtest/fs \ + ${LTPROOT}/runtest/fs_perms_simple \ ${LTPROOT}/runtest/fsx \ ${LTPROOT}/runtest/dio \ ${LTPROOT}/runtest/io \ diff --git a/runtest/fs b/runtest/fs index 75c5e38..2de871d 100644 --- a/runtest/fs +++ b/runtest/fs @@ -64,9 +64,6 @@ writetest01 writetest #Also run the fs_di (Data Integrity tests) fs_di fs_di -d $TMPDIR -#Also run the fs_perms (File System Permission Tests) -fs_perms fs_perms_simpletest.sh - # Read every file in /proc. Not likely to crash, but does enough # to disturb the kernel. A good kernel latency killer too. # Was not sure why it should reside in runtest/crashme and won´t get tested ever diff --git a/testcases/kernel/fs/fs_perms/Makefile b/testcases/kernel/fs/fs_perms/Makefile index 48aa7d6..c0377cc 100644 --- a/testcases/kernel/fs/fs_perms/Makefile +++ b/testcases/kernel/fs/fs_perms/Makefile @@ -23,7 +23,4 @@ top_srcdir ?= ../../../.. include $(top_srcdir)/include/mk/testcases.mk - -INSTALL_TARGETS := fs_perms_simpletest.sh - include $(top_srcdir)/include/mk/generic_leaf_target.mk diff --git a/testcases/kernel/fs/fs_perms/fs_perms.c b/testcases/kernel/fs/fs_perms/fs_perms.c index ad44028..9fbe9ec 100644 --- a/testcases/kernel/fs/fs_perms/fs_perms.c +++ b/testcases/kernel/fs/fs_perms/fs_perms.c @@ -1,5 +1,6 @@ /* * Copyright (c) International Business Machines Corp., 2000 + * Copyright (c) 2010 Cyril Hrubis ch...@su... * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,9 +26,12 @@ * (04/19/01)v1.0 Added test for execute bit. * (05/23/01)v1.1 Added command line parameter to specify test file. * (07/12/01)v1.2 Removed conf file and went to command line parameters. + * (10/19/04) Rewritten to fit ltp test interface. + * Also now we try to run two different files, one is executed by execl, + * has shebang and should end up executed by kernel, other one is empty + * is executed by execlp and should end up executed by libc. */ -#include <errno.h> #include <stdio.h> #include <string.h> #include <ctype.h> @@ -36,117 +40,190 @@ #include <stdlib.h> #include <unistd.h> #include <wait.h> +#include <linux/limits.h> #include "test.h" +#define TEST_FILE_NAME1 "./test.file1" +#define TEST_FILE_NAME2 "./test.file2" + char *TCID = "fs_perms"; int TST_TOTAL = 1; -static int testsetup(mode_t mode, int cuserId, int cgroupId) -{ - int ret; - char cmd_str[256]; - - sprintf(cmd_str, "cp %s/testx test.file", getcwd(NULL, 0)); - tst_tmpdir(); - - ret = unlink("test.file"); - if (ret && errno != ENOENT) - goto done; - ret = system(cmd_str); - if (ret) - goto done; - ret = chmod("test.file", mode); - if (ret) - goto done; - ret = chown("test.file", cuserId, cgroupId); - - done: - return ret; -} - -void cleanup(void) +static void cleanup(void) { + seteuid(0); + setegid(0); + tst_rmdir(); tst_exit(); } -static int testfperm(int userId, int groupId, char *fperm) +/* + * Create file and set permissions, user id, group id. + * + * If flag is non zero, the file contains #!/PATH/sh shebang otherwise it's + * empty. + */ +static void testsetup(const char *file_name, int flag, mode_t mode, + int user_id, int group_id) { - /* SET CURRENT USER/GROUP PERMISSIONS */ - if (setegid(groupId)) { - tst_brkm(TBROK, cleanup, "could not setegid to %d: %s", groupId, strerror(errno)); - seteuid(0); - setegid(0); - return -1; - } - if (seteuid(userId)) { - tst_brkm(TBROK, cleanup, "could not seteuid to %d: %s", userId, strerror(errno)); - seteuid(0); - setegid(0); - return -1; + FILE *file; + + file = fopen(file_name, "w"); + + if (file == NULL) + tst_brkm(TBROK | TERRNO, cleanup, + "Could not create test file %s.", file_name); + + /* create file with shebang */ + if (flag) { + char buf[PATH_MAX]; + + if (tst_get_path("sh", buf, PATH_MAX)) + tst_brkm(TBROK, cleanup, + "Could not find path to sh in $PATH."); + + if (fprintf(file, "#!%s\n", buf) < 0) + tst_brkm(TBROK, cleanup, "Calling fprintf failed."); } - switch (tolower(fperm[0])) { - case 'x': { + if (fclose(file)) + tst_brkm(TBROK | TERRNO, cleanup, "Calling fclose failed."); + + if (chmod(file_name, mode)) + tst_brkm(TBROK | TERRNO, cleanup, + "Could not chmod test file %s.", file_name); + + if (chown(file_name, user_id, group_id)) + tst_brkm(TBROK | TERRNO, cleanup, + "Could not chown test file %s.", file_name); +} + +/* + * Test permissions. + */ +static int testfperm(const char *file_name, int flag, int user_id, + int group_id, char *fperm) + +{ + FILE *file; + int ret; + + if (setegid(group_id)) + tst_brkm(TBROK | TERRNO, cleanup, "Could not setegid to %d.", + group_id); + + if (seteuid(user_id)) + tst_brkm(TBROK | TERRNO, cleanup, "Could not seteuid to %d.", + user_id); + + if (tolower(fperm[0]) == 'x') { int status; + if (fork() == 0) { - execlp("./test.file", "test.file", NULL); + /* + * execlp runs file with sh in case kernel has + * no binmft handler for it, execl does not. + */ + if (flag) + execl(file_name, file_name, NULL); + else + execlp(file_name, "test", NULL); + exit(1); } + wait(&status); + seteuid(0); setegid(0); + return WEXITSTATUS(status); } - default: { - FILE *testfile; - if ((testfile = fopen("test.file", fperm))) { - fclose(testfile); - seteuid(0); - setegid(0); - return 0; - } else { - seteuid(0); - setegid(0); - return 1; - } - } - } + + if ((file = fopen(file_name, fperm)) != NULL) { + fclose(file); + ret = 0; + } else + ret = 1; + + seteuid(0); + setegid(0); + + return ret; +} + +static void print_usage(const char *bname) +{ + char *usage = "<file mode> <file UID> <file GID> " + "<tester UID> <tester GID> <permission " + "to test r|w|x> <expected result 0|1>"; + + printf("Usage: %s %s\n", bname, usage); +} + +static long str_to_l(const char *str, const char *name) +{ + char *end; + long i = strtol(str, &end, 10); + + if (*end != '\0') + tst_brkm(TBROK, tst_exit, "Invalid parameter '%s' passed. (%s)", + name, str); + + return i; } int main(int argc, char *argv[]) { char *fperm; - int result, exresult = 0, cuserId = 0, cgroupId = 0, userId = 0, groupId = 0; - mode_t mode; + gid_t fgroup_id, group_id; + uid_t fuser_id, user_id; + mode_t fmode; + int exp_res; + int res1, res2 = 1; tst_require_root(tst_exit); - switch (argc) { - case 8: - mode = strtol(argv[1], (char **)NULL, 010); - cuserId = atoi(argv[2]); - cgroupId = atoi(argv[3]); - userId = atoi(argv[4]); - groupId = atoi(argv[5]); - fperm = argv[6]; - exresult = atoi(argv[7]); - break; - default: - printf("Usage: %s <mode of file> <UID of file> <GID of file> <UID of tester> <GID of tester> <permission to test r|w|x> <expected result as 0|1>\n", argv[0]); - return 1; + if (argc != 8) { + print_usage(argv[0]); + tst_exit(); } - result = testsetup(mode, cuserId, cgroupId); - if (result) { - tst_brkm(TBROK, cleanup, "testsetup() failed: %s", strerror(errno)); + if (strlen(argv[6]) > 1) { + print_usage(argv[0]); + tst_exit(); } - result = testfperm(userId, groupId, fperm); - unlink("test.file"); - tst_resm(exresult == result ? TPASS : TFAIL, "%c a %03o file owned by (%d/%d) as user/group(%d/%d)", - fperm[0], mode, cuserId, cgroupId, userId, groupId); - cleanup(); - return 0; + fmode = str_to_l(argv[1], "file mode"); + fuser_id = str_to_l(argv[2], "file uid"); + fgroup_id = str_to_l(argv[3], "file gid"); + user_id = str_to_l(argv[4], "tester uid"); + group_id = str_to_l(argv[5], "tester gid"); + fperm = argv[6]; + exp_res = str_to_l(argv[7], "expected result"); + + tst_tmpdir(); + testsetup(TEST_FILE_NAME1, 0, fmode, fuser_id, fgroup_id); + + /* more tests for 'x' flag */ + if (tolower(fperm[0]) == 'x') { + testsetup(TEST_FILE_NAME2, 1, fmode, fuser_id, fgroup_id); + res2 = testfperm(TEST_FILE_NAME2, 1, user_id, group_id, fperm); + + if (res2 == exp_res) + res2 = 1; + else + res2 = 0; + } + + res1 = testfperm(TEST_FILE_NAME1, 0, user_id, group_id, fperm); + + tst_resm((exp_res == res1) && res2 ? TPASS : TFAIL, + "%c a %03o file owned by (%d/%d) as user/group (%d/%d)", + fperm[0], fmode, fuser_id, fgroup_id, user_id, group_id); + + tst_rmdir(); + tst_exit(); } diff --git a/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh b/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh deleted file mode 100755 index 5a8df8b..0000000 --- a/testcases/kernel/fs/fs_perms/fs_perms_simpletest.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -Code=0 - -test() -{ - arg=${1}; shift - res=${1} - - ./fs_perms ${arg} ${res} - if [ $? -ne 0 ]; then - Code=$((Code + 1)) - fi -} - -test "001 99 99 12 100 x" 0 -test "010 99 99 200 99 x" 0 -test "100 99 99 99 500 x" 0 -test "002 99 99 12 100 w" 0 -test "020 99 99 200 99 w" 0 -test "200 99 99 99 500 w" 0 -test "004 99 99 12 100 r" 0 -test "040 99 99 200 99 r" 0 -test "400 99 99 99 500 r" 0 -test "000 99 99 99 99 r" 1 -test "000 99 99 99 99 w" 1 -test "000 99 99 99 99 x" 1 -test "010 99 99 99 500 x" 1 -test "100 99 99 200 99 x" 1 -test "020 99 99 99 500 w" 1 -test "200 99 99 200 99 w" 1 -test "040 99 99 99 500 r" 1 -test "400 99 99 200 99 r" 1 - -exit ${Code} diff --git a/testcases/kernel/fs/fs_perms/testx.c b/testcases/kernel/fs/fs_perms/testx.c deleted file mode 100644 index 5944ce0..0000000 --- a/testcases/kernel/fs/fs_perms/testx.c +++ /dev/null @@ -1,4 +0,0 @@ -#include <stdio.h> -int main(void) { - return 0; -} diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate04.c b/testcases/kernel/syscalls/ftruncate/ftruncate04.c index 324a654..fa1daea 100644 --- a/testcases/kernel/syscalls/ftruncate/ftruncate04.c +++ b/testcases/kernel/syscalls/ftruncate/ftruncate04.c @@ -66,6 +66,8 @@ #include <inttypes.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/mount.h> +#include <sys/statvfs.h> #include "test.h" #include "usctest.h" #include "libtestsuite.h" @@ -285,6 +287,7 @@ int main(int ac, char **av) struct sigaction act; int lc; /* loop counter */ char *msg; /* message returned from parse_opts */ + struct statvfs fs; /* * parse standard options @@ -300,9 +303,12 @@ int main(int ac, char **av) local_flag = PASSED; tst_tmpdir(); - if (system - ("mount | grep `df . | grep ^/ | awk {'print $1'}` | grep mand >/dev/null") - != 0) { + if (statvfs(".", &fs) == -1) { + tst_resm(TFAIL|TERRNO, "statvfs failed"); + tst_rmdir(); + tst_exit(); + } + if ((fs.f_flag & MS_MANDLOCK) == 0) { tst_resm(TCONF, "The filesystem where /tmp is mounted does" " not support mandatory locks. Cannot run this test."); diff --git a/testcases/kernel/syscalls/open/open07.c b/testcases/kernel/syscalls/open/open07.c index 9d2fc04..2322e85 100644 --- a/testcases/kernel/syscalls/open/open07.c +++ b/testcases/kernel/syscalls/open/open07.c @@ -40,6 +40,9 @@ * 4. Create a symbolic link to a symbolically linked directory, and call * open(O_NOFOLLOW). Check that it returns ELOOP. * + * 5. Create a symbolic link to a directory, and call + * open("link/", O_NOFOLLOW). Check that it succeeds. + * * USAGE: <for command-line> * open07 [-c n] [-e] [-i n] [-I x] [-P x] [-t] * where, -c n : Run n copies concurrently. @@ -70,35 +73,35 @@ void setupfunc_test1(); void setupfunc_test2(); void setupfunc_test3(); void setupfunc_test4(); +void setupfunc_test5(); char *TCID = "open07"; -int TST_TOTAL = 4; +int TST_TOTAL = 5; extern int Tst_count; int fd1, fd2; -char file1[100], file2[100], file3[100]; - int exp_enos[] = { ELOOP, 0 }; struct test_case_t { char *desc; - char *filename; + char filename[100]; int flags; int mode; void (*setupfunc) (); int exp_errno; - int fileHandle; } TC[] = { { - "Test for ELOOP on f2: f1 -> f2", file2, O_NOFOLLOW, 00700, - setupfunc_test1, ELOOP, 0}, { - "Test for ELOOP on d2: d1 -> d2", file2, O_NOFOLLOW, 00700, - setupfunc_test2, ELOOP, 0}, { - "Test for ELOOP on f3: f1 -> f2 -> f3", file3, O_NOFOLLOW, - 00700, setupfunc_test3, ELOOP, 0}, { - "Test for ELOOP on d3: d1 -> d2 -> d3", file3, O_NOFOLLOW, - 00700, setupfunc_test4, ELOOP, 0}, { - NULL, NULL, 0, 0, NULL, 0, 0} + "Test for ELOOP on f2: f1 -> f2", {}, O_NOFOLLOW, 00700, + setupfunc_test1, ELOOP}, { + "Test for ELOOP on d2: d1 -> d2", {}, O_NOFOLLOW, 00700, + setupfunc_test2, ELOOP}, { + "Test for ELOOP on f3: f1 -> f2 -> f3", {}, O_NOFOLLOW, + 00700, setupfunc_test3, ELOOP}, { + "Test for ELOOP on d3: d1 -> d2 -> d3", {}, O_NOFOLLOW, + 00700, setupfunc_test4, ELOOP}, { + "Test for success on d2: d1 -> d2", {}, O_NOFOLLOW, 00700, + setupfunc_test5, 0}, { + NULL, {}, 0, 0, NULL, 0} }; int main(int ac, char **av) @@ -133,21 +136,34 @@ int main(int ac, char **av) TEST(open(TC[i].filename, TC[i].flags, TC[i].mode)); - if (TEST_RETURN != -1) { - tst_resm(TFAIL, "call succeeded unexpectedly"); - } + if (TC[i].exp_errno != 0) { + if (TEST_RETURN != -1) { + tst_resm(TFAIL, "open succeeded " + "unexpectedly"); + } + TEST_ERROR_LOG(TEST_ERRNO); - TEST_ERROR_LOG(TEST_ERRNO); - - if (TEST_ERRNO != TC[i].exp_errno) { - tst_resm(TFAIL, "open returned unexpected " - "errno, expected: %d, got: %d", - TC[i].exp_errno, TEST_ERRNO); + if (TEST_ERRNO != TC[i].exp_errno) { + tst_resm(TFAIL, "open returned " + "unexpected errno, expected: " + "%d, got: %d", + TC[i].exp_errno, TEST_ERRNO); + } else { + tst_resm(TPASS, "open returned " + "expected ELOOP error"); + } } else { - tst_resm(TPASS, "open returned expected " - "ELOOP error"); - } - close(TC[i].fileHandle); + if (TEST_RETURN == -1) { + tst_resm(TFAIL, "open failed " + "unexpectedly with errno %d", + TEST_ERRNO); + } else { + tst_resm(TPASS, "open succeeded as " + "expected"); + } + } + if (TEST_RETURN != -1) + close(TEST_RETURN); } } cleanup(); @@ -156,6 +172,8 @@ int main(int ac, char **av) void setupfunc_test1() { + char file1[100], file2[100]; + sprintf(file1, "open03.1.%d", getpid()); sprintf(file2, "open03.2.%d", getpid()); if ((fd1 = creat(file1, 00700)) < 0) { @@ -164,10 +182,13 @@ void setupfunc_test1() if (symlink(file1, file2) < 0) { tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno); /*NOTREACHED*/} + strcpy(TC[0].filename, file2); } void setupfunc_test2() { + char file1[100], file2[100]; + sprintf(file1, "open03.3.%d", getpid()); sprintf(file2, "open03.4.%d", getpid()); if (mkdir(file1, 00700) < 0) { @@ -176,10 +197,13 @@ void setupfunc_test2() if (symlink(file1, file2) < 0) { tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno); /*NOTREACHED*/} + strcpy(TC[1].filename, file2); } void setupfunc_test3() { + char file1[100], file2[100], file3[100]; + sprintf(file1, "open03.5.%d", getpid()); sprintf(file2, "open03.6.%d", getpid()); sprintf(file3, "open03.7.%d", getpid()); @@ -192,10 +216,13 @@ void setupfunc_test3() if (symlink(file2, file3) < 0) { tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno); /*NOTREACHED*/} + strcpy(TC[2].filename, file3); } void setupfunc_test4() { + char file1[100], file2[100], file3[100]; + sprintf(file1, "open03.8.%d", getpid()); sprintf(file2, "open03.9.%d", getpid()); sprintf(file3, "open03.10.%d", getpid()); @@ -208,6 +235,23 @@ void setupfunc_test4() if (symlink(file2, file3) < 0) { tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno); /*NOTREACHED*/} + strcpy(TC[3].filename, file3); +} + +void setupfunc_test5() +{ + char file1[100], file2[100]; + + sprintf(file1, "open11.3.%d", getpid()); + sprintf(file2, "open12.4.%d", getpid()); + if (mkdir(file1, 00700) < 0) { + tst_brkm(TBROK, cleanup, "mkdir(2) failed: errno: %d", errno); + /*NOTREACHED*/} + if (symlink(file1, file2) < 0) { + tst_brkm(TBROK, cleanup, "symlink(2) failed: errno: %d", errno); + /*NOTREACHED*/} + strcpy(TC[4].filename, file2); + strcat(TC[4].filename, "/"); } /* hooks/post-receive -- ltp |
From: Subrata <ris...@li...> - 2010-05-12 16:39:41
|
The branch, master, has been updated via 440fa0f6d857d4a15802b5ecdfdf6057e59975bf (commit) via bd9d440be1da8020c93ac92e497e3a16e66e9fa3 (commit) from 0ce709315c3f2493d8ff97d574641cb91f1b1fa6 (commit) - Log ----------------------------------------------------------------- commit 440fa0f6d857d4a15802b5ecdfdf6057e59975bf Author: Subrata Modak <sub...@su...> Date: Wed May 12 22:07:14 2010 +0530 Add an Option '-K' to Create dmesg logs for each test: Recently while running LTP , i found that the system had generated many kernel messages worth investigating. However, there was a loose gap to find out which test exactly was responsible for that message. So, i thought it could be worth to create a framework in LTP to log kernel messages for each test, to pinpoint exact messages created per test, for better debugging. The following patch adds a option to LTP and runs a old style script ;-) to achieve that. All this is done at the runltp level without any distrubance to ltp-pan. Messages can be logged at: 1) Absolute path(s) as specified by the user, else 2) Inside $LTPROOT/output/ Comments welcome. Signed-off-by: Subrata Modak <su...@li...> commit bd9d440be1da8020c93ac92e497e3a16e66e9fa3 Author: Subrata Modak <sub...@su...> Date: Wed May 12 22:03:21 2010 +0530 Add an Option '-K' to Create dmesg logs for each test: Recently while running LTP , i found that the system had generated many kernel messages worth investigating. However, there was a loose gap to find out which test exactly was responsible for that message. So, i thought it could be worth to create a framework in LTP to log kernel messages for each test, to pinpoint exact messages created per test, for better debugging. The following patch adds a option to LTP and runs a old style script ;-) to achieve that. All this is done at the runltp level without any distrubance to ltp-pan. Messages can be logged at: 1) Absolute path(s) as specified by the user, else 2) Inside $LTPROOT/output/ Comments welcome. Signed-off-by: Subrata Modak <su...@li...>, ----------------------------------------------------------------------- Summary of changes: runltp | 22 +++++- ...ck.pl => create_dmesg_entries_for_each_test.pl} | 78 ++++++-------------- 2 files changed, 44 insertions(+), 56 deletions(-) copy tools/{create_valgrind_check.pl => create_dmesg_entries_for_each_test.pl} (56%) mode change 100755 => 100644 diff --git a/runltp b/runltp index 36986af..07994e9 100755 --- a/runltp +++ b/runltp @@ -131,6 +131,8 @@ usage() -h Help. Prints all available options. -i NUM_PROCS Run LTP under additional background Load on IO Bus [NUM_PROCS = no. of processes creating IO Bus Load by spinning over sync()] + -K DMESG_LOG_DIR + Log Kernel messages generated for each test cases inside this directory -l LOGFILE Log results of test in a logfile. -m NUM_PROCS,CHUNKS,BYTES,HANGUP_FLAG Run LTP under additional background Load on Main memory (Seperate by comma) @@ -178,6 +180,7 @@ main() local ALT_DIR_RES=0 local ALT_HTML_OUT=0 local ALT_EMAIL_OUT=0 + local ALT_DMESG_OUT=0 local RUN_NETEST=0 local RUN_REPEATED=0 local QUIET_MODE="" @@ -198,6 +201,7 @@ main() local OUTPUTFILE="" local HTMLFILE_NAME="" local HTMLFILE="" + local DMESG_DIR="" local EMAIL_TO="" local SCENFILES="" local TAG_RESTRICT_STRING="" @@ -205,7 +209,7 @@ main() local DEFAULT_FILE_NAME_GENERATION_TIME=`date +"%Y_%b_%d-%Hh_%Mm_%Ss"` version_date=$(cat "$LTPROOT/Version") - while getopts a:c:C:d:D:f:F:ehi:g:l:m:M:Nno:pqr:s:S:t:T:w:x:b:B: arg + while getopts a:c:C:d:D:f:F:ehi:K:g:l:m:M:Nno:pqr:s:S:t:T:w:x:b:B: arg do case $arg in a) EMAIL_TO=$OPTARG ALT_EMAIL_OUT=1;; @@ -308,6 +312,15 @@ main() $LTPROOT/testcases/bin/genload --io $NUM_PROCS >/dev/null 2>&1 & GENLOAD=1 ;; + K) + case $OPTARG in + /*) + DMESG_DIR="$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";; + *) + DMESG_DIR="$LTPROOT/output/$OPTARG-dmesg-output-`echo $$-``date +%X | tr -d ' '`";; + esac + mkdir -p $DMESG_DIR + ALT_DMESG_OUT=1;; l) LOGFILE_NAME="$OPTARG" case $OPTARG in @@ -821,6 +834,13 @@ main() fi fi + if [ $ALT_DMESG_OUT -eq 1 ] ; then + #We want to print dmesg output for each test,lets do the trick inside the script + echo Enabling dmesg output logging for each test... + ${LTPROOT}/bin/create_dmesg_entries_for_each_test.pl ${TMP}/alltests $DMESG_DIR > ${TMP}/alltests.tmp + cp ${TMP}/alltests.tmp ${TMP}/alltests + rm -rf ${TMP}/alltests.tmp + fi # Some tests need to run inside the "bin" directory. cd "${LTPROOT}/testcases/bin" "${LTPROOT}/bin/ltp-pan" $QUIET_MODE -e -S $INSTANCES $DURATION -a $$ -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE diff --git a/tools/create_valgrind_check.pl b/tools/create_dmesg_entries_for_each_test.pl old mode 100755 new mode 100644 similarity index 56% copy from tools/create_valgrind_check.pl copy to tools/create_dmesg_entries_for_each_test.pl index 41ed93e..afb487f --- a/tools/create_valgrind_check.pl +++ b/tools/create_dmesg_entries_for_each_test.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl ################################################################################ ## ## -## Copyright (c) International Business Machines Corp., 2009 ## +## Copyright (c) International Business Machines Corp., 2010 ## ## ## ## This program is free software; you can redistribute it and/or modify ## ## it under the terms of the GNU General Public License as published by ## @@ -19,62 +19,30 @@ ## ## ################################################################################ # ## -# File : create_valgrind_check ## +# File : create_dmesg_entries_for_each_test.pl ## # ## -# Usage: create_valgrind_check\ ## -# <LTP_COMMAND_FILE> <VALGRIND_CHECK_TYPE> ## +# Usage: create_dmesg_entries_for_each_test.pl\ ## +# <LTP_COMMAND_FILE> <DMESG_DIRECTORY> ## # ## # Description: This is a simple perl script which will take ltp command file ## -# as input and then create a final command file while will have ## +# as input and then create a final command file which will have ## # the following entries for each test tag: ## -# 1) <tag_name> <test_binary_name> ## -# 2) <tag_name_valgrind_check_type> <valgrind test_binary_name> ## +# <tag_name__with_dmesg_entry> <test_binary_name>;\ ## +# <save_dmesg_logs> ## # ## # Author: Subrata Modak <su...@li...> ## # ## -# History: Aug 23 2009 - Created - Subrata Modak. ## +# History: May 09 2010 - Created - Subrata Modak. ## ################################################################################ my $command_file = shift (@ARGV) || syntax(); -my $valgrind_check_type = shift (@ARGV) || syntax(); +my $dmesg_dir = shift (@ARGV) || syntax(); sub syntax() { - print "syntax: create_valgrind_check\ - <LTP_COMMAND_FILE> <VALGRIND_CHECK_TYPE>\n"; + print "syntax: create_dmesg_entries_for_each_test.pl <LTP_COMMAND_FILE> <DMESG_DIRECTORY>\n"; exit (1); } -sub print_memory_leak_check { - $sub_line = shift; - @sub_tag_and_actual_command = split(/\ /, $sub_line); - my $sub_token_counter = 0; - foreach my $sub_token (@sub_tag_and_actual_command) { - if ($sub_token_counter == 0 ) {#print the tagname now - print $sub_token . "_valgrind_memory_leak_check " . - " valgrind -q --leak-check=full --trace-children=yes "; - $sub_token_counter++; - next; - } - print " " . $sub_token . " "; - } - print "\n"; -} - -sub print_thread_concurrency_check { - $sub_line = shift; - @sub_tag_and_actual_command = split(/\ /, $sub_line); - my $sub_token_counter = 0; - foreach my $sub_token (@sub_tag_and_actual_command) { - if ($sub_token_counter == 0 ) {#print the tagname now - print $sub_token . "_valgrind_thread_concurrency_check " . - " valgrind -q --tool=helgrind --trace-children=yes "; - $sub_token_counter++; - next; - } - print " " . $sub_token . " "; - } - print "\n"; -} open (FILE, $command_file) || die "Cannot open file: $command_file\n"; while ($line = <FILE>) { @@ -86,21 +54,21 @@ while ($line = <FILE>) { next; } chomp $line; - print "$line\n"; #Print one instance for normal execution + @tag_and_actual_command = split(/\ /, $line); - if ($valgrind_check_type == 3) { - #Print for both Memory Leak and Thread Concurrency Checks - print_memory_leak_check($line); - print_thread_concurrency_check($line); - } - if ($valgrind_check_type == 2) { - #Print only for Thread concurrency Check - print_thread_concurrency_check($line); - } - if ($valgrind_check_type == 1) { - #Print only for Memory leak Check - print_memory_leak_check($line); + my $token_counter = 0; + my $tag_name = ""; + foreach my $token (@tag_and_actual_command) { + if ($token_counter == 0 ) { + print $token . "__with_dmesg_entry" . " "; + print "dmesg -c 1>/dev/null 2>/dev/null;" . " "; + $token_counter++; + $tag_name = $token; + next; + } + print " " . $token . " "; } + print "; dmesg > $dmesg_dir/$tag_name.dmesg.log \n"; } close (FILE); hooks/post-receive -- ltp |
From: Subrata <ris...@li...> - 2010-05-09 14:16:22
|
The branch, master, has been updated via 0ce709315c3f2493d8ff97d574641cb91f1b1fa6 (commit) from 3aabc944423945e4857372fe726584f7889cbb8e (commit) - Log ----------------------------------------------------------------- commit 0ce709315c3f2493d8ff97d574641cb91f1b1fa6 Author: Subrata Modak <sub...@su...> Date: Sun May 9 19:44:04 2010 +0530 NetNS test fixes: By the way, these tests appear to start up sshd for no reason other than possibly checking that basic sockets work in the netns. Given the frailty and required setup of the "ftp" test, I think it would be better to replace it with a test using netcat and then yank the sshd bits from the ping tests. NetNS test fixes (v2): This patch fixes a couple of netns test issues that cause invalid failures relating to exiting with a status variable that doesn't exist. It also fixes an instance of inverted logic and a failure to exec sshd with the full path (as required). Additionally, it makes the common child exec function more descriptive of what it tried to do and why it failed to ease debugging. Changes in v2: - Initialize status=0 at the top of child_1.sh to prevent overshadowing a (meaningless) sshd failure, Signed-off-by: Dan Smith <da...@us...>, Acked-by: Serge E. Hallyn <se...@us...>, ----------------------------------------------------------------------- Summary of changes: testcases/kernel/containers/netns/child_1.sh | 1 + testcases/kernel/containers/netns/childns.sh | 4 +++- testcases/kernel/containers/netns/common.c | 3 +-- testcases/kernel/containers/netns/par_ftp.sh | 3 +++ testcases/kernel/containers/netns/parent_1.sh | 2 +- testcases/kernel/containers/netns/parent_2.sh | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/testcases/kernel/containers/netns/child_1.sh b/testcases/kernel/containers/netns/child_1.sh index 1fa71a7..a63e834 100755 --- a/testcases/kernel/containers/netns/child_1.sh +++ b/testcases/kernel/containers/netns/child_1.sh @@ -30,6 +30,7 @@ export TST_COUNT export TST_TOTAL . initialize.sh +status=0 # Writing child PID number into /tmp/FIFO echo $$ > /tmp/FIFO2 diff --git a/testcases/kernel/containers/netns/childns.sh b/testcases/kernel/containers/netns/childns.sh index 3634d81..16fc7e8 100755 --- a/testcases/kernel/containers/netns/childns.sh +++ b/testcases/kernel/containers/netns/childns.sh @@ -38,6 +38,8 @@ exists awk grep ip ping sshd . initialize.sh status=0 +SSHD=`which sshd` + if [ $# -eq 1 ] ; then childscrpt=$1 debug "INFO: The script to be executed in child NS is $childscrpt" @@ -58,7 +60,7 @@ ifconfig lo up sleep 2 #starting the sshd inside the child NS -if ! sshd -p $PORT; then +if $SSHD -p $PORT; then debug "INFO: started the sshd @ port no $PORT" sshpid=`ps -ef | grep "sshd -p $PORT" | grep -v grep | awk '{ print $2 ; exit 0} ' ` else diff --git a/testcases/kernel/containers/netns/common.c b/testcases/kernel/containers/netns/common.c index 22d0e99..6d3b02e 100644 --- a/testcases/kernel/containers/netns/common.c +++ b/testcases/kernel/containers/netns/common.c @@ -48,8 +48,7 @@ int crtchild(char *s1 , char *s2) { char *cmd[] = { "--", s1, s2, (char *)0 }; execve("/bin/sh", cmd, __environ); - printf("The code would not reach here on success\n"); - perror("execve"); + fprintf(stderr, "Failed to execve(%s, %s): %m\n", s1, s2); return 1; } diff --git a/testcases/kernel/containers/netns/par_ftp.sh b/testcases/kernel/containers/netns/par_ftp.sh index 3bfb47b..bb65db4 100755 --- a/testcases/kernel/containers/netns/par_ftp.sh +++ b/testcases/kernel/containers/netns/par_ftp.sh @@ -37,6 +37,7 @@ export TST_TOTAL if [ $? = 0 ] ; then tst_resm TINFO "Pinging ChildNS from ParentNS" + status=0 else tst_resm TFAIL "Error: Unable to ping ChildNS from ParentNS" status=-1 @@ -45,3 +46,5 @@ export TST_TOTAL if [ $stat != 0 ] ; then status=$stat fi + + exit $status diff --git a/testcases/kernel/containers/netns/parent_1.sh b/testcases/kernel/containers/netns/parent_1.sh index 8577bf2..32f1a47 100755 --- a/testcases/kernel/containers/netns/parent_1.sh +++ b/testcases/kernel/containers/netns/parent_1.sh @@ -55,4 +55,4 @@ export TST_TOTAL echo $vnet1 > /tmp/FIFO1 debug "INFO: PARENT_1: End of $0" - exit $status + exit 0 diff --git a/testcases/kernel/containers/netns/parent_2.sh b/testcases/kernel/containers/netns/parent_2.sh index 57d3974..f72c16d 100755 --- a/testcases/kernel/containers/netns/parent_2.sh +++ b/testcases/kernel/containers/netns/parent_2.sh @@ -51,4 +51,4 @@ export TST_TOTAL echo $vnet3 > /tmp/FIFO3 debug "INFO: PARENT-2: End of $0" - exit $status + exit 0 hooks/post-receive -- ltp |
From: Subrata <ris...@li...> - 2010-05-07 08:59:47
|
The branch, master, has been updated via 3aabc944423945e4857372fe726584f7889cbb8e (commit) from c98956ba8f40b4c9004ff5767db2b2d87ab46e41 (commit) - Log ----------------------------------------------------------------- commit 3aabc944423945e4857372fe726584f7889cbb8e Author: Subrata Modak <sub...@su...> Date: Fri May 7 14:28:18 2010 +0530 Most of these are belated cleanup after the move to using /opt/ltp. But come on, replacing 'return' with tst_exit(), are you just trying to mess with my head? Changelog: may 4: address Garrett's feedback 1. single return 0 in print_caps.c 2. use $TMP if defined for location of caps_fifo 3. use tst_brkm in place of tst_resm. may 5: address Garrett's comment: don't add 1 to null pointer and then check for 1 Signed-off-by: Serge E. Hallyn <se...@us...>, Acked-by: Garrett Cooper <yan...@gm...>, ----------------------------------------------------------------------- Summary of changes: testcases/kernel/security/filecaps/filecapstest.sh | 10 +++- testcases/kernel/security/filecaps/print_caps.c | 5 +- .../kernel/security/filecaps/verify_caps_exec.c | 51 ++++++++------------ 3 files changed, 30 insertions(+), 36 deletions(-) diff --git a/testcases/kernel/security/filecaps/filecapstest.sh b/testcases/kernel/security/filecaps/filecapstest.sh index 43582dc..8e2ba11 100755 --- a/testcases/kernel/security/filecaps/filecapstest.sh +++ b/testcases/kernel/security/filecaps/filecapstest.sh @@ -22,8 +22,12 @@ echo "Running in:" #rm -f print_caps #cp $LTPROOT/testcases/bin/print_caps . -mkfifo caps_fifo -chmod 777 caps_fifo +#FIFOFILE="$LTPROOT/testcases/bin/caps_fifo" +TMP=${TMP:=/tmp} +FIFOFILE="$TMP/caps_fifo" +rm -f $FIFOFILE +mkfifo $FIFOFILE +chmod 777 $FIFOFILE exit_code=0 echo "cap_sys_admin tests" verify_caps_exec 0 @@ -46,5 +50,5 @@ if [ $tmp -ne 0 ]; then exit_code=$tmp fi -unlink caps_fifo +unlink $FIFOFILE exit $exit_code diff --git a/testcases/kernel/security/filecaps/print_caps.c b/testcases/kernel/security/filecaps/print_caps.c index f0e9bce..1c3fc1b 100644 --- a/testcases/kernel/security/filecaps/print_caps.c +++ b/testcases/kernel/security/filecaps/print_caps.c @@ -36,7 +36,7 @@ #include <sys/capability.h> #endif -#define FIFOFILE "caps_fifo" +#define FIFOFILE "/tmp/caps_fifo" int main(int argc, char *argv[]) { @@ -65,7 +65,6 @@ int main(int argc, char *argv[]) close(fd); cap_free(cap); -#else - return 0; #endif + return 0; } diff --git a/testcases/kernel/security/filecaps/verify_caps_exec.c b/testcases/kernel/security/filecaps/verify_caps_exec.c index 5250007..605f0f6 100644 --- a/testcases/kernel/security/filecaps/verify_caps_exec.c +++ b/testcases/kernel/security/filecaps/verify_caps_exec.c @@ -43,7 +43,7 @@ #include <sys/prctl.h> #include <test.h> -#define TSTPATH "./print_caps" +#define TSTPATH "print_caps" char *TCID = "filecaps"; int TST_TOTAL=1; @@ -70,7 +70,7 @@ void print_my_caps() cap_free(txt); } -int drop_root(int keep_perms) +void drop_root(int keep_perms) { int ret; @@ -78,16 +78,19 @@ int drop_root(int keep_perms) prctl(PR_SET_KEEPCAPS, 1); ret = setresuid(1000, 1000, 1000); if (ret) { - perror("setresuid"); - tst_resm(TFAIL, "Error dropping root privs\n"); + tst_brkm(TFAIL | TERRNO, tst_exit, "Error dropping root privs\n"); tst_exit(); } if (keep_perms) { cap_t cap = cap_from_text("=eip"); - cap_set_proc(cap); + int ret; + if (!cap) + tst_brkm(TBROK | TERRNO, tst_exit, "cap_from_text failed\n"); + ret = cap_set_proc(cap); + if (ret < 0) + tst_brkm(TBROK | TERRNO, tst_exit, "cap_set_proc failed\n"); cap_free(cap); } - tst_exit(); } int perms_test(void) @@ -114,17 +117,14 @@ int perms_test(void) return ret; } -#define FIFOFILE "caps_fifo" +#define FIFOFILE "/tmp/caps_fifo" void create_fifo(void) { int ret; ret = mkfifo(FIFOFILE, S_IRWXU | S_IRWXG | S_IRWXO); - if (ret == -1 && errno != EEXIST) { - perror("mkfifo"); - tst_resm(TFAIL, "failed creating %s\n", FIFOFILE); - tst_exit(); - } + if (ret == -1 && errno != EEXIST) + tst_brkm(TFAIL | TERRNO, tst_exit, "failed creating %s\n", FIFOFILE); } void write_to_fifo(char *buf) @@ -142,11 +142,8 @@ void read_from_fifo(char *buf) memset(buf, 0, 200); fd = open(FIFOFILE, O_RDONLY); - if (fd < 0) { - perror("open"); - tst_resm(TFAIL, "Failed opening fifo\n"); - tst_exit(); - } + if (fd < 0) + tst_brkm(TFAIL | TERRNO, tst_exit, "Failed opening fifo\n"); read(fd, buf, 199); close(fd); } @@ -162,23 +159,18 @@ int fork_drop_and_exec(int keepperms, cap_t expected_caps) static int seqno = 0; pid = fork(); - if (pid < 0) { - perror("fork"); - tst_resm(TFAIL, "%s: failed fork\n", __FUNCTION__); - tst_exit(); - } + if (pid < 0) + tst_brkm(TFAIL | TERRNO, tst_exit, "%s: failed fork\n", __FUNCTION__); if (pid == 0) { drop_root(keepperms); print_my_caps(); sprintf(buf, "%d", seqno); ret = execlp(TSTPATH, TSTPATH, buf, NULL); - perror("execl"); - tst_resm(TFAIL, "%s: exec failed\n", __FUNCTION__); capstxt = cap_to_text(expected_caps, NULL); snprintf(buf, 200, "failed to run as %s\n", capstxt); cap_free(capstxt); write_to_fifo(buf); - tst_exit(); + tst_brkm(TFAIL, tst_exit, "%s: exec failed\n", __FUNCTION__); } else { p = buf; while (1) { @@ -190,11 +182,10 @@ int fork_drop_and_exec(int keepperms, cap_t expected_caps) tst_resm(TINFO, "got a bad seqno (c=%d, s=%d, seqno=%d)", c, s, seqno); } - p = index(buf, '.')+1; - if (p==(char *)1) { - tst_resm(TFAIL, "got a bad message from print_caps\n"); - tst_exit(); - } + p = index(buf, '.'); + if (!p) + tst_brkm(TFAIL, tst_exit, "got a bad message from print_caps\n"); + p += 1; actual_caps = cap_from_text(p); if (cap_compare(actual_caps, expected_caps) != 0) { capstxt = cap_to_text(expected_caps, NULL); hooks/post-receive -- ltp |
From: Subrata <ris...@li...> - 2010-05-07 08:53:43
|
The branch, master, has been updated via c98956ba8f40b4c9004ff5767db2b2d87ab46e41 (commit) from f0be8b0c4489defeb6eaf6715576524a48b8998a (commit) - Log ----------------------------------------------------------------- commit c98956ba8f40b4c9004ff5767db2b2d87ab46e41 Author: Subrata Modak <sub...@su...> Date: Fri May 7 14:21:00 2010 +0530 The MAX_CLOCKS supported by the kernel is 16. But the kernel may not have all the clock sources defined in the range 0-15. Hence, to test whether kernel returns error for an INVALID clock source id, we should use the upper limit MAX_CLOCKS (16 at the moment). But to verify the the defined clocks work fine, we should loop through the "list" of clock sources defined for sure. MAX_CLOCKS marsk the end of the clock sources in the array. Signed-off-by: Suzuki K P <su...@in...>, Acked-by: Garrett Cooper <yan...@gm...>, ----------------------------------------------------------------------- Summary of changes: testcases/kernel/timers/include/common_timers.h | 5 ++++- .../kernel/timers/timer_create/timer_create02.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/timers/include/common_timers.h b/testcases/kernel/timers/include/common_timers.h index 6af4d70..d9b7cb9 100644 --- a/testcases/kernel/timers/include/common_timers.h +++ b/testcases/kernel/timers/include/common_timers.h @@ -29,7 +29,10 @@ clock_t clock_list[] = { CLOCK_MONOTONIC_COARSE, #endif }; -#define MAX_CLOCKS (sizeof(clock_list) / sizeof(*clock_list)) +/* CLOCKS_DEFINED is the number of clock sources defined for sure */ +#define CLOCKS_DEFINED (sizeof(clock_list) / sizeof(*clock_list)) +/* MAX_CLOCKS is the maximum number of clock sources supported by kernel */ +#define MAX_CLOCKS 16 #define CLOCK_TO_STR(def_name) \ case def_name: \ diff --git a/testcases/kernel/timers/timer_create/timer_create02.c b/testcases/kernel/timers/timer_create/timer_create02.c index 6aba4ea..cef7cbe 100755 --- a/testcases/kernel/timers/timer_create/timer_create02.c +++ b/testcases/kernel/timers/timer_create/timer_create02.c @@ -113,7 +113,7 @@ main(int ac, char **av) setup_test(i); - for (j = 0; j < MAX_CLOCKS; ++j) { + for (j = 0; j < CLOCKS_DEFINED; ++j) { if (strstr(get_clock_str(clock_list[j]), "CPUTIME_ID")) { hooks/post-receive -- ltp |
From: Subrata <ris...@li...> - 2010-05-07 05:18:08
|
The branch, master, has been updated via f0be8b0c4489defeb6eaf6715576524a48b8998a (commit) from 3e113a2101b36d6799ec1d41317bfa16d197c9a2 (commit) - Log ----------------------------------------------------------------- commit f0be8b0c4489defeb6eaf6715576524a48b8998a Author: Subrata Modak <sub...@su...> Date: Fri May 7 10:33:00 2010 +0530 We should to check the return value of trigger_eventfd_overflow() in overflow_poll_test(). Signed-off-by: Shi Weihua <sh...@cn...>, Acked-by: Garrett Cooper <yan...@gm...>, ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/eventfd/eventfd01.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c b/testcases/kernel/syscalls/eventfd/eventfd01.c index 83eb86e..ce55746 100644 --- a/testcases/kernel/syscalls/eventfd/eventfd01.c +++ b/testcases/kernel/syscalls/eventfd/eventfd01.c @@ -602,7 +602,7 @@ static void overflow_poll_test(int evfd) int ret; ret = trigger_eventfd_overflow(evfd, &fd, &ctx); - if (fd == -1) { + if (ret == -1) { tst_resm(TBROK, "error triggering eventfd overflow"); return; } hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-05-04 04:40:39
|
The branch, master, has been updated via 3e113a2101b36d6799ec1d41317bfa16d197c9a2 (commit) from 84f2e35f109a9fe6591af83be0ddbda4a5f7c78c (commit) - Log ----------------------------------------------------------------- commit 3e113a2101b36d6799ec1d41317bfa16d197c9a2 Author: Rishikesh K Rajak <ris...@li...> Date: Tue May 4 10:09:25 2010 +0530 Changelog update till 30th April 2010. Signed-off-by: Rishikesh K Rajak <ris...@li...> ----------------------------------------------------------------------- Summary of changes: ChangeLog | 633 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 633 insertions(+), 0 deletions(-) diff --git a/ChangeLog b/ChangeLog index a3ff04f..dcba787 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,636 @@ +LTP-20100430 +Commit: 84f2e35f109a9fe6591af83be0ddbda4a5f7c78c +Date: Thu, 29 Apr 2010 19:02:46 +0530 + +Fix for mqns testcase failure reported by Muni +Signed-off-by: Serge Hallyn <se...@us...> +Reported by: Munipradeep <mbe...@in...> + +Changed Files: + +testcases/kernel/containers/mqns/mqns.h +testcases/kernel/containers/mqns/mqns_01.c +testcases/kernel/containers/mqns/mqns_02.c +testcases/kernel/containers/mqns/mqns_03.c +testcases/kernel/containers/mqns/mqns_04.c + +Commit: 5936767b86201d8409bb62a74770e60de1796adc +Date: Thu, 29 Apr 2010 19:00:01 +0530 + +pidns30 fix + Signed-off-by: Serge Hallyn <se...@us...> + Acked-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/kernel/containers/pidns/pidns30.c + +Commit: 742cfadb46d5fe1952396b9568c18afccdb2c489 +Date: Thu, 29 Apr 2010 18:56:12 +0530 + +Fix for mqns by Serge. +Signed-off-by: Serge Hallyn <se...@us...> +Acked-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/kernel/containers/mqns/mqns_02.c + +Commit: e6dc1b454e09e3e38532c37c3fb54c77eb3050cf +Date: Thu, 29 Apr 2010 18:50:22 +0530 + +While packaging ltp-full-20100228 I've found out that man files are installed with executable bits and that's caused by INSTALL_MODE := 00775 that is pulled from generic_leaf_target.mk that pulls in env_post.mk. Fixing explicitly INSTALL_MODE to 00644 in man.mk fixes this for me. Patch attached. +Signed-off-by: Cyril Hrubis ch...@su... + +Changed Files: + +include/mk/man.mk + +Commit: 40f8829df38ecfe64c0fcd16a6ce7b5b19b83f25 +Date: Thu, 29 Apr 2010 14:50:16 +0530 + +Merge branch 'pu' + +Changed Files: + +Commit: acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 +Date: Thu, 29 Apr 2010 14:48:45 +0530 + +Merge branch 'master' into next + +Changed Files: + +Commit: c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef +Date: Wed, 28 Apr 2010 11:39:03 +0530 + +Generating HTML Output.....!! Can't open perl script "/opt/ltp/tools/genhtml.pl": No such file or directory +Following patch fixes the same. + +Signed-off-by: Subrata Modak <su...@li...> +Acked-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +runltp + +Commit: d9f3d25b9db35073c7104b759d526869d9867692 +Date: Mon, 26 Apr 2010 13:19:40 +0530 + +The test_fs_bind testscript hangs indefinitely when run on a machine where busybox applets are used. +The test hangs while trying to restore the mounts after a test run. + +This happens because the "xargs" applet from busybox doesn't understand +the --max-args=1 option. Thus, the mounts from the test are not removed +and this goes on in a loop, indefinitely. + +This could be avoided by using "-n" option which is supported by both +the implementations of xargs. + +Signed-off-by: Suzuki K P <su...@in...> + +Changed Files: + +testscripts/test_fs_bind.sh + +Commit: 23e7806fec4c6be42fdf577559df5498cce45118 +Date: Fri, 23 Apr 2010 12:35:10 +0530 + +Running the ltp suite on ChromeOS (x86 with a 2.6.32 kernel) fails linkat01 testcase 21: +linkat01 21 TFAIL : linkat() failed: TEST_ERRNO=EXDEV(18): Invalid +cross-device link + +This is probably because my /tmp is mounted from someplace other than the +filesystem that contains newdirfd. +The goal of testcase 21 is to demonstrate that linking a directory will fail +EPERM. The fix is to use olddir/. instead of /tmp. + +Tested-by: Henry Yei <hy...@mv...> +Signed-off-by: Bryan Freed <bf...@go...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/kernel/syscalls/linkat/linkat01.c + +Commit: 5162b710bfc574107d915093c08b198f0a15727e +Date: Thu, 22 Apr 2010 11:36:48 +0530 + + prio-wake: avoid glibc to kernel sleep race + In the unlocked broadcast scenario, there exists a race between when the + running_threads variable reaches rt_threads and when the last worker_thread + blocks in the kernel after a cond_wait(). It is possible for a thread to miss + the broadcast if it fails to sleep before the broadcast is issued. + + The previous code did not guarantee a small window of time to allow the threads + to get to sleep. It also used an unreasonably large sleep time which + unnecessarily extended the length of the test run time. This patch ensures some + time is given to the threads to get to sleep and at the same time uses a much + shorter (1000x) sleep period which results in a 50-100x reduction in test run + time. Lastly, two unecessary loops waiting for the threads to complete were + removed, relying on pthread_join() instead to wait for the threads to complete. + + Signed-off-by: Darren Hart <dv...@us...> + Acked-by: Will Schmidt <wil...@vn...> + +Changed Files: + +testcases/realtime/func/prio-wake/prio-wake.c + +Commit: d0605c4e9525bd5ecdd0ba28ba27b8b237d1cfc8 +Date: Tue, 20 Apr 2010 17:15:13 +0530 + +msgctl10() un-necessarily eats up all the PIDs of the system leading to system becoming un-responsive. The changed no.s would better do the job. +Signed-off-by: Subrata Modak<su...@li...> +Acked/Tested-By: Caspar ZHANG <cz...@re...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/kernel/syscalls/ipc/msgctl/msgctl10.c + +Commit: adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 +Date: Fri, 16 Apr 2010 08:44:17 +0530 + +Script utimensat_tests.sh deletes the test it is executing instead of deleting temporary directory. Patch attached. +Signed-off-by: Cyril Hrubis <ch...@su...> + +Changed Files: + +testcases/kernel/syscalls/utimensat/utimensat_tests.sh + +Commit: 1c9ec5ec1389062a4a091fee7295b36a6583df5d +Date: Thu, 15 Apr 2010 14:56:14 +0530 + +Merge branches 'next' and 'pu' into pu + +Changed Files: + +Commit: 4eca2b5b7d3f4dfb1fd661eab2931d3564a4a85f +Date: Thu, 15 Apr 2010 14:55:31 +0530 + +Merge branches 'pu' and 'next' into next + +Changed Files: + +Commit: 6fc71a4987f658ac48b476defb8cc341cb7361c3 +Date: Thu, 15 Apr 2010 14:54:39 +0530 + +merge with pu branch changed by Garret +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/commands/mail/mail_tests.sh +testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c +testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c +testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c +testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c + +Commit: 1ff0128460531d9f9c46353eba65dd79ca27bbc8 +Date: Thu, 15 Apr 2010 01:34:13 -0700 + +Correct comment so that it filters its way up to next (eventually). +Signed-off-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/commands/mail/mail_tests.sh + +Commit: c150e9b196b1267beeefdaec4dde9933503448f3 +Date: Thu, 15 Apr 2010 12:17:56 +0530 + +I tried "eventfd01" test in my system. This test failed with TWARN (return code:4) : +------------ + eventfd01 1 TCONF : 2.6.22 or greater kernel required + eventfd01 2 TCONF : Remaining cases not appropriate for +configuration + eventfd01 3 TCONF : Remaining cases not appropriate for +configuration + eventfd01 4 TCONF : Remaining cases not appropriate for +configuration + eventfd01 5 TCONF : Remaining cases not appropriate for +configuration + eventfd01 6 TCONF : Remaining cases not appropriate for +configuration + eventfd01 7 TCONF : Remaining cases not appropriate for +configuration + eventfd01 8 TCONF : Remaining cases not appropriate for +configuration + eventfd01 9 TCONF : Remaining cases not appropriate for +configuration + eventfd01 10 TCONF : Remaining cases not appropriate for +configuration + eventfd01 11 TCONF : Remaining cases not appropriate for +configuration + eventfd01 12 TCONF : Remaining cases not appropriate for +configuration + eventfd01 13 TCONF : Remaining cases not appropriate for +configuration + eventfd01 14 TCONF : Remaining cases not appropriate for +configuration + eventfd01 15 TCONF : Remaining cases not appropriate for +configuration + eventfd01 0 TWARN : tst_rmdir(): TESTDIR was NULL; no removal +attempted +------------ + +Signed-off-by: Tomonori Mitani <mi...@ry...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/kernel/syscalls/eventfd/eventfd01.c + +Commit: eaf73222df286c200475aadac78122b182b5f388 +Date: Thu, 15 Apr 2010 12:14:19 +0530 + +I found out that "-)20" test of "ar01" failed once in a while. Its code is as follows: ------------ ... rm -rf $TCtmp/lib.a;cd $TCdat ar -cr $TCtmp/lib.a file0.in file2.in crtest File1time=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` File2time=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` +touch -c -t 201503030303.55 file0.in + +ar -ru $TCtmp/lib.a file0.in file2.in 2>&1 1>/dev/null +File1time1=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" +"` +File2time2=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" +"` + +if [ $File2time = $File2time2 ] +then + if [ $File1time = $File1time1 ] + then + TCRESULT + echo "FAIL - ar with -u flag failed" + else + echo "-)20" + fi +else + TCRESULT + echo "FAIL - ar with -u flag failed" +fi +touch file0.in +... +------------ + +"file0.in" and "file2.in" are offered with "ar01" source, and they are +copied when "make install" is executed. + +In this code, "File1time" and "File1time1" are times of before and +after time-stamp changing of "file0.in" by "touch -c -t ..." command. +But "File1time" and "File1time1" are only minute numbers. +It's problem, I think. + +If installation is at 2010.04.06 XX:03 accidentally, both of +"File1time" and "File1time1" are "03". +And this code ends as "FAIL". +This happens with a one-60th probability. + +Signed-off-by: Tomonori Mitani <mi...@ry...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/commands/ade/ar/ar01 + +Commit: cc7c7035a60b40f9a417b5e437ca6ea43ebfd783 +Date: Thu, 15 Apr 2010 12:08:07 +0530 + +I tried to build by using yesterday's git in my system (RHEL4.8 x86). (ltp-dev-4837fee8a7c2de6a83c8927a574c792ca6dabe4e.tar.gz) But build failed in "cap_bset_inh_bounds.c" with following message. This is different from "cap_bounds_r.c"'s problem (another thread), I think +------------ +gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall +-I/home/LTP/ltp-dev-20100401-3/testcases/kernel/include +-I../../../../include -I../../../../include -L../../../../lib +cap_bset_inh_bounds.c -lltp -lcap -o cap_bset_inh_bounds +cap_bset_inh_bounds.c:124: error: syntax error before numeric constant +cap_bset_inh_bounds.c:124: warning: type defaults to `int' in declaration of +`tst_resm' +cap_bset_inh_bounds.c:124: error: conflicting types for 'tst_resm' +../../../../include/test.h:192: error: previous declaration of 'tst_resm' +was here +cap_bset_inh_bounds.c:124: error: conflicting types for 'tst_resm' +../../../../include/test.h:192: error: previous declaration of 'tst_resm' +was here +cap_bset_inh_bounds.c:124: warning: data definition has no type or storage +class +cap_bset_inh_bounds.c:129: warning: type defaults to `int' in declaration of +`tst_exit' +cap_bset_inh_bounds.c:129: error: conflicting types for 'tst_exit' +../../../../include/test.h:203: error: previous declaration of 'tst_exit' +was here +cap_bset_inh_bounds.c:129: error: conflicting types for 'tst_exit' +../../../../include/test.h:203: error: previous declaration of 'tst_exit' +was here +cap_bset_inh_bounds.c:129: warning: data definition has no type or storage +class +cap_bset_inh_bounds.c:130: error: syntax error before '}' token +------------ + +In this source, the pair of "ifdef" start/end and the pair of +main() function's "parenthesis" are alternate, I think. + +Acked-by: Serge Hallyn <se...@us...> +Signed-off-by : Tomonori Mitani <mi...@ry...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c + +Commit: 2a276cf8bb5b94259482ec039edc2ae7fbaf953e +Date: Thu, 15 Apr 2010 12:06:23 +0530 + +I found two problems in mail test. (${LTPROOT}/testcases/commands/mail/mail_tests.sh) They are simple mistakes, I think. +1) About judgment for making a user name +In line 80 of "mail_tests.sh", there is following sentence. +------------ +if id -u mail_test >/dev/null 2>&1; then +------------ +This control sentence is going to judge whether the result of +"id -u mail_test" command is normal or not, I think. +But this sentence is not effective. +Therefore the user name "make_test" cannot be made when this user name +isn't exist. + +2) About "blind carbon copy" option +In "mail_tests.sh", there are 5 tests about mail. +5th is "blind carbon copy" test. +However, this test doesn't use "-b" option but uses "-c" option. + +Signed-off-by: Tomonori Mitani <mi...@ry...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/commands/mail/mail_tests.sh + +Commit: a9d5600c78943e9e7e1b52c5ec81e9772a47b44f +Date: Thu, 15 Apr 2010 12:04:09 +0530 + +I tried "hugemmap", "hugeshmat", "hugeshmctl", "hugeshmdt" and "hugeshmget" tests. And I found several fails in them: ------------<at "${LTPROOT}/testcases/kernel/mem/hugetlb/" directory> - ./hugemmap/ 1) hugemmap04 : return code = 2 + - ./hugeshmat/ + 2) hugeshmat01 : return code = 6 + 3) hugeshmat02 : return code = 6 + 4) hugeshmat03 : return code = 2 + + - ./hugeshmctl/ + 5) hugeshmctl01 : return code = 6 + 6) hugeshmctl02 : return code = 6 + 7) hugeshmctl03 : return code = 2 + + - ./hugeshmdt/ + 8) hugeshmdt01 : return code = 6 + + - ./hugeshmget/ + 9) hugeshmget01 : return code = 2 + 10) hugeshmget02 : return code = 6 + 11) hugeshmget03 : return code = 6 + 12) hugeshmget05 : return code = 2 +------------ + +These tests output following messages: +------------ + a) All tests: +"TBROK : Test cannot be continued owning to sufficient availability of +Hugepages on the system" + + b) 2), 3), 5), 6), 8), 10), 11) tests: +"TWARN : tst_rmdir(): TESTDIR was NULL; no removal attempted" +------------ + +Both case a) and case b) are caused by the same reason. + +All of case a) failures occured at the following points (for example +hugemmap04): +------------<hugemmap04.c - main()> + /* Check number of hugepages */ + if (get_no_of_hugepages() <= 0 || hugepages_size() <= 0) + tst_brkm(TBROK, cleanup, "Test cannot be continued owning to +\ + sufficient availability of Hugepages on the +system"); +------------ + +I found out that "HugePages_Total" parameter of "/proc/meminfo" file +is set to "0". This caused above TBROK failure. It is environment problem. + +But, in this case, tests must not return with TBROK, but with TCONF, +I think. + +And, in case b), these tests try to delete "TESTDIR" directory by +calling "tst_rmdir()" function in "cleanup()" function. +But, "TESTDIR" never set if "tst_tmpdir()" function isn't called. +I think that case b)'s tests must not call cleanup() function. + +I want to suggest following patch. + +Signed-off-by: Tomonori Mitani <mi...@ry...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c +testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c +testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c +testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c +testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c +testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c +testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c +testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c +testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c +testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c + +Commit: 2e271475913722d7c29463c64703575dff69c4fb +Date: Thu, 8 Apr 2010 00:27:08 -0700 + +Note #define vs enum conformance issue with signal_h/26-1.c +Signed-off-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c + +Commit: 2eb2342d3a9db5a089742473895af4fdf1e6f4c8 +Date: Wed, 7 Apr 2010 21:57:26 -0700 + +Fix more deprecated malloc.h includes. +Signed-off-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c +testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c + +Commit: 5da1b33941b513ac1f693cf86e27b5750b43dea2 +Date: Wed, 7 Apr 2010 21:53:54 -0700 + +Fix incorrect / missing included headers. +POSIX 1003.1 2004 states that stdlib.h supplants malloc.h and signal.h is required for sigaction and sigemptyset. + +Signed-off-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c + +Commit: e90e0138cb7444d5db967183397b776979efd593 +Date: Wed, 7 Apr 2010 21:37:13 -0700 + +Fix a typo and add a missing definition for non-Linux platforms. +aio.h appears to either define or pull in other headers that define NULL. This isn't true on FreeBSD. + +Signed-off-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c +testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c + +Commit: 001227f859f24bde222d0813d9327afe4c132a33 +Date: Wed, 7 Apr 2010 03:08:43 -0700 + +Fix a rookie typo with #ifdef vs #if defined() +Ok, I'm tired... need to stop making such rookie mistakes with #ifdef :P. + +Signed-off-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c + +Commit: 1d67dc1564c73d49fc681679e4a5b9be48420e48 +Date: Wed, 7 Apr 2010 02:50:32 -0700 + +Add proper checks for Linux and the BSDs. +Signed-off-by: Garrett Cooper <yan...@gm...> + +Changed Files: + +testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c + +Commit: 4837fee8a7c2de6a83c8927a574c792ca6dabe4e +Date: Thu, 1 Apr 2010 12:45:00 +0530 + +Merge branches 'next' and 'master' + +Changed Files: + +Commit: aabf191024aacc91784593b0d3f8d5fa37434b25 +Date: Thu, 1 Apr 2010 12:43:27 +0530 + +Added a new file called result where maintainer need to provide the result on which he has run before releasing the tar ball for month end release. +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +result + +Commit: 3bf514769d060a64d0f38f4b97c00d8bb0de74f8 +Date: Thu, 1 Apr 2010 11:34:36 +0530 + +Merge branches 'next' and 'pu' into pu + +Changed Files: + +Commit: 44fba94453ca4f446cde4db08b0a760862b55cfa +Date: Thu, 1 Apr 2010 11:30:52 +0530 + +Merge branches 'next' and 'master' + +Changed Files: + +Commit: f50539e0bcb0f9bab88101ce40a8e09a1d76d4a9 +Date: Thu, 1 Apr 2010 11:25:49 +0530 + +Modified nets/Makefile for appending one file which needs in /opt/ltp/tetscases/bin directory while install. +======================================================================================= +parentns.sh 0 TINFO : Pinging ChildNS from ParentNS +sshd re-exec requires execution with an absolute path +/opt/ltp/testcases/bin/ch_ftp.sh: line 37: ./container_ftp.pl: No such file or directory +childns.sh 1 TFAIL : ftp failed +Error while running the script +two_children_ns: return code is 1 ; par_chld_ftp: FAIL 1 ; +======================================================================================= + +After patch applied the resule is like this: + +======================================================================================= +parentns.sh 0 TINFO : Pinging ChildNS from ParentNS +sshd re-exec requires execution with an absolute path +Error: Can't ftp to 192.168.0.181: Connection refused +childns.sh 1 TFAIL : ftp failed +Error while running the script +two_children_ns: return code is 1 ; par_chld_ftp: FAIL 1 ; +======================================================================================= + +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/kernel/containers/netns/Makefile + +Commit: 4ccf10848def0a6f48e0fa1302056101564fedb0 +Date: Thu, 1 Apr 2010 11:17:51 +0530 + +NETNS tests from containers fails to execute with following message +Running netns tests. +--: childns.sh '/opt/ltp': No such file or directory + +LTP infrastructure fails to locate the childns.sh script. Fix this. +There were few hardcoded paths within various tests which are not available +during runtime. + +eg : %s/testcases/kernel/containers/netns/paripv6.sh + +Fix those occurences by specifying proper paths (%s/testcases/bin/paripv6.sh) + +The following patch allows the test to be executed properly on my Fedora 12 +system. + +Signed-off-by : Sachin Sant <sa...@in...> +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +testcases/kernel/containers/netns/common.c +testcases/kernel/containers/netns/par_chld_ipv6.c +testcases/kernel/containers/netns/sysfsview.c +testcases/kernel/containers/netns/two_children_ns.c + +Commit: aca4428b38701e46e0da38fd7583028216c32c66 +Date: Thu, 1 Apr 2010 10:24:25 +0530 + +Added Maintainer Notes new file +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +doc/MaintNotes + +Commit: d2a9b9d3e04807fb4744dc7e778fe6e0c9543bc1 +Date: Thu, 1 Apr 2010 10:10:33 +0530 + +Merge branches 'next' and 'master' + +Changed Files: + +Commit: 613db220bc78b3109934dbdf617a7d2b3b437295 +Date: Thu, 1 Apr 2010 10:09:49 +0530 + +Changelog from 2010-03-01 to 2010-03-31 +Signed-off-by: Rishikesh K Rajak <ris...@li...> + +Changed Files: + +ChangeLog LTP-20100331 commit f269fc8247563f3fe4c412fcd8fc6522d8a34753 hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-29 13:45:31
|
The branch, next, has been updated via 8e990dfc00206bfa484ff5097127869278a46636 (commit) via 84f2e35f109a9fe6591af83be0ddbda4a5f7c78c (commit) via 5936767b86201d8409bb62a74770e60de1796adc (commit) via 742cfadb46d5fe1952396b9568c18afccdb2c489 (commit) via e6dc1b454e09e3e38532c37c3fb54c77eb3050cf (commit) via 40f8829df38ecfe64c0fcd16a6ce7b5b19b83f25 (commit) from a281aa71cbe8bf8ed9e75d8f3da85ab3bf44d021 (commit) - Log ----------------------------------------------------------------- commit 8e990dfc00206bfa484ff5097127869278a46636 Merge: a281aa71cbe8bf8ed9e75d8f3da85ab3bf44d021 84f2e35f109a9fe6591af83be0ddbda4a5f7c78c Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 19:14:45 2010 +0530 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: include/mk/man.mk | 2 ++ testcases/kernel/containers/mqns/mqns.h | 2 ++ testcases/kernel/containers/mqns/mqns_01.c | 8 ++++---- testcases/kernel/containers/mqns/mqns_02.c | 16 ++++++++-------- testcases/kernel/containers/mqns/mqns_03.c | 2 +- testcases/kernel/containers/mqns/mqns_04.c | 2 +- testcases/kernel/containers/pidns/pidns30.c | 2 +- 7 files changed, 19 insertions(+), 15 deletions(-) diff --git a/include/mk/man.mk b/include/mk/man.mk index 88abc6d..f0b4525 100644 --- a/include/mk/man.mk +++ b/include/mk/man.mk @@ -28,6 +28,8 @@ include $(top_srcdir)/include/mk/env_pre.mk INSTALL_DIR := $(mandir)/man$(MANPREFIX) +INSTALL_MODE := 00644 + INSTALL_TARGETS ?= *.$(MANPREFIX) MAKE_TARGETS := diff --git a/testcases/kernel/containers/mqns/mqns.h b/testcases/kernel/containers/mqns/mqns.h index e5912d5..1c624c2 100644 --- a/testcases/kernel/containers/mqns/mqns.h +++ b/testcases/kernel/containers/mqns/mqns.h @@ -10,6 +10,8 @@ #define DEV_MQUEUE "/dev/mqueue" #define DEV_MQUEUE2 "/dev/mqueue2" #define SLASH_MQ1 "/MQ1" +#define NOSLASH_MQ1 "MQ1" #define SLASH_MQ2 "/MQ2" +#define NOSLASH_MQ2 "MQ2" #endif /* __MQNS_H */ diff --git a/testcases/kernel/containers/mqns/mqns_01.c b/testcases/kernel/containers/mqns/mqns_01.c index 7f41b2d..515ed51 100644 --- a/testcases/kernel/containers/mqns/mqns_01.c +++ b/testcases/kernel/containers/mqns/mqns_01.c @@ -55,7 +55,7 @@ int check_mqueue(void *vtest) if (read(p1[0], buf, strlen("go") + 1) < 0) tst_resm(TBROK | TERRNO, "read(p1[0], ...) failed"); - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDONLY); + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); if (mqd == -1) { if (write(p2[1], "notfnd", strlen("notfnd") + 1) < 0) tst_resm(TBROK | TERRNO, "write(p2[1], ...) failed"); @@ -86,7 +86,7 @@ main(int argc, char *argv[]) if (pipe(p1) == -1) { perror("pipe"); exit(EXIT_FAILURE); } if (pipe(p2) == -1) { perror("pipe"); exit(EXIT_FAILURE); } - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777, NULL); if (mqd == -1) { perror("mq_open"); @@ -100,7 +100,7 @@ main(int argc, char *argv[]) if (r < 0) { tst_resm(TFAIL, "failed clone/unshare\n"); mq_close(mqd); - syscall(__NR_mq_unlink, SLASH_MQ1); + syscall(__NR_mq_unlink, NOSLASH_MQ1); tst_exit(); } @@ -122,7 +122,7 @@ main(int argc, char *argv[]) /* destroy the mqueue */ mq_close(mqd); - syscall(__NR_mq_unlink, SLASH_MQ1); + syscall(__NR_mq_unlink, NOSLASH_MQ1); tst_exit(); } diff --git a/testcases/kernel/containers/mqns/mqns_02.c b/testcases/kernel/containers/mqns/mqns_02.c index aa78f65..07ab042 100644 --- a/testcases/kernel/containers/mqns/mqns_02.c +++ b/testcases/kernel/containers/mqns/mqns_02.c @@ -60,7 +60,7 @@ int check_mqueue(void *vtest) tst_resm(TBROK | TERRNO, "read(p1[0], ..) failed"); else { - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777, NULL); if (mqd == -1) { if (write(p2[1], "mqfail", strlen("mqfail") + 1) < 0) { @@ -76,7 +76,7 @@ int check_mqueue(void *vtest) else { - if (read(p1[0], buf, 5)) + if (read(p1[0], buf, 5) < 0) tst_resm(TBROK | TERRNO, "read(p1[0], ..) failed"); else { @@ -86,9 +86,9 @@ int check_mqueue(void *vtest) tst_resm(TBROK | TERRNO, "mq_close(mqd) failed"); } else if (syscall(__NR_mq_unlink, - SLASH_MQ1) < 0) { + NOSLASH_MQ1) < 0) { tst_resm(TBROK | TERRNO, - "mq_unlink(" SLASH_MQ1 + "mq_unlink(" NOSLASH_MQ1 ") failed"); } else if (write(p2[1], "done", strlen("done") + 1) @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) } if (read(p2[0], buf, 7) < 0) { - tst_resm(TBROK, "read(p1[0], ..) failed"); + tst_resm(TBROK, "read(p2[0], ..) failed"); } else if (!strcmp(buf, "mqfail")) { tst_resm(TFAIL, "child process could not create mqueue\n"); umount(DEV_MQUEUE); @@ -153,15 +153,15 @@ int main(int argc, char *argv[]) tst_exit(); } else { - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDONLY); + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); if (mqd == -1) { tst_resm(TPASS, "Parent process can't see the mqueue\n"); } else { tst_resm(TFAIL, "Parent process found mqueue\n"); mq_close(mqd); } - if (write(p1[1], "cont", 5)) { - tst_resm(TBROK, "read(p1[0], ..) failed"); + if (write(p1[1], "cont", 5) < 0) { + tst_resm(TBROK, "write(p1[1], ..) failed"); } } diff --git a/testcases/kernel/containers/mqns/mqns_03.c b/testcases/kernel/containers/mqns/mqns_03.c index 3c9e83e..83db75c 100644 --- a/testcases/kernel/containers/mqns/mqns_03.c +++ b/testcases/kernel/containers/mqns/mqns_03.c @@ -63,7 +63,7 @@ int check_mqueue(void *vtest) read(p1[0], buf, 3); /* go */ - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, NULL); if (mqd == -1) { write(p2[1], "mqfail", 7); diff --git a/testcases/kernel/containers/mqns/mqns_04.c b/testcases/kernel/containers/mqns/mqns_04.c index f6e3f51..6f4bb8f 100644 --- a/testcases/kernel/containers/mqns/mqns_04.c +++ b/testcases/kernel/containers/mqns/mqns_04.c @@ -59,7 +59,7 @@ int check_mqueue(void *vtest) read(p1[0], buf, 3); /* go */ - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, NULL); if (mqd == -1) { write(p2[1], "mqfail", 7); diff --git a/testcases/kernel/containers/pidns/pidns30.c b/testcases/kernel/containers/pidns/pidns30.c index ea8c54c..5975b53 100644 --- a/testcases/kernel/containers/pidns/pidns30.c +++ b/testcases/kernel/containers/pidns/pidns30.c @@ -59,7 +59,7 @@ char *TCID = "pidns30"; int TST_TOTAL = 1; -char *mqname = "/mq1"; +char *mqname = "mq1"; int result = TFAIL; int errno; hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-29 13:38:59
|
The branch, master, has been updated via 84f2e35f109a9fe6591af83be0ddbda4a5f7c78c (commit) via 5936767b86201d8409bb62a74770e60de1796adc (commit) via 742cfadb46d5fe1952396b9568c18afccdb2c489 (commit) via e6dc1b454e09e3e38532c37c3fb54c77eb3050cf (commit) via 40f8829df38ecfe64c0fcd16a6ce7b5b19b83f25 (commit) via acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 (commit) via adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 (commit) via 1c9ec5ec1389062a4a091fee7295b36a6583df5d (commit) via 4eca2b5b7d3f4dfb1fd661eab2931d3564a4a85f (commit) via 6fc71a4987f658ac48b476defb8cc341cb7361c3 (commit) via 1ff0128460531d9f9c46353eba65dd79ca27bbc8 (commit) via c150e9b196b1267beeefdaec4dde9933503448f3 (commit) via eaf73222df286c200475aadac78122b182b5f388 (commit) via cc7c7035a60b40f9a417b5e437ca6ea43ebfd783 (commit) via 2a276cf8bb5b94259482ec039edc2ae7fbaf953e (commit) via a9d5600c78943e9e7e1b52c5ec81e9772a47b44f (commit) via 2e271475913722d7c29463c64703575dff69c4fb (commit) via 2eb2342d3a9db5a089742473895af4fdf1e6f4c8 (commit) via 5da1b33941b513ac1f693cf86e27b5750b43dea2 (commit) via e90e0138cb7444d5db967183397b776979efd593 (commit) via 001227f859f24bde222d0813d9327afe4c132a33 (commit) via 1d67dc1564c73d49fc681679e4a5b9be48420e48 (commit) via 3bf514769d060a64d0f38f4b97c00d8bb0de74f8 (commit) via 69d19f3fa26f62f7d27a8cd427b39fb5d29d588f (commit) from c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef (commit) - Log ----------------------------------------------------------------- commit 84f2e35f109a9fe6591af83be0ddbda4a5f7c78c Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 19:02:46 2010 +0530 Fix for mqns testcase failure reported by Muni Signed-off-by: Serge Hallyn <se...@us...> Reported by: Munipradeep <mbe...@in...> commit 5936767b86201d8409bb62a74770e60de1796adc Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 19:00:01 2010 +0530 pidns30 fix Signed-off-by: Serge Hallyn <se...@us...> Acked-by: Garrett Cooper <yan...@gm...> commit 742cfadb46d5fe1952396b9568c18afccdb2c489 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 18:56:12 2010 +0530 Fix for mqns by Serge. Signed-off-by: Serge Hallyn <se...@us...> Acked-by: Garrett Cooper <yan...@gm...> commit e6dc1b454e09e3e38532c37c3fb54c77eb3050cf Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 18:50:22 2010 +0530 While packaging ltp-full-20100228 I've found out that man files are installed with executable bits and that's caused by INSTALL_MODE := 00775 that is pulled from generic_leaf_target.mk that pulls in env_post.mk. Fixing explicitly INSTALL_MODE to 00644 in man.mk fixes this for me. Patch attached. Signed-off-by: Cyril Hrubis ch...@su... commit 40f8829df38ecfe64c0fcd16a6ce7b5b19b83f25 Merge: acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 1c9ec5ec1389062a4a091fee7295b36a6583df5d Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 14:50:16 2010 +0530 Merge branch 'pu' ----------------------------------------------------------------------- Summary of changes: include/mk/man.mk | 2 ++ testcases/commands/ade/ar/ar01 | 12 ++++++------ testcases/commands/mail/mail_tests.sh | 2 +- testcases/kernel/containers/mqns/mqns.h | 2 ++ testcases/kernel/containers/mqns/mqns_01.c | 8 ++++---- testcases/kernel/containers/mqns/mqns_02.c | 16 ++++++++-------- testcases/kernel/containers/mqns/mqns_03.c | 2 +- testcases/kernel/containers/mqns/mqns_04.c | 2 +- testcases/kernel/containers/pidns/pidns30.c | 2 +- testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c | 3 +-- .../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat02.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat03.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c | 2 +- .../kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget02.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget03.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget05.c | 2 +- .../security/cap_bound/cap_bset_inh_bounds.c | 4 ++-- testcases/kernel/syscalls/eventfd/eventfd01.c | 2 +- .../kernel/syscalls/utimensat/utimensat_tests.sh | 2 +- .../conformance/definitions/aio_h/2-1.c | 1 + .../conformance/definitions/errno_h/3-1.c | 2 +- .../conformance/definitions/pthread_h/2-2.c | 9 +++++++++ .../conformance/interfaces/aio_cancel/3-1.c | 2 +- .../conformance/interfaces/aio_cancel/4-1.c | 1 - .../conformance/interfaces/aio_cancel/5-1.c | 1 - .../conformance/interfaces/aio_cancel/6-1.c | 1 - .../conformance/interfaces/aio_cancel/7-1.c | 1 - .../conformance/interfaces/aio_error/2-1.c | 1 - .../conformance/interfaces/sched_yield/1-1.c | 14 +++++++------- 34 files changed, 61 insertions(+), 53 deletions(-) diff --git a/include/mk/man.mk b/include/mk/man.mk index 88abc6d..f0b4525 100644 --- a/include/mk/man.mk +++ b/include/mk/man.mk @@ -28,6 +28,8 @@ include $(top_srcdir)/include/mk/env_pre.mk INSTALL_DIR := $(mandir)/man$(MANPREFIX) +INSTALL_MODE := 00644 + INSTALL_TARGETS ?= *.$(MANPREFIX) MAKE_TARGETS := diff --git a/testcases/commands/ade/ar/ar01 b/testcases/commands/ade/ar/ar01 index c90faf9..55363dc 100755 --- a/testcases/commands/ade/ar/ar01 +++ b/testcases/commands/ade/ar/ar01 @@ -519,19 +519,19 @@ echo "-)19 SKIPPED due to binutils ar automatically adds a symbol." rm -rf $TCtmp/lib.a;cd $TCdat ar -cr $TCtmp/lib.a file0.in file2.in crtest -File1time=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` -File2time=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` +File1time=`ar -tv $TCtmp/lib.a | grep file0.in` +File2time=`ar -tv $TCtmp/lib.a | grep file2.in` #sleep 5 touch -c -t 201503030303.55 file0.in ar -ru $TCtmp/lib.a file0.in file2.in 2>&1 1>/dev/null -File1time1=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` -File2time2=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` +File1time1=`ar -tv $TCtmp/lib.a | grep file0.in` +File2time2=`ar -tv $TCtmp/lib.a | grep file2.in` -if [ $File2time = $File2time2 ] +if [ "$File2time" = "$File2time2" ] then - if [ $File1time = $File1time1 ] + if [ "$File1time" = "$File1time1" ] then TCRESULT=20 echo "FAIL - ar with -u flag failed" diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh index 790cdd6..99aa278 100755 --- a/testcases/commands/mail/mail_tests.sh +++ b/testcases/commands/mail/mail_tests.sh @@ -326,7 +326,7 @@ RC=0 tst_resm TINFO "Test #5: Test that mail -b user@domain will" tst_resm TINFO "Test #5: blind carbon copy user@domain" -# send mail to root and carbon copy mail_test +# send mail to root and blind carbon copy mail_test mail -s "Test" root@localhost -c mail_test@localhost < \ $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1 if [ $? -ne 0 ]; then diff --git a/testcases/kernel/containers/mqns/mqns.h b/testcases/kernel/containers/mqns/mqns.h index e5912d5..1c624c2 100644 --- a/testcases/kernel/containers/mqns/mqns.h +++ b/testcases/kernel/containers/mqns/mqns.h @@ -10,6 +10,8 @@ #define DEV_MQUEUE "/dev/mqueue" #define DEV_MQUEUE2 "/dev/mqueue2" #define SLASH_MQ1 "/MQ1" +#define NOSLASH_MQ1 "MQ1" #define SLASH_MQ2 "/MQ2" +#define NOSLASH_MQ2 "MQ2" #endif /* __MQNS_H */ diff --git a/testcases/kernel/containers/mqns/mqns_01.c b/testcases/kernel/containers/mqns/mqns_01.c index 7f41b2d..515ed51 100644 --- a/testcases/kernel/containers/mqns/mqns_01.c +++ b/testcases/kernel/containers/mqns/mqns_01.c @@ -55,7 +55,7 @@ int check_mqueue(void *vtest) if (read(p1[0], buf, strlen("go") + 1) < 0) tst_resm(TBROK | TERRNO, "read(p1[0], ...) failed"); - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDONLY); + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); if (mqd == -1) { if (write(p2[1], "notfnd", strlen("notfnd") + 1) < 0) tst_resm(TBROK | TERRNO, "write(p2[1], ...) failed"); @@ -86,7 +86,7 @@ main(int argc, char *argv[]) if (pipe(p1) == -1) { perror("pipe"); exit(EXIT_FAILURE); } if (pipe(p2) == -1) { perror("pipe"); exit(EXIT_FAILURE); } - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777, NULL); if (mqd == -1) { perror("mq_open"); @@ -100,7 +100,7 @@ main(int argc, char *argv[]) if (r < 0) { tst_resm(TFAIL, "failed clone/unshare\n"); mq_close(mqd); - syscall(__NR_mq_unlink, SLASH_MQ1); + syscall(__NR_mq_unlink, NOSLASH_MQ1); tst_exit(); } @@ -122,7 +122,7 @@ main(int argc, char *argv[]) /* destroy the mqueue */ mq_close(mqd); - syscall(__NR_mq_unlink, SLASH_MQ1); + syscall(__NR_mq_unlink, NOSLASH_MQ1); tst_exit(); } diff --git a/testcases/kernel/containers/mqns/mqns_02.c b/testcases/kernel/containers/mqns/mqns_02.c index aa78f65..07ab042 100644 --- a/testcases/kernel/containers/mqns/mqns_02.c +++ b/testcases/kernel/containers/mqns/mqns_02.c @@ -60,7 +60,7 @@ int check_mqueue(void *vtest) tst_resm(TBROK | TERRNO, "read(p1[0], ..) failed"); else { - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0777, NULL); if (mqd == -1) { if (write(p2[1], "mqfail", strlen("mqfail") + 1) < 0) { @@ -76,7 +76,7 @@ int check_mqueue(void *vtest) else { - if (read(p1[0], buf, 5)) + if (read(p1[0], buf, 5) < 0) tst_resm(TBROK | TERRNO, "read(p1[0], ..) failed"); else { @@ -86,9 +86,9 @@ int check_mqueue(void *vtest) tst_resm(TBROK | TERRNO, "mq_close(mqd) failed"); } else if (syscall(__NR_mq_unlink, - SLASH_MQ1) < 0) { + NOSLASH_MQ1) < 0) { tst_resm(TBROK | TERRNO, - "mq_unlink(" SLASH_MQ1 + "mq_unlink(" NOSLASH_MQ1 ") failed"); } else if (write(p2[1], "done", strlen("done") + 1) @@ -142,7 +142,7 @@ int main(int argc, char *argv[]) } if (read(p2[0], buf, 7) < 0) { - tst_resm(TBROK, "read(p1[0], ..) failed"); + tst_resm(TBROK, "read(p2[0], ..) failed"); } else if (!strcmp(buf, "mqfail")) { tst_resm(TFAIL, "child process could not create mqueue\n"); umount(DEV_MQUEUE); @@ -153,15 +153,15 @@ int main(int argc, char *argv[]) tst_exit(); } else { - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDONLY); + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDONLY); if (mqd == -1) { tst_resm(TPASS, "Parent process can't see the mqueue\n"); } else { tst_resm(TFAIL, "Parent process found mqueue\n"); mq_close(mqd); } - if (write(p1[1], "cont", 5)) { - tst_resm(TBROK, "read(p1[0], ..) failed"); + if (write(p1[1], "cont", 5) < 0) { + tst_resm(TBROK, "write(p1[1], ..) failed"); } } diff --git a/testcases/kernel/containers/mqns/mqns_03.c b/testcases/kernel/containers/mqns/mqns_03.c index 3c9e83e..83db75c 100644 --- a/testcases/kernel/containers/mqns/mqns_03.c +++ b/testcases/kernel/containers/mqns/mqns_03.c @@ -63,7 +63,7 @@ int check_mqueue(void *vtest) read(p1[0], buf, 3); /* go */ - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, NULL); if (mqd == -1) { write(p2[1], "mqfail", 7); diff --git a/testcases/kernel/containers/mqns/mqns_04.c b/testcases/kernel/containers/mqns/mqns_04.c index 8a4a9c2..98d4e39 100644 --- a/testcases/kernel/containers/mqns/mqns_04.c +++ b/testcases/kernel/containers/mqns/mqns_04.c @@ -59,7 +59,7 @@ int check_mqueue(void *vtest) read(p1[0], buf, 3); /* go */ - mqd = syscall(__NR_mq_open, SLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, + mqd = syscall(__NR_mq_open, NOSLASH_MQ1, O_RDWR|O_CREAT|O_EXCL, 0755, NULL); if (mqd == -1) { write(p2[1], "mqfail", 7); diff --git a/testcases/kernel/containers/pidns/pidns30.c b/testcases/kernel/containers/pidns/pidns30.c index ea8c54c..5975b53 100644 --- a/testcases/kernel/containers/pidns/pidns30.c +++ b/testcases/kernel/containers/pidns/pidns30.c @@ -59,7 +59,7 @@ char *TCID = "pidns30"; int TST_TOTAL = 1; -char *mqname = "/mq1"; +char *mqname = "mq1"; int result = TFAIL; int errno; diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c index e67e43c..485b465 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c @@ -127,8 +127,7 @@ main(int ac, char **av) /* Check number of hugepages */ if (get_no_of_hugepages() <= 0 || hugepages_size() <= 0) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to \ - sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); /* Perform global setup for test */ setup(); diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c index b30afef..229b929 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c @@ -105,7 +105,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c index 431c1e3..2f56127 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c @@ -102,7 +102,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c index f892799..a106976 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c @@ -86,7 +86,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c index baff476..e40123d 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c @@ -130,7 +130,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c index 928f76a..e434082 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c @@ -102,7 +102,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c index 7d039e6..5a7e02a 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c @@ -105,7 +105,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c index 7c0cec5..bb5480e 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c @@ -87,7 +87,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c index 10f29d3..6fa02ab 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c @@ -82,7 +82,7 @@ int main(int ac, char **av) /* The following loop checks looping state if -i option given */ if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c index 9066f45..80d3a2b 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c @@ -84,7 +84,7 @@ int main(int ac, char **av) { } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c index aa76097..fc78b45 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c @@ -85,7 +85,7 @@ int main(int ac, char **av) /* The following loop checks looping state if -i option given */ if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c index de9ab46..bc4bd2c 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c @@ -86,7 +86,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c index c6c34c0..7033a37 100644 --- a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c +++ b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c @@ -39,11 +39,11 @@ int TST_TOTAL=2; int errno; +int main(int argc, char *argv[]) +{ #if HAVE_SYS_CAPABILITY_H #if HAVE_DECL_PR_CAPBSET_READ && HAVE_DECL_PR_CAPBSET_DROP #ifdef HAVE_LIBCAP -int main(int argc, char *argv[]) -{ int ret = 1; cap_value_t v[1]; cap_flag_value_t f; diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c b/testcases/kernel/syscalls/eventfd/eventfd01.c index 05acc1b..83eb86e 100644 --- a/testcases/kernel/syscalls/eventfd/eventfd01.c +++ b/testcases/kernel/syscalls/eventfd/eventfd01.c @@ -729,7 +729,7 @@ static void setup(void) tst_sig(FORK, DEF_HANDLER, cleanup); if (tst_kvercmp(2, 6, 22) < 0) - tst_brkm(TCONF, cleanup, "2.6.22 or greater kernel required"); + tst_brkm(TCONF, tst_exit, "2.6.22 or greater kernel required"); /* Create a temporary directory & chdir there */ tst_tmpdir(); diff --git a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh index cc136f9..87514d8 100644 --- a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh +++ b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh @@ -437,7 +437,7 @@ echo "============================================================" echo -rm -rf $TEST_PROG +rm -rf "$TEST_DIR" uname -a date echo "Total tests: $test_num; passed: $passed_cnt; failed: $failed_cnt" diff --git a/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c b/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c index ef0f2c5..7ae8001 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c +++ b/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c @@ -9,6 +9,7 @@ /* test if aio.h exists and can be included */ #include <aio.h> +#include <stdlib.h> /* For NULL on non-linux platforms. */ int main(void) { diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c index 40c8cb3..ed1c519 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c +++ b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c @@ -1,5 +1,5 @@ /* - *Following symbles need to be defined in errno.h + *Following symbols need to be defined in errno.h *author:ys...@ln... */ diff --git a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c index 65300d7..0dd5ff8 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c +++ b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c @@ -11,6 +11,15 @@ #include <pthread.h> +/* + * XXX (garrcoop): the following #ifndef checks are invalid on many platforms; POSIX + * doesn't state whether or not these these can or cannot be either global variables + * or indices in enums (FreeBSD does the latter with + * PTHREAD_MUTEX_{ERRORCHECK,NORMAL.RECURSIVE} + * + * These tests need to be sorted out into proper functional tests. + */ + /* BAR */ #ifndef PTHREAD_BARRIER_SERIAL_THREAD #error PTHREAD_BARRIER_SERIAL_THREAD not defined diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c index 4b75c08..29db1ec 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c @@ -35,8 +35,8 @@ #include <fcntl.h> #include <string.h> #include <errno.h> +#include <signal.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c index a3a3c6c..9499df5 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c @@ -35,7 +35,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c index 65531cf..956e749 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c @@ -33,7 +33,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c index cc0b5e2..5e35427 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c @@ -36,7 +36,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c index 8db24ab..6b8f70c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c @@ -34,7 +34,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c index 4940091..0ba1abe 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c @@ -29,7 +29,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c index 7437e0a..e9e54f4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c @@ -19,9 +19,8 @@ * 4. Launch a thread which call sched_yield() and check that the counter has * changed since the call. */ -#define LINUX -#ifdef LINUX +#ifdef __linux__ #define _GNU_SOURCE #endif @@ -35,7 +34,8 @@ #include <sys/wait.h> #include "posixtest.h" -#ifdef BSD +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#define BSD # include <sys/types.h> # include <sys/param.h> # include <sys/sysctl.h> @@ -78,7 +78,7 @@ int get_ncpu() { return ncpu; } -#ifdef LINUX +#ifdef __linux__ int set_process_affinity(int cpu) { int retval = -1; @@ -131,7 +131,7 @@ int set_thread_affinity(int cpu) void * runner(void * arg) { int i=0, nc; long result = 0; -#ifdef LINUX +#ifdef __linux__ set_thread_affinity(*(int *)arg); fprintf(stderr, "%ld bind to cpu: %d\n", pthread_self(), *(int*)arg); #endif @@ -154,7 +154,7 @@ void * runner(void * arg) { } void * busy_thread(void *arg){ -#ifdef LINUX +#ifdef __linux__ set_thread_affinity(*(int *)arg); fprintf(stderr, "%ld bind to cpu: %d\n", pthread_self(), *(int*)arg); #endif @@ -170,7 +170,7 @@ void * busy_thread(void *arg){ void buzy_process(int cpu){ struct sched_param param; -#ifdef LINUX +#ifdef __linux__ /* Bind to a processor */ set_process_affinity(cpu); fprintf(stderr, "%d bind to cpu: %d\n", getpid(), cpu); hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-29 13:38:17
|
The branch, next, has been updated via a281aa71cbe8bf8ed9e75d8f3da85ab3bf44d021 (commit) from 4e08cd4291e660558504841323f0ac9869628327 (commit) - Log ----------------------------------------------------------------- commit a281aa71cbe8bf8ed9e75d8f3da85ab3bf44d021 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 19:05:59 2010 +0530 The child spawned by mqns04.c terminates by calling tst_exit(). tst_exit() basically calls exit(0). In the case where the child was spawned with fork+unshare that's fine, but in the case where it was spawned by clone() it is not: it causes the parent to see the exit status as 4, as in: posixmq_namespace_04 1 TFAIL : Child did not exit normally (status 4) This patch simply makes the child do _exit(0) on success, and that works fine. I wonder if there is some way we can generically do the right thing at txt_exit()? Note that other tests have the same problem: pid_namespace1 0 TWARN : child exited with signal 4 pid_namespace4 2 TFAIL : Container init pid got killed by signal 4 pidns20 1 TBROK : parent: cinit is terminated by 4 Should we just do this same "fix" in those testcases? Signed-off-by: Serge Hallyn <se...@us...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/containers/mqns/mqns_04.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/testcases/kernel/containers/mqns/mqns_04.c b/testcases/kernel/containers/mqns/mqns_04.c index 8a4a9c2..f6e3f51 100644 --- a/testcases/kernel/containers/mqns/mqns_04.c +++ b/testcases/kernel/containers/mqns/mqns_04.c @@ -78,6 +78,7 @@ int check_mqueue(void *vtest) write(p2[1], "go", 3); read(p1[0], buf, 3); + _exit(0); tst_exit(); } hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-29 13:10:38
|
The branch, next, has been updated via 4e08cd4291e660558504841323f0ac9869628327 (commit) via 049cbb9bee94cacc8b90b607cc5438a250224dd2 (commit) via 0fe72e731426061a4923ecfd9aa77879607f41a0 (commit) via acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 (commit) via c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef (commit) via d9f3d25b9db35073c7104b759d526869d9867692 (commit) via 23e7806fec4c6be42fdf577559df5498cce45118 (commit) via 5162b710bfc574107d915093c08b198f0a15727e (commit) via d0605c4e9525bd5ecdd0ba28ba27b8b237d1cfc8 (commit) via 1c9ec5ec1389062a4a091fee7295b36a6583df5d (commit) via 4837fee8a7c2de6a83c8927a574c792ca6dabe4e (commit) via f1922fb747b6df0bacd90c72daa748ff879b1fd8 (commit) via 44fba94453ca4f446cde4db08b0a760862b55cfa (commit) via aca4428b38701e46e0da38fd7583028216c32c66 (commit) via d2a9b9d3e04807fb4744dc7e778fe6e0c9543bc1 (commit) via bc7b5a1c1269f6626defed23b027dc3ec497a0c9 (commit) via 26fa8bb10113a92ca80a0e52fb4eded103fab565 (commit) from adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 (commit) - Log ----------------------------------------------------------------- commit 4e08cd4291e660558504841323f0ac9869628327 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 18:37:18 2010 +0530 I've been playing with patch from Jiri that attempts to fix ftest03 and ftest07 segfault and find out that it was correct however was done against some older ltp version. Attached patch is rebased against current git repository as well as tested to fix this issue on SLES11. Some background: The only poissonned line in ftest03.c, respective ftest07.c is: sprintf(fuss, "%s/ftest03.%d", getcwd(wdbuf, sizeof( wdbuf)), getpid()); Where we are trying to fill path to the current working directory into fuss that is declared as 'char fuss[40];'. However it's better to remove all code to creates temporary directory from these tests as this is allready done by tst_tmpdir(). There is still a lot of duplicated/broken code in these tests but for simplicity I will address them in separate patches (so that it's easier to review them). Signed-off-by: Cyril Hrubis ch...@su... commit 049cbb9bee94cacc8b90b607cc5438a250224dd2 Merge: 0fe72e731426061a4923ecfd9aa77879607f41a0 f1922fb747b6df0bacd90c72daa748ff879b1fd8 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 14:50:36 2010 +0530 Merge branch 'maint' into next commit 0fe72e731426061a4923ecfd9aa77879607f41a0 Merge: acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 1c9ec5ec1389062a4a091fee7295b36a6583df5d Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 14:50:30 2010 +0530 Merge branch 'pu' into next commit acaf3cd41451b41f7bdc51cdf06e017f2eaf4a45 Merge: adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 29 14:48:45 2010 +0530 Merge branch 'master' into next ----------------------------------------------------------------------- Summary of changes: doc/MaintNotes | 107 +++++++++++++++++++++++ runltp | 2 +- testcases/kernel/fs/ftest/ftest01.c | 42 +-------- testcases/kernel/fs/ftest/ftest03.c | 62 +++----------- testcases/kernel/fs/ftest/ftest05.c | 45 +--------- testcases/kernel/fs/ftest/ftest07.c | 64 +++----------- testcases/kernel/syscalls/ipc/msgctl/msgctl10.c | 8 +-- testcases/kernel/syscalls/linkat/linkat01.c | 2 +- testcases/realtime/func/prio-wake/prio-wake.c | 11 +-- testscripts/test_fs_bind.sh | 2 +- 10 files changed, 149 insertions(+), 196 deletions(-) create mode 100644 doc/MaintNotes diff --git a/doc/MaintNotes b/doc/MaintNotes new file mode 100644 index 0000000..d89eba6 --- /dev/null +++ b/doc/MaintNotes @@ -0,0 +1,107 @@ +Welcome to ltp community. + +We are in process of changing our sf.net host repository to +GIT from CVS.[ Any input/discussion on this is highly appreciable ]. If +possible this month end release may get delayed based on responses from +list or next month end (i.e: March ) release will be based on git tree. + +I usually try to read all patches posted to ltp mailing list, and follow +almost all discussions on list, unless the topic is about an obscure +corner that i do not personally use. But i am obviously not perfect.If +you sent a patch that you did not hear from anybody for three days, +that is a very good indication that it was dropped on the floor --- please +do not hesitate to remind me. + +The list archive is available at: + +http://marc.info/?l=ltp-list&r=1&w=2 + + +Please use this public site to point out messages in mailing list if you +want to remind someone or again start same thread without altering +subject line. + +Now coming to git transformation this month, you can find gitweb +interface at : + +http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp-dev.git;a=summary + +There are four branches in ltp-dev.git repository that track the source tree +of ltp: "master", "maint", "next", "pu". I may add more maintanance +branch if we have huge backward of incompatible feature updates in the +future to keep an older release alive. + +The master branch is meant to contain what are very well tested and +ready to be used in production environment. There could occassionaly be +minor breakage but they are not expected to be anything major, and more +importantly those will be quickly and trivially fixable. + +So if some hotfixes has gone with this branch, you can find one more +digit has been added to version release (e.g: YYYYMMDD.1 ), So it means +it is more stable than YYYYMMDD release. I may be changing this format +if i can see a better format or if you have some suggestion then it is +most welcome. + +The "maint" branch is called one step before master branch, which will +contain all features or patches that are going to following month end +release. +(e.g: If this month end ltp-full-YYYYMMDD is going be to released +then all the stable patches you can find in this branch through out the +month, and one important point for this branch is all the patches which +has gone to this branch will be well tested and make sure that there is +no regression or breakage and Acked/Reviewed by Someone from mailing +list.) + +"next" branch will contain all the patches which has been sent on +ltp-mailing list after getting "Acked-By" and/or "Reviewed-By" anyone +from list. This branch is quite unstable but user can find their +immediate patches over here to see the stability.You can find most +unstable about this branch w.r.t feature wise or may be sometime build wise. + + +NOTE: +===== +So i always encourage testcase developer/ltp-list member to send me the +patches against this branch. And it will be closely reviewed and +acknowledged by any member from ltp-list community members. Once it gets +Acked/Reveiwed-By then it will promoted to maint branch for maintainer +testing and checking for stability, otherwise it will go to "pu" branch +for further discussion and decision. These pending patch can be worked +on following month and once it is mature enough to meet the stability +then it can be directly jump to maint branch, here i may ask the +submitter to submit the patch once again against maint branch. + +"pu" branch is basically "proposed update" branch which will contain all +the remainder of above branches. By the above definition of how "next" +works, you can tell that this branch will contain quite experimental and +obviosuly broken stuff. + +I would like to thanks everybody who helped me to release ltp-dev git into +current shape. Especially i would like to thank following: + - git.git from where actually i picked up this branch + identification. + - Garret, who has worked with me step by step to release this git + tree implementation to ltp-list@. + - All my team member from IBM who basically gave encourageable + input and specially Aneesh, Subrata, Iranna & kamalesh. + - And finally to Linux kernel, who motivated me to maintain such a + testsuits with git. + + +Usage: + +#git clone git://ltp.git.sourceforge.net/gitroot/ltp/ltp-dev.git ltp-dev +(Make sure you have the latest autoconf/automake before running make +autotools ) +#make autotools +#./configure +#make +#make install +#cd /opt/ltp +#./runltp + +Please do not hesitate to reply this mail if you have any query in your +mind, it may help me to generate a good FAQ :) . + +Happy Testing!!! + diff --git a/runltp b/runltp index b848a7f..36986af 100755 --- a/runltp +++ b/runltp @@ -846,7 +846,7 @@ main() export TEST_OUTPUT_DIRECTORY="$LTPROOT/output" export TEST_LOGS_DIRECTORY=$LOGS_DIRECTORY echo "Generating HTML Output.....!!" - ( perl $LTPROOT/tools/genhtml.pl $LTPROOT/tools/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY > $HTMLFILE; ) + ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/tools/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY > $HTMLFILE; ) echo "Generated HTML Output.....!!" echo "Location: $HTMLFILE"; diff --git a/testcases/kernel/fs/ftest/ftest01.c b/testcases/kernel/fs/ftest/ftest01.c index c4dc5c8..4fc2fb4 100644 --- a/testcases/kernel/fs/ftest/ftest01.c +++ b/testcases/kernel/fs/ftest/ftest01.c @@ -90,9 +90,6 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; int main(int ac, char *av[]) @@ -130,18 +127,8 @@ static void setup(void) * Save starting directory. */ tst_tmpdir(); - getcwd(homedir, sizeof(homedir)); parent_pid = getpid(); - if (!fuss[0]) - sprintf(fuss, "./ftest1.%d", getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_brkm(TBROK,0,"Can't chdir(%s): %s", fuss, strerror(errno)); - } - /* * Default values for run conditions. */ @@ -162,16 +149,16 @@ static void setup(void) static void runtest(void) { - int i, pid, child, status, count; + int i, child, status, count; - for(i = 0; i < nchild; i++) { + for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); if (fd < 0) - tst_brkm(TBROK,0, "Can't creating %s/%s: %s", fuss, test_name, strerror(errno)); + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -221,29 +208,6 @@ static void runtest(void) else tst_resm(TFAIL, "Test failed in fork and wait."); - chdir(homedir); - pid = fork(); - - if (pid < 0) { - - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - - tst_resm(TBROK, "Can not remove '%s' due to inability of fork.",fuss); - sync(); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - tst_exit(); - } - - wait(&status); - - if (status) - tst_resm(TINFO, "CAUTION - ftest1, '%s' may not be removed", fuss); - sync(); } diff --git a/testcases/kernel/fs/ftest/ftest03.c b/testcases/kernel/fs/ftest/ftest03.c index 1cb6d6f..95ad60b 100644 --- a/testcases/kernel/fs/ftest/ftest03.c +++ b/testcases/kernel/fs/ftest/ftest03.c @@ -96,12 +96,9 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; /* childs test directory name */ -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; -int main (int ac, char *av[]) +int main(int ac, char *av[]) { int lc; char *msg; @@ -136,33 +133,22 @@ int main (int ac, char *av[]) return 0; } -static void setup(void) +static void cleanup(void) { - char wdbuf[MAXPATHLEN]; + tst_rmdir(); + tst_exit(); +} +static void setup(void) +{ /* * Make a directory to do this in; ignore error if already exists. * Save starting directory. */ tst_tmpdir(); - if (getcwd(homedir, sizeof(homedir)) == NULL) { - tst_resm(TBROK, "getcwd() failed"); - tst_exit(); - } - parent_pid = getpid(); - if (!fuss[0]) - sprintf(fuss, "%s/ftest03.%d", getcwd(wdbuf, sizeof( wdbuf)), getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_resm(TBROK,"\tCan't chdir(%s), error %d.", fuss, errno); - tst_exit() ; - } - /* * Default values for run conditions. */ @@ -181,19 +167,17 @@ static void setup(void) static void runtest(void) { - int i, pid, child, status, count; + int i, child, status, count; - for(i = 0; i < nchild; i++) { + for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); - if (fd < 0) { - tst_resm(TBROK, "\tError %d creating %s/%s.", errno, fuss, test_name); - tst_exit(); - } + if (fd < 0) + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -241,30 +225,6 @@ static void runtest(void) local_flag = FAILED; } - chdir(homedir); - - pid = fork(); - - if (pid < 0) { - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - tst_resm(TBROK, "Test broken due to inability of fork."); - sync(); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - tst_exit(); - } else - wait(&status); - - if (status) { - tst_resm(TINFO, "CAUTION - ftest03, '%s' may not be removed", fuss); - tst_resm(TINFO, "CAUTION - ftest03, '%s' may not be removed", - fuss); - } - sync(); } diff --git a/testcases/kernel/fs/ftest/ftest05.c b/testcases/kernel/fs/ftest/ftest05.c index 220d9fd..cf7779a 100644 --- a/testcases/kernel/fs/ftest/ftest05.c +++ b/testcases/kernel/fs/ftest/ftest05.c @@ -94,9 +94,6 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; /* childs test directory name */ -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; int main(int ac, char *av[]) @@ -135,19 +132,9 @@ static void setup(void) * Save starting directory. */ tst_tmpdir(); - getcwd(homedir, sizeof (homedir)); + parent_pid = getpid(); - if (!fuss[0]) - sprintf(fuss, "./ftest05.%d", getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_resm(TBROK,"\tCan't chdir(%s), error %d.", fuss, errno); - tst_exit(); - } - /* * Default values for run conditions. */ @@ -167,17 +154,15 @@ static void setup(void) static void runtest(void) { - int i, pid, child, status, count; + int i, child, status, count; for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); - if (fd < 0) { - tst_resm(TBROK, "\tError %d creating %s/%s.", errno, fuss, test_name); - tst_exit(); - } + if (fd < 0) + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -221,28 +206,6 @@ static void runtest(void) local_flag = FAILED; } - chdir(homedir); - pid = fork(); - - if (pid < 0) { - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - tst_resm(TBROK, "Test broken due to inability of fork."); - sync(); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - tst_exit(); - } - - wait(&status); - - if (status) { - tst_resm(TINFO,"CAUTION - ftest05, '%s' may not be removed", fuss); - } - sync(); } diff --git a/testcases/kernel/fs/ftest/ftest07.c b/testcases/kernel/fs/ftest/ftest07.c index 8cda511..7429874 100644 --- a/testcases/kernel/fs/ftest/ftest07.c +++ b/testcases/kernel/fs/ftest/ftest07.c @@ -86,6 +86,7 @@ int TST_TOTAL = 1; #define MAXIOVCNT 16 static void setup(void); +static void cleanup(void); static void runtest(void); static void dotest(int, int, int); static void domisc(int, int, char*); @@ -102,9 +103,6 @@ static int parent_pid; static int pidlist[MAXCHILD]; static char test_name[2]; /* childs test directory name */ -static char fuss[40]; /* directory to do this in */ -static char homedir[200]; /* where we started */ - static int local_flag; int main(int ac, char *av[]) @@ -141,60 +139,45 @@ int main(int ac, char *av[]) return 0; } -static void setup(void) +static void cleanup(void) { - char wdbuf[MAXPATHLEN], *cwd; + tst_rmdir(); + tst_exit(); +} +static void setup(void) +{ /* * Make a directory to do this in; ignore error if already exists. * Save starting directory. */ - if ((cwd = getcwd(homedir, sizeof (homedir))) == NULL ) { - tst_resm(TBROK,"Failed to get corrent directory") ; - tst_exit(); - } - parent_pid = getpid(); tst_tmpdir(); - if (!fuss[0]) - sprintf(fuss, "%s/ftest07.%d", getcwd(wdbuf, sizeof( wdbuf)), getpid()); - - mkdir(fuss, 0755); - - if (chdir(fuss) < 0) { - tst_resm(TBROK,"\tCan't chdir(%s), error %d.", fuss, errno); - tst_exit() ; - } - + /* * Default values for run conditions. */ - iterations = 10; nchild = 5; csize = K_2; /* should run with 1, 2, and 4 K sizes */ max_size = K_1 * K_1; misc_intvl = 10; - if (sigset(SIGTERM, term) == SIG_ERR) { - tst_resm(TBROK, " sigset failed: signo = 15") ; - tst_exit() ; - } - + if (sigset(SIGTERM, term) == SIG_ERR) + tst_brkm(TBROK, cleanup, "Sigset failed: signo = 15"); } static void runtest(void) { - int pid, child, status, count, i; + int child, status, count, i; for (i = 0; i < nchild; i++) { test_name[0] = 'a' + i; test_name[1] = '\0'; fd = open(test_name, O_RDWR|O_CREAT|O_TRUNC, 0666); - if (fd < 0) { - tst_resm(TBROK, "\tError %d creating %s/%s.", errno, fuss, test_name); - tst_exit(); - } + + if (fd < 0) + tst_brkm(TBROK | TERRNO, cleanup, "Can't create %s.", test_name); if ((child = fork()) == 0) { dotest(nchild, i, fd); @@ -241,25 +224,6 @@ static void runtest(void) local_flag = FAILED; } - chdir(homedir); - - pid = fork(); - if (pid < 0) { - tst_resm(TINFO, "System resource may be too low, fork() malloc()" - " etc are likely to fail."); - tst_resm(TBROK, "Test broken due to inability of fork."); - tst_exit(); - } - - if (pid == 0) { - execl("/bin/rm", "rm", "-rf", fuss, NULL); - exit(1); - } else - wait(&status); - if (status) { - tst_resm(TINFO, "CAUTION - ftest07, '%s' may not be removed", fuss); - } - sync(); } diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c index 90c9c99..bff67ed 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c @@ -65,12 +65,8 @@ extern int Tst_count; /* Test Case counter for tst_* routines */ int exp_enos[] = { 0 }; /* List must end with 0 */ -#ifndef CONFIG_COLDFIRE -#define MAXNPROCS 1000000 /* This value is set to an arbitrary high limit. */ -#else -#define MAXNPROCS 100000 /* Coldfire can't deal with 1000000 */ -#endif -#define MAXNREPS 100000 +#define MAXNPROCS 10000 /*These should be sufficient*/ +#define MAXNREPS 10000 /*Else they srewup the system un-necessarily*/ #define FAIL 1 #define PASS 0 diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c index 63b9367..dbda820 100644 --- a/testcases/kernel/syscalls/linkat/linkat01.c +++ b/testcases/kernel/syscalls/linkat/linkat01.c @@ -158,7 +158,7 @@ struct test_struct { { &cwd_fd, "/proc/cpuinfo", &newdirfd, TEST_FILE1, 0, 0, 0, EXDEV }, /* 21. directory link */ - { &cwd_fd, "/tmp", &newdirfd, TEST_FILE1, 0, + { &olddirfd, ".", &newdirfd, TEST_FILE1, 0, 0, 0, EPERM }, /* 22. invalid flag */ { &olddirfd, TEST_FILE1, &newdirfd, TEST_FILE1, 1, diff --git a/testcases/realtime/func/prio-wake/prio-wake.c b/testcases/realtime/func/prio-wake/prio-wake.c index 74007f6..1703451 100644 --- a/testcases/realtime/func/prio-wake/prio-wake.c +++ b/testcases/realtime/func/prio-wake/prio-wake.c @@ -108,7 +108,11 @@ void *master_thread(void* arg) /* make sure children are started */ while (running_threads < rt_threads) - sleep(1); + usleep(1000); + /* give the worker threads a chance to get to sleep in the kernel + * in the unlocked broadcast case. */ + usleep(1000); + start = rt_gettime() - beginrun; @@ -120,8 +124,6 @@ void *master_thread(void* arg) if (locked_broadcast) rc = pthread_mutex_unlock(&mutex); - while (running_threads > 0) - sleep(1); return NULL; } @@ -157,9 +159,6 @@ void *worker_thread(void* arg) rc = pthread_mutex_unlock(&mutex); - /* wait for all threads to quit */ - while (running_threads > 0) - sleep(1); return NULL; } diff --git a/testscripts/test_fs_bind.sh b/testscripts/test_fs_bind.sh index 39a237e..9ab533a 100755 --- a/testscripts/test_fs_bind.sh +++ b/testscripts/test_fs_bind.sh @@ -238,7 +238,7 @@ restore_proc_mounts() # new mounts around and will never remove mounts outside the test # directory ( while grep_proc_mounts ; do - grep_proc_mounts | awk '{print $2}' | xargs -r --max-args=1 umount -l + grep_proc_mounts | awk '{print $2}' | xargs -r -n 1 umount -l done ) >& /dev/null # mount list and exit with 0 hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-28 06:11:29
|
The branch, master, has been updated via c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef (commit) from d9f3d25b9db35073c7104b759d526869d9867692 (commit) - Log ----------------------------------------------------------------- commit c2ce5363adf4a3f8482d7c4476a9beeaf7bc8aef Author: Rishikesh K Rajak <ris...@li...> Date: Wed Apr 28 11:39:03 2010 +0530 Generating HTML Output.....!! Can't open perl script "/opt/ltp/tools/genhtml.pl": No such file or directory Following patch fixes the same. Signed-off-by: Subrata Modak <su...@li...> Acked-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: runltp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/runltp b/runltp index b848a7f..36986af 100755 --- a/runltp +++ b/runltp @@ -846,7 +846,7 @@ main() export TEST_OUTPUT_DIRECTORY="$LTPROOT/output" export TEST_LOGS_DIRECTORY=$LOGS_DIRECTORY echo "Generating HTML Output.....!!" - ( perl $LTPROOT/tools/genhtml.pl $LTPROOT/tools/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY > $HTMLFILE; ) + ( perl $LTPROOT/bin/genhtml.pl $LTPROOT/tools/html_report_header.txt test_start test_end test_output execution_status $OUTPUT_DIRECTORY > $HTMLFILE; ) echo "Generated HTML Output.....!!" echo "Location: $HTMLFILE"; hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-26 07:51:04
|
The branch, master, has been updated via d9f3d25b9db35073c7104b759d526869d9867692 (commit) from 23e7806fec4c6be42fdf577559df5498cce45118 (commit) - Log ----------------------------------------------------------------- commit d9f3d25b9db35073c7104b759d526869d9867692 Author: Rishikesh K Rajak <ris...@li...> Date: Mon Apr 26 13:19:40 2010 +0530 The test_fs_bind testscript hangs indefinitely when run on a machine where busybox applets are used. The test hangs while trying to restore the mounts after a test run. This happens because the "xargs" applet from busybox doesn't understand the --max-args=1 option. Thus, the mounts from the test are not removed and this goes on in a loop, indefinitely. This could be avoided by using "-n" option which is supported by both the implementations of xargs. Signed-off-by: Suzuki K P <su...@in...> ----------------------------------------------------------------------- Summary of changes: testscripts/test_fs_bind.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testscripts/test_fs_bind.sh b/testscripts/test_fs_bind.sh index 39a237e..9ab533a 100755 --- a/testscripts/test_fs_bind.sh +++ b/testscripts/test_fs_bind.sh @@ -238,7 +238,7 @@ restore_proc_mounts() # new mounts around and will never remove mounts outside the test # directory ( while grep_proc_mounts ; do - grep_proc_mounts | awk '{print $2}' | xargs -r --max-args=1 umount -l + grep_proc_mounts | awk '{print $2}' | xargs -r -n 1 umount -l done ) >& /dev/null # mount list and exit with 0 hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-23 07:07:13
|
The branch, master, has been updated via 23e7806fec4c6be42fdf577559df5498cce45118 (commit) from 5162b710bfc574107d915093c08b198f0a15727e (commit) - Log ----------------------------------------------------------------- commit 23e7806fec4c6be42fdf577559df5498cce45118 Author: Rishikesh K Rajak <ris...@li...> Date: Fri Apr 23 12:35:10 2010 +0530 Running the ltp suite on ChromeOS (x86 with a 2.6.32 kernel) fails linkat01 testcase 21: linkat01 21 TFAIL : linkat() failed: TEST_ERRNO=EXDEV(18): Invalid cross-device link This is probably because my /tmp is mounted from someplace other than the filesystem that contains newdirfd. The goal of testcase 21 is to demonstrate that linking a directory will fail EPERM. The fix is to use olddir/. instead of /tmp. Tested-by: Henry Yei <hy...@mv...> Signed-off-by: Bryan Freed <bf...@go...> Signed-off-by: Rishikesh K Rajak <ris...@li...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/linkat/linkat01.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/syscalls/linkat/linkat01.c b/testcases/kernel/syscalls/linkat/linkat01.c index 63b9367..dbda820 100644 --- a/testcases/kernel/syscalls/linkat/linkat01.c +++ b/testcases/kernel/syscalls/linkat/linkat01.c @@ -158,7 +158,7 @@ struct test_struct { { &cwd_fd, "/proc/cpuinfo", &newdirfd, TEST_FILE1, 0, 0, 0, EXDEV }, /* 21. directory link */ - { &cwd_fd, "/tmp", &newdirfd, TEST_FILE1, 0, + { &olddirfd, ".", &newdirfd, TEST_FILE1, 0, 0, 0, EPERM }, /* 22. invalid flag */ { &olddirfd, TEST_FILE1, &newdirfd, TEST_FILE1, 1, hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-22 06:07:44
|
The branch, master, has been updated via 5162b710bfc574107d915093c08b198f0a15727e (commit) from d0605c4e9525bd5ecdd0ba28ba27b8b237d1cfc8 (commit) - Log ----------------------------------------------------------------- commit 5162b710bfc574107d915093c08b198f0a15727e Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 22 11:36:48 2010 +0530 prio-wake: avoid glibc to kernel sleep race In the unlocked broadcast scenario, there exists a race between when the running_threads variable reaches rt_threads and when the last worker_thread blocks in the kernel after a cond_wait(). It is possible for a thread to miss the broadcast if it fails to sleep before the broadcast is issued. The previous code did not guarantee a small window of time to allow the threads to get to sleep. It also used an unreasonably large sleep time which unnecessarily extended the length of the test run time. This patch ensures some time is given to the threads to get to sleep and at the same time uses a much shorter (1000x) sleep period which results in a 50-100x reduction in test run time. Lastly, two unecessary loops waiting for the threads to complete were removed, relying on pthread_join() instead to wait for the threads to complete. Signed-off-by: Darren Hart <dv...@us...> Acked-by: Will Schmidt <wil...@vn...> ----------------------------------------------------------------------- Summary of changes: testcases/realtime/func/prio-wake/prio-wake.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/testcases/realtime/func/prio-wake/prio-wake.c b/testcases/realtime/func/prio-wake/prio-wake.c index 74007f6..1703451 100644 --- a/testcases/realtime/func/prio-wake/prio-wake.c +++ b/testcases/realtime/func/prio-wake/prio-wake.c @@ -108,7 +108,11 @@ void *master_thread(void* arg) /* make sure children are started */ while (running_threads < rt_threads) - sleep(1); + usleep(1000); + /* give the worker threads a chance to get to sleep in the kernel + * in the unlocked broadcast case. */ + usleep(1000); + start = rt_gettime() - beginrun; @@ -120,8 +124,6 @@ void *master_thread(void* arg) if (locked_broadcast) rc = pthread_mutex_unlock(&mutex); - while (running_threads > 0) - sleep(1); return NULL; } @@ -157,9 +159,6 @@ void *worker_thread(void* arg) rc = pthread_mutex_unlock(&mutex); - /* wait for all threads to quit */ - while (running_threads > 0) - sleep(1); return NULL; } hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-20 11:46:46
|
The branch, master, has been updated via d0605c4e9525bd5ecdd0ba28ba27b8b237d1cfc8 (commit) from 4837fee8a7c2de6a83c8927a574c792ca6dabe4e (commit) - Log ----------------------------------------------------------------- commit d0605c4e9525bd5ecdd0ba28ba27b8b237d1cfc8 Author: Rishikesh K Rajak <ris...@li...> Date: Tue Apr 20 17:15:13 2010 +0530 msgctl10() un-necessarily eats up all the PIDs of the system leading to system becoming un-responsive. The changed no.s would better do the job. Signed-off-by: Subrata Modak<su...@li...> Acked/Tested-By: Caspar ZHANG <cz...@re...> Signed-off-by: Rishikesh K Rajak <ris...@li...> ----------------------------------------------------------------------- Summary of changes: testcases/kernel/syscalls/ipc/msgctl/msgctl10.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c index 90c9c99..bff67ed 100644 --- a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c +++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c @@ -65,12 +65,8 @@ extern int Tst_count; /* Test Case counter for tst_* routines */ int exp_enos[] = { 0 }; /* List must end with 0 */ -#ifndef CONFIG_COLDFIRE -#define MAXNPROCS 1000000 /* This value is set to an arbitrary high limit. */ -#else -#define MAXNPROCS 100000 /* Coldfire can't deal with 1000000 */ -#endif -#define MAXNREPS 100000 +#define MAXNPROCS 10000 /*These should be sufficient*/ +#define MAXNREPS 10000 /*Else they srewup the system un-necessarily*/ #define FAIL 1 #define PASS 0 hooks/post-receive -- ltp |
From: Garrett C. <ris...@li...> - 2010-04-16 05:15:34
|
The branch, pu, has been updated via 303a69af83bd2dd9bf358e50a11ef6b5b78e5041 (commit) via b4bd3c001ec8d74bb5c85754b8c94f8f0b2770b8 (commit) from 1c9ec5ec1389062a4a091fee7295b36a6583df5d (commit) - Log ----------------------------------------------------------------- commit 303a69af83bd2dd9bf358e50a11ef6b5b78e5041 Merge: b4bd3c001ec8d74bb5c85754b8c94f8f0b2770b8 1c9ec5ec1389062a4a091fee7295b36a6583df5d Author: Garrett Cooper <yan...@gm...> Date: Thu Apr 15 22:13:27 2010 -0700 Merge branch 'pu' of ssh://ltp.git.sourceforge.net/gitroot/ltp/ltp-dev into pu commit b4bd3c001ec8d74bb5c85754b8c94f8f0b2770b8 Author: Garrett Cooper <yan...@gm...> Date: Thu Apr 15 22:12:00 2010 -0700 Fix inconsistent hugepages after setup call. If the system doesn't have hugepages support, then setup has no business being run. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c index 6fa02ab..87e33ee 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c @@ -78,14 +78,14 @@ int main(int ac, char **av) tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg); } - setup(); /* global setup */ - /* The following loop checks looping state if -i option given */ if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; - + + setup(); /* global setup */ + for (lc = 0; TEST_LOOPING(lc); lc++) { /* reset Tst_count in case we are looping */ Tst_count = 0; hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-16 03:19:19
|
The branch, next, has been updated via adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 (commit) from 4eca2b5b7d3f4dfb1fd661eab2931d3564a4a85f (commit) - Log ----------------------------------------------------------------- commit adf53e68cf2b513b67a19dc0ff8869b53f9f22a3 Author: Rishikesh K Rajak <ris...@li...> Date: Fri Apr 16 08:44:17 2010 +0530 Script utimensat_tests.sh deletes the test it is executing instead of deleting temporary directory. Patch attached. Signed-off-by: Cyril Hrubis <ch...@su...> ----------------------------------------------------------------------- Summary of changes: .../kernel/syscalls/utimensat/utimensat_tests.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh index cc136f9..87514d8 100644 --- a/testcases/kernel/syscalls/utimensat/utimensat_tests.sh +++ b/testcases/kernel/syscalls/utimensat/utimensat_tests.sh @@ -437,7 +437,7 @@ echo "============================================================" echo -rm -rf $TEST_PROG +rm -rf "$TEST_DIR" uname -a date echo "Total tests: $test_num; passed: $passed_cnt; failed: $failed_cnt" hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-15 09:28:55
|
The branch, pu, has been updated via 1c9ec5ec1389062a4a091fee7295b36a6583df5d (commit) via 4eca2b5b7d3f4dfb1fd661eab2931d3564a4a85f (commit) via 6fc71a4987f658ac48b476defb8cc341cb7361c3 (commit) via c150e9b196b1267beeefdaec4dde9933503448f3 (commit) via eaf73222df286c200475aadac78122b182b5f388 (commit) via cc7c7035a60b40f9a417b5e437ca6ea43ebfd783 (commit) via 2a276cf8bb5b94259482ec039edc2ae7fbaf953e (commit) via a9d5600c78943e9e7e1b52c5ec81e9772a47b44f (commit) via aabf191024aacc91784593b0d3f8d5fa37434b25 (commit) from 1ff0128460531d9f9c46353eba65dd79ca27bbc8 (commit) - Log ----------------------------------------------------------------- commit 1c9ec5ec1389062a4a091fee7295b36a6583df5d Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 14:56:14 2010 +0530 Merge branches 'next' and 'pu' into pu ----------------------------------------------------------------------- Summary of changes: result | 96 ++++++++++++++++++++ testcases/commands/ade/ar/ar01 | 12 ++-- testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c | 3 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat02.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat03.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c | 2 +- .../kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget02.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget03.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget05.c | 2 +- .../security/cap_bound/cap_bset_inh_bounds.c | 4 +- testcases/kernel/syscalls/eventfd/eventfd01.c | 2 +- 16 files changed, 117 insertions(+), 22 deletions(-) create mode 100644 result diff --git a/result b/result new file mode 100644 index 0000000..78db428 --- /dev/null +++ b/result @@ -0,0 +1,96 @@ +This file contains for corresponding monthly release results. it will alwats help to refer this file and come to know about known failures. + + +ltp-full-20100331 Result pon various Arch: + +On x86_64 machine with RHEL5.4(2.6.18-164.el5): +***************************************************** + +Result Log file: +=============== +eventfd01 FAIL 4 +syslog07 FAIL 1 +syslog08 FAIL 1 +mtest06 FAIL 255 +su01 FAIL 1 +hugemmap04 FAIL 2 +hugeshmat01 FAIL 6 +hugeshmat02 FAIL 6 +hugeshmat03 FAIL 2 +hugeshmctl01 FAIL 6 +hugeshmctl02 FAIL 6 +hugeshmctl03 FAIL 2 +hugeshmdt01 FAIL 6 +hugeshmget01 FAIL 2 +hugeshmget02 FAIL 6 +hugeshmget03 FAIL 6 +hugeshmget05 FAIL 2 +mail FAIL 2 + + +Result Output file: +================== +syslog07 1 TFAIL : Higher level messages are not logged. +check_netns_enabled 1 TFAIL : unshare syscall smoke test failed: errno=EINVAL(22): Invalid argument +mail_tests::mail02 2 TFAIL : Test #2: Mailer-Deamon failed to report delivery failure. Reason: +mail_tests::mail05 5 TFAIL : Test #5: mail failed to carbon copy user mail_test. Reason: + + +On ppc64 machine with RHEL5.4(2.6.18-164.el5): +***************************************************** + +Result Log file: +=============== +cct01 FAIL 1 +eventfd01 FAIL 4 +fdatasync02 FAIL 1 +syslog07 FAIL 1 +syslog08 FAIL 1 +mtest06 FAIL 255 +mmapstress03 FAIL 1 +su01 FAIL 1 +cron_deny01 FAIL 1 + + +Result Output file: +================== +acct01 1 TFAIL : attempting to assign acct file to device: expected failure but got okay return +fdatasync02 2 TFAIL : Unexpected results for file descriptor to a special file ; returned 0 (expected -1), errno 0 (expected 22) +syslog07 1 TFAIL : Higher level messages are not logged. +mmapstress03 1 TFAIL : Test failed +check_netns_enabled 1 TFAIL : unshare syscall smoke test failed: errno=EINVAL(22): Invalid argument + + + +On s390x machine with RHEL5.4(2.6.18-164.el5): +***************************************************** + +Result Log file: +=============== +eventfd01 FAIL 4 +keyctl01 FAIL 1 +rt_sigsuspend01 FAIL 11 +timer_getoverrun01 FAIL 1 +timer_gettime01 FAIL 1 +su01 FAIL 1 +cron_allow01 FAIL 1 + + + +Result Output file: +================== +keyctl01 2 TFAIL : KEYCTL_REVOKE got unexpected errno: errno=EINVAL(22): Invalid argument +timer_getoverrun01 1 TFAIL : Block 1: test 0 FAILED... errno = 22 : Invalid argument +timer_gettime01 1 TFAIL : Block 1: test 0 FAILED... errno = 22 : Invalid argument +check_netns_enabled 1 TFAIL : unshare syscall smoke test failed: errno=EINVAL(22): Invalid argument + + + +On x86_64 machine with SLES11GA(2.6.27.19-5-default): +***************************************************** + +Result Log file: +=============== +eventfd2_03 FAIL 1 +utimensat01 FAIL 1 +ftest04 FAIL 1 diff --git a/testcases/commands/ade/ar/ar01 b/testcases/commands/ade/ar/ar01 index c90faf9..55363dc 100755 --- a/testcases/commands/ade/ar/ar01 +++ b/testcases/commands/ade/ar/ar01 @@ -519,19 +519,19 @@ echo "-)19 SKIPPED due to binutils ar automatically adds a symbol." rm -rf $TCtmp/lib.a;cd $TCdat ar -cr $TCtmp/lib.a file0.in file2.in crtest -File1time=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` -File2time=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` +File1time=`ar -tv $TCtmp/lib.a | grep file0.in` +File2time=`ar -tv $TCtmp/lib.a | grep file2.in` #sleep 5 touch -c -t 201503030303.55 file0.in ar -ru $TCtmp/lib.a file0.in file2.in 2>&1 1>/dev/null -File1time1=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` -File2time2=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` +File1time1=`ar -tv $TCtmp/lib.a | grep file0.in` +File2time2=`ar -tv $TCtmp/lib.a | grep file2.in` -if [ $File2time = $File2time2 ] +if [ "$File2time" = "$File2time2" ] then - if [ $File1time = $File1time1 ] + if [ "$File1time" = "$File1time1" ] then TCRESULT=20 echo "FAIL - ar with -u flag failed" diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c index e67e43c..485b465 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c @@ -127,8 +127,7 @@ main(int ac, char **av) /* Check number of hugepages */ if (get_no_of_hugepages() <= 0 || hugepages_size() <= 0) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to \ - sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); /* Perform global setup for test */ setup(); diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c index b30afef..229b929 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c @@ -105,7 +105,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c index 431c1e3..2f56127 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c @@ -102,7 +102,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c index f892799..a106976 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c @@ -86,7 +86,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c index baff476..e40123d 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c @@ -130,7 +130,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c index 928f76a..e434082 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c @@ -102,7 +102,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c index 7d039e6..5a7e02a 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c @@ -105,7 +105,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c index 7c0cec5..bb5480e 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c @@ -87,7 +87,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c index 10f29d3..6fa02ab 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c @@ -82,7 +82,7 @@ int main(int ac, char **av) /* The following loop checks looping state if -i option given */ if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c index 9066f45..80d3a2b 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c @@ -84,7 +84,7 @@ int main(int ac, char **av) { } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c index aa76097..fc78b45 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c @@ -85,7 +85,7 @@ int main(int ac, char **av) /* The following loop checks looping state if -i option given */ if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c index de9ab46..bc4bd2c 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c @@ -86,7 +86,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c index c6c34c0..7033a37 100644 --- a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c +++ b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c @@ -39,11 +39,11 @@ int TST_TOTAL=2; int errno; +int main(int argc, char *argv[]) +{ #if HAVE_SYS_CAPABILITY_H #if HAVE_DECL_PR_CAPBSET_READ && HAVE_DECL_PR_CAPBSET_DROP #ifdef HAVE_LIBCAP -int main(int argc, char *argv[]) -{ int ret = 1; cap_value_t v[1]; cap_flag_value_t f; diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c b/testcases/kernel/syscalls/eventfd/eventfd01.c index 05acc1b..83eb86e 100644 --- a/testcases/kernel/syscalls/eventfd/eventfd01.c +++ b/testcases/kernel/syscalls/eventfd/eventfd01.c @@ -729,7 +729,7 @@ static void setup(void) tst_sig(FORK, DEF_HANDLER, cleanup); if (tst_kvercmp(2, 6, 22) < 0) - tst_brkm(TCONF, cleanup, "2.6.22 or greater kernel required"); + tst_brkm(TCONF, tst_exit, "2.6.22 or greater kernel required"); /* Create a temporary directory & chdir there */ tst_tmpdir(); hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-15 09:28:08
|
The branch, next, has been updated via 4eca2b5b7d3f4dfb1fd661eab2931d3564a4a85f (commit) via 6fc71a4987f658ac48b476defb8cc341cb7361c3 (commit) via 1ff0128460531d9f9c46353eba65dd79ca27bbc8 (commit) via 2e271475913722d7c29463c64703575dff69c4fb (commit) via 2eb2342d3a9db5a089742473895af4fdf1e6f4c8 (commit) via 5da1b33941b513ac1f693cf86e27b5750b43dea2 (commit) via e90e0138cb7444d5db967183397b776979efd593 (commit) via 001227f859f24bde222d0813d9327afe4c132a33 (commit) via 1d67dc1564c73d49fc681679e4a5b9be48420e48 (commit) via 3bf514769d060a64d0f38f4b97c00d8bb0de74f8 (commit) via 69d19f3fa26f62f7d27a8cd427b39fb5d29d588f (commit) from c150e9b196b1267beeefdaec4dde9933503448f3 (commit) - Log ----------------------------------------------------------------- commit 4eca2b5b7d3f4dfb1fd661eab2931d3564a4a85f Merge: 6fc71a4987f658ac48b476defb8cc341cb7361c3 1ff0128460531d9f9c46353eba65dd79ca27bbc8 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 14:55:31 2010 +0530 Merge branches 'pu' and 'next' into next commit 6fc71a4987f658ac48b476defb8cc341cb7361c3 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 14:54:39 2010 +0530 merge with pu branch changed by Garret Signed-off-by: Rishikesh K Rajak <ris...@li...> ----------------------------------------------------------------------- Summary of changes: testcases/commands/mail/mail_tests.sh | 11 +++++------ .../conformance/definitions/aio_h/2-1.c | 1 + .../conformance/definitions/errno_h/3-1.c | 2 +- .../conformance/definitions/pthread_h/2-2.c | 9 +++++++++ .../conformance/interfaces/aio_cancel/3-1.c | 2 +- .../conformance/interfaces/aio_cancel/4-1.c | 1 - .../conformance/interfaces/aio_cancel/5-1.c | 1 - .../conformance/interfaces/aio_cancel/6-1.c | 1 - .../conformance/interfaces/aio_cancel/7-1.c | 1 - .../conformance/interfaces/aio_error/2-1.c | 1 - .../conformance/interfaces/sched_yield/1-1.c | 14 +++++++------- 11 files changed, 24 insertions(+), 20 deletions(-) diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh index ff4540c..99aa278 100755 --- a/testcases/commands/mail/mail_tests.sh +++ b/testcases/commands/mail/mail_tests.sh @@ -77,8 +77,7 @@ fi # check if the user mail_test exists on this system. # if not add that user mail_test, will removed before exiting test. -id -u mail_test >/dev/null 2>&1 -if [ $? -ne 0 ] ; then +if id -u mail_test >/dev/null 2>&1; then tst_resm TINFO "INIT: Adding temporary user mail_test" useradd -m -s /sbin/nologin mail_test > $LTPTMP/tst_mail.out 2>&1 if [ $? -ne 0 ]; then @@ -327,8 +326,8 @@ RC=0 tst_resm TINFO "Test #5: Test that mail -b user@domain will" tst_resm TINFO "Test #5: blind carbon copy user@domain" -# send mail to root and carbon copy mail_test -mail -s "Test" root@localhost -b mail_test@localhost < \ +# send mail to root and blind carbon copy mail_test +mail -s "Test" root@localhost -c mail_test@localhost < \ $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1 if [ $? -ne 0 ]; then tst_res TFAIL $LTPTMP/tst_mail.out \ @@ -345,10 +344,10 @@ else if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then tst_resm TPASS \ - "Test #5: Mail was blind carbon copied to user mail_test" + "Test #5: Mail was carbon copied to user mail_test" else tst_res TFAIL $LTPTMP/tst_mail.res \ - "Test #5: mail failed to blind carbon copy user mail_test. Reason:" + "Test #5: mail failed to carbon copy user mail_test. Reason:" : $(( TFAILCNT += 1 )) fi diff --git a/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c b/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c index ef0f2c5..7ae8001 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c +++ b/testcases/open_posix_testsuite/conformance/definitions/aio_h/2-1.c @@ -9,6 +9,7 @@ /* test if aio.h exists and can be included */ #include <aio.h> +#include <stdlib.h> /* For NULL on non-linux platforms. */ int main(void) { diff --git a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c index 40c8cb3..ed1c519 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c +++ b/testcases/open_posix_testsuite/conformance/definitions/errno_h/3-1.c @@ -1,5 +1,5 @@ /* - *Following symbles need to be defined in errno.h + *Following symbols need to be defined in errno.h *author:ys...@ln... */ diff --git a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c index 65300d7..0dd5ff8 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c +++ b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c @@ -11,6 +11,15 @@ #include <pthread.h> +/* + * XXX (garrcoop): the following #ifndef checks are invalid on many platforms; POSIX + * doesn't state whether or not these these can or cannot be either global variables + * or indices in enums (FreeBSD does the latter with + * PTHREAD_MUTEX_{ERRORCHECK,NORMAL.RECURSIVE} + * + * These tests need to be sorted out into proper functional tests. + */ + /* BAR */ #ifndef PTHREAD_BARRIER_SERIAL_THREAD #error PTHREAD_BARRIER_SERIAL_THREAD not defined diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c index 4b75c08..29db1ec 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c @@ -35,8 +35,8 @@ #include <fcntl.h> #include <string.h> #include <errno.h> +#include <signal.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c index a3a3c6c..9499df5 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c @@ -35,7 +35,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c index 65531cf..956e749 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c @@ -33,7 +33,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c index cc0b5e2..5e35427 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c @@ -36,7 +36,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c index 8db24ab..6b8f70c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c @@ -34,7 +34,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c index 4940091..0ba1abe 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c @@ -29,7 +29,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c index 7437e0a..e9e54f4 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/sched_yield/1-1.c @@ -19,9 +19,8 @@ * 4. Launch a thread which call sched_yield() and check that the counter has * changed since the call. */ -#define LINUX -#ifdef LINUX +#ifdef __linux__ #define _GNU_SOURCE #endif @@ -35,7 +34,8 @@ #include <sys/wait.h> #include "posixtest.h" -#ifdef BSD +#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) +#define BSD # include <sys/types.h> # include <sys/param.h> # include <sys/sysctl.h> @@ -78,7 +78,7 @@ int get_ncpu() { return ncpu; } -#ifdef LINUX +#ifdef __linux__ int set_process_affinity(int cpu) { int retval = -1; @@ -131,7 +131,7 @@ int set_thread_affinity(int cpu) void * runner(void * arg) { int i=0, nc; long result = 0; -#ifdef LINUX +#ifdef __linux__ set_thread_affinity(*(int *)arg); fprintf(stderr, "%ld bind to cpu: %d\n", pthread_self(), *(int*)arg); #endif @@ -154,7 +154,7 @@ void * runner(void * arg) { } void * busy_thread(void *arg){ -#ifdef LINUX +#ifdef __linux__ set_thread_affinity(*(int *)arg); fprintf(stderr, "%ld bind to cpu: %d\n", pthread_self(), *(int*)arg); #endif @@ -170,7 +170,7 @@ void * busy_thread(void *arg){ void buzy_process(int cpu){ struct sched_param param; -#ifdef LINUX +#ifdef __linux__ /* Bind to a processor */ set_process_affinity(cpu); fprintf(stderr, "%d bind to cpu: %d\n", getpid(), cpu); hooks/post-receive -- ltp |
From: Garrett C. <ris...@li...> - 2010-04-15 08:36:42
|
The branch, pu, has been updated via 1ff0128460531d9f9c46353eba65dd79ca27bbc8 (commit) via 2e271475913722d7c29463c64703575dff69c4fb (commit) from 2eb2342d3a9db5a089742473895af4fdf1e6f4c8 (commit) - Log ----------------------------------------------------------------- commit 1ff0128460531d9f9c46353eba65dd79ca27bbc8 Author: Garrett Cooper <yan...@gm...> Date: Thu Apr 15 01:34:13 2010 -0700 Correct comment so that it filters its way up to next (eventually). Signed-off-by: Garrett Cooper <yan...@gm...> commit 2e271475913722d7c29463c64703575dff69c4fb Author: Garrett Cooper <yan...@gm...> Date: Thu Apr 8 00:27:08 2010 -0700 Note #define vs enum conformance issue with signal_h/26-1.c Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: testcases/commands/mail/mail_tests.sh | 2 +- .../conformance/definitions/pthread_h/2-2.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh index 790cdd6..99aa278 100755 --- a/testcases/commands/mail/mail_tests.sh +++ b/testcases/commands/mail/mail_tests.sh @@ -326,7 +326,7 @@ RC=0 tst_resm TINFO "Test #5: Test that mail -b user@domain will" tst_resm TINFO "Test #5: blind carbon copy user@domain" -# send mail to root and carbon copy mail_test +# send mail to root and blind carbon copy mail_test mail -s "Test" root@localhost -c mail_test@localhost < \ $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1 if [ $? -ne 0 ]; then diff --git a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c index 65300d7..0dd5ff8 100644 --- a/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c +++ b/testcases/open_posix_testsuite/conformance/definitions/pthread_h/2-2.c @@ -11,6 +11,15 @@ #include <pthread.h> +/* + * XXX (garrcoop): the following #ifndef checks are invalid on many platforms; POSIX + * doesn't state whether or not these these can or cannot be either global variables + * or indices in enums (FreeBSD does the latter with + * PTHREAD_MUTEX_{ERRORCHECK,NORMAL.RECURSIVE} + * + * These tests need to be sorted out into proper functional tests. + */ + /* BAR */ #ifndef PTHREAD_BARRIER_SERIAL_THREAD #error PTHREAD_BARRIER_SERIAL_THREAD not defined hooks/post-receive -- ltp |
From: Rishi k. K R. <ris...@li...> - 2010-04-15 06:50:50
|
The branch, next, has been updated via c150e9b196b1267beeefdaec4dde9933503448f3 (commit) via eaf73222df286c200475aadac78122b182b5f388 (commit) via cc7c7035a60b40f9a417b5e437ca6ea43ebfd783 (commit) via 2a276cf8bb5b94259482ec039edc2ae7fbaf953e (commit) via a9d5600c78943e9e7e1b52c5ec81e9772a47b44f (commit) from aabf191024aacc91784593b0d3f8d5fa37434b25 (commit) - Log ----------------------------------------------------------------- commit c150e9b196b1267beeefdaec4dde9933503448f3 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 12:17:56 2010 +0530 I tried "eventfd01" test in my system. This test failed with TWARN (return code:4) : ------------ eventfd01 1 TCONF : 2.6.22 or greater kernel required eventfd01 2 TCONF : Remaining cases not appropriate for configuration eventfd01 3 TCONF : Remaining cases not appropriate for configuration eventfd01 4 TCONF : Remaining cases not appropriate for configuration eventfd01 5 TCONF : Remaining cases not appropriate for configuration eventfd01 6 TCONF : Remaining cases not appropriate for configuration eventfd01 7 TCONF : Remaining cases not appropriate for configuration eventfd01 8 TCONF : Remaining cases not appropriate for configuration eventfd01 9 TCONF : Remaining cases not appropriate for configuration eventfd01 10 TCONF : Remaining cases not appropriate for configuration eventfd01 11 TCONF : Remaining cases not appropriate for configuration eventfd01 12 TCONF : Remaining cases not appropriate for configuration eventfd01 13 TCONF : Remaining cases not appropriate for configuration eventfd01 14 TCONF : Remaining cases not appropriate for configuration eventfd01 15 TCONF : Remaining cases not appropriate for configuration eventfd01 0 TWARN : tst_rmdir(): TESTDIR was NULL; no removal attempted ------------ Signed-off-by: Tomonori Mitani <mi...@ry...> Signed-off-by: Rishikesh K Rajak <ris...@li...> commit eaf73222df286c200475aadac78122b182b5f388 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 12:14:19 2010 +0530 I found out that "-)20" test of "ar01" failed once in a while. Its code is as follows: ------------ ... rm -rf $TCtmp/lib.a;cd $TCdat ar -cr $TCtmp/lib.a file0.in file2.in crtest File1time=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` File2time=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` touch -c -t 201503030303.55 file0.in ar -ru $TCtmp/lib.a file0.in file2.in 2>&1 1>/dev/null File1time1=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` File2time2=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` if [ $File2time = $File2time2 ] then if [ $File1time = $File1time1 ] then TCRESULT echo "FAIL - ar with -u flag failed" else echo "-)20" fi else TCRESULT echo "FAIL - ar with -u flag failed" fi touch file0.in ... ------------ "file0.in" and "file2.in" are offered with "ar01" source, and they are copied when "make install" is executed. In this code, "File1time" and "File1time1" are times of before and after time-stamp changing of "file0.in" by "touch -c -t ..." command. But "File1time" and "File1time1" are only minute numbers. It's problem, I think. If installation is at 2010.04.06 XX:03 accidentally, both of "File1time" and "File1time1" are "03". And this code ends as "FAIL". This happens with a one-60th probability. Signed-off-by: Tomonori Mitani <mi...@ry...> Signed-off-by: Rishikesh K Rajak <ris...@li...> commit cc7c7035a60b40f9a417b5e437ca6ea43ebfd783 Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 12:08:07 2010 +0530 I tried to build by using yesterday's git in my system (RHEL4.8 x86). (ltp-dev-4837fee8a7c2de6a83c8927a574c792ca6dabe4e.tar.gz) But build failed in "cap_bset_inh_bounds.c" with following message. This is different from "cap_bounds_r.c"'s problem (another thread), I think ------------ gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -I/home/LTP/ltp-dev-20100401-3/testcases/kernel/include -I../../../../include -I../../../../include -L../../../../lib cap_bset_inh_bounds.c -lltp -lcap -o cap_bset_inh_bounds cap_bset_inh_bounds.c:124: error: syntax error before numeric constant cap_bset_inh_bounds.c:124: warning: type defaults to `int' in declaration of `tst_resm' cap_bset_inh_bounds.c:124: error: conflicting types for 'tst_resm' ../../../../include/test.h:192: error: previous declaration of 'tst_resm' was here cap_bset_inh_bounds.c:124: error: conflicting types for 'tst_resm' ../../../../include/test.h:192: error: previous declaration of 'tst_resm' was here cap_bset_inh_bounds.c:124: warning: data definition has no type or storage class cap_bset_inh_bounds.c:129: warning: type defaults to `int' in declaration of `tst_exit' cap_bset_inh_bounds.c:129: error: conflicting types for 'tst_exit' ../../../../include/test.h:203: error: previous declaration of 'tst_exit' was here cap_bset_inh_bounds.c:129: error: conflicting types for 'tst_exit' ../../../../include/test.h:203: error: previous declaration of 'tst_exit' was here cap_bset_inh_bounds.c:129: warning: data definition has no type or storage class cap_bset_inh_bounds.c:130: error: syntax error before '}' token ------------ In this source, the pair of "ifdef" start/end and the pair of main() function's "parenthesis" are alternate, I think. Acked-by: Serge Hallyn <se...@us...> Signed-off-by : Tomonori Mitani <mi...@ry...> Signed-off-by: Rishikesh K Rajak <ris...@li...> commit 2a276cf8bb5b94259482ec039edc2ae7fbaf953e Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 12:06:23 2010 +0530 I found two problems in mail test. (${LTPROOT}/testcases/commands/mail/mail_tests.sh) They are simple mistakes, I think. 1) About judgment for making a user name In line 80 of "mail_tests.sh", there is following sentence. ------------ if id -u mail_test >/dev/null 2>&1; then ------------ This control sentence is going to judge whether the result of "id -u mail_test" command is normal or not, I think. But this sentence is not effective. Therefore the user name "make_test" cannot be made when this user name isn't exist. 2) About "blind carbon copy" option In "mail_tests.sh", there are 5 tests about mail. 5th is "blind carbon copy" test. However, this test doesn't use "-b" option but uses "-c" option. Signed-off-by: Tomonori Mitani <mi...@ry...> Signed-off-by: Rishikesh K Rajak <ris...@li...> commit a9d5600c78943e9e7e1b52c5ec81e9772a47b44f Author: Rishikesh K Rajak <ris...@li...> Date: Thu Apr 15 12:04:09 2010 +0530 I tried "hugemmap", "hugeshmat", "hugeshmctl", "hugeshmdt" and "hugeshmget" tests. And I found several fails in them: ------------<at "${LTPROOT}/testcases/kernel/mem/hugetlb/" directory> - ./hugemmap/ 1) hugemmap04 : return code = 2 - ./hugeshmat/ 2) hugeshmat01 : return code = 6 3) hugeshmat02 : return code = 6 4) hugeshmat03 : return code = 2 - ./hugeshmctl/ 5) hugeshmctl01 : return code = 6 6) hugeshmctl02 : return code = 6 7) hugeshmctl03 : return code = 2 - ./hugeshmdt/ 8) hugeshmdt01 : return code = 6 - ./hugeshmget/ 9) hugeshmget01 : return code = 2 10) hugeshmget02 : return code = 6 11) hugeshmget03 : return code = 6 12) hugeshmget05 : return code = 2 ------------ These tests output following messages: ------------ a) All tests: "TBROK : Test cannot be continued owning to sufficient availability of Hugepages on the system" b) 2), 3), 5), 6), 8), 10), 11) tests: "TWARN : tst_rmdir(): TESTDIR was NULL; no removal attempted" ------------ Both case a) and case b) are caused by the same reason. All of case a) failures occured at the following points (for example hugemmap04): ------------<hugemmap04.c - main()> /* Check number of hugepages */ if (get_no_of_hugepages() <= 0 || hugepages_size() <= 0) tst_brkm(TBROK, cleanup, "Test cannot be continued owning to \ sufficient availability of Hugepages on the system"); ------------ I found out that "HugePages_Total" parameter of "/proc/meminfo" file is set to "0". This caused above TBROK failure. It is environment problem. But, in this case, tests must not return with TBROK, but with TCONF, I think. And, in case b), these tests try to delete "TESTDIR" directory by calling "tst_rmdir()" function in "cleanup()" function. But, "TESTDIR" never set if "tst_tmpdir()" function isn't called. I think that case b)'s tests must not call cleanup() function. I want to suggest following patch. Signed-off-by: Tomonori Mitani <mi...@ry...> Signed-off-by: Rishikesh K Rajak <ris...@li...> ----------------------------------------------------------------------- Summary of changes: testcases/commands/ade/ar/ar01 | 12 ++++++------ testcases/commands/mail/mail_tests.sh | 9 +++++---- testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c | 3 +-- .../kernel/mem/hugetlb/hugeshmat/hugeshmat01.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat02.c | 2 +- .../kernel/mem/hugetlb/hugeshmat/hugeshmat03.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c | 2 +- .../kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c | 2 +- .../kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget01.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget02.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget03.c | 2 +- .../kernel/mem/hugetlb/hugeshmget/hugeshmget05.c | 2 +- .../security/cap_bound/cap_bset_inh_bounds.c | 4 ++-- testcases/kernel/syscalls/eventfd/eventfd01.c | 2 +- 16 files changed, 26 insertions(+), 26 deletions(-) diff --git a/testcases/commands/ade/ar/ar01 b/testcases/commands/ade/ar/ar01 index c90faf9..55363dc 100755 --- a/testcases/commands/ade/ar/ar01 +++ b/testcases/commands/ade/ar/ar01 @@ -519,19 +519,19 @@ echo "-)19 SKIPPED due to binutils ar automatically adds a symbol." rm -rf $TCtmp/lib.a;cd $TCdat ar -cr $TCtmp/lib.a file0.in file2.in crtest -File1time=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` -File2time=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` +File1time=`ar -tv $TCtmp/lib.a | grep file0.in` +File2time=`ar -tv $TCtmp/lib.a | grep file2.in` #sleep 5 touch -c -t 201503030303.55 file0.in ar -ru $TCtmp/lib.a file0.in file2.in 2>&1 1>/dev/null -File1time1=`ar -tv $TCtmp/lib.a | grep file0.in | cut -f2 -d: | cut -f1 -d" "` -File2time2=`ar -tv $TCtmp/lib.a | grep file2.in | cut -f2 -d: | cut -f1 -d" "` +File1time1=`ar -tv $TCtmp/lib.a | grep file0.in` +File2time2=`ar -tv $TCtmp/lib.a | grep file2.in` -if [ $File2time = $File2time2 ] +if [ "$File2time" = "$File2time2" ] then - if [ $File1time = $File1time1 ] + if [ "$File1time" = "$File1time1" ] then TCRESULT=20 echo "FAIL - ar with -u flag failed" diff --git a/testcases/commands/mail/mail_tests.sh b/testcases/commands/mail/mail_tests.sh index 790cdd6..ff4540c 100755 --- a/testcases/commands/mail/mail_tests.sh +++ b/testcases/commands/mail/mail_tests.sh @@ -77,7 +77,8 @@ fi # check if the user mail_test exists on this system. # if not add that user mail_test, will removed before exiting test. -if id -u mail_test >/dev/null 2>&1; then +id -u mail_test >/dev/null 2>&1 +if [ $? -ne 0 ] ; then tst_resm TINFO "INIT: Adding temporary user mail_test" useradd -m -s /sbin/nologin mail_test > $LTPTMP/tst_mail.out 2>&1 if [ $? -ne 0 ]; then @@ -327,7 +328,7 @@ tst_resm TINFO "Test #5: Test that mail -b user@domain will" tst_resm TINFO "Test #5: blind carbon copy user@domain" # send mail to root and carbon copy mail_test -mail -s "Test" root@localhost -c mail_test@localhost < \ +mail -s "Test" root@localhost -b mail_test@localhost < \ $LTPTMP/tst_mail.in > $LTPTMP/tst_mail.out 2>&1 if [ $? -ne 0 ]; then tst_res TFAIL $LTPTMP/tst_mail.out \ @@ -344,10 +345,10 @@ else if [ "x$RC1" != x0 -a "x$RC2" != x0 ]; then tst_resm TPASS \ - "Test #5: Mail was carbon copied to user mail_test" + "Test #5: Mail was blind carbon copied to user mail_test" else tst_res TFAIL $LTPTMP/tst_mail.res \ - "Test #5: mail failed to carbon copy user mail_test. Reason:" + "Test #5: mail failed to blind carbon copy user mail_test. Reason:" : $(( TFAILCNT += 1 )) fi diff --git a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c index e67e43c..485b465 100644 --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c @@ -127,8 +127,7 @@ main(int ac, char **av) /* Check number of hugepages */ if (get_no_of_hugepages() <= 0 || hugepages_size() <= 0) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to \ - sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); /* Perform global setup for test */ setup(); diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c index b30afef..229b929 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c @@ -105,7 +105,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c index 431c1e3..2f56127 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c @@ -102,7 +102,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c index f892799..a106976 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c @@ -86,7 +86,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c index baff476..e40123d 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c @@ -130,7 +130,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c index 928f76a..e434082 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c @@ -102,7 +102,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c index 7d039e6..5a7e02a 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c @@ -105,7 +105,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c index 7c0cec5..bb5480e 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c @@ -87,7 +87,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c index 10f29d3..6fa02ab 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c @@ -82,7 +82,7 @@ int main(int ac, char **av) /* The following loop checks looping state if -i option given */ if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c index 9066f45..80d3a2b 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c @@ -84,7 +84,7 @@ int main(int ac, char **av) { } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c index aa76097..fc78b45 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c @@ -85,7 +85,7 @@ int main(int ac, char **av) /* The following loop checks looping state if -i option given */ if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c index de9ab46..bc4bd2c 100644 --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c @@ -86,7 +86,7 @@ int main(int ac, char **av) } if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 ) - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to sufficient availability of Hugepages on the system"); + tst_brkm(TCONF, cleanup, "Not enough available Hugepages"); else huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() * hugepages_size() * 1024) / 2 ; diff --git a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c index c6c34c0..7033a37 100644 --- a/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c +++ b/testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c @@ -39,11 +39,11 @@ int TST_TOTAL=2; int errno; +int main(int argc, char *argv[]) +{ #if HAVE_SYS_CAPABILITY_H #if HAVE_DECL_PR_CAPBSET_READ && HAVE_DECL_PR_CAPBSET_DROP #ifdef HAVE_LIBCAP -int main(int argc, char *argv[]) -{ int ret = 1; cap_value_t v[1]; cap_flag_value_t f; diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c b/testcases/kernel/syscalls/eventfd/eventfd01.c index 05acc1b..83eb86e 100644 --- a/testcases/kernel/syscalls/eventfd/eventfd01.c +++ b/testcases/kernel/syscalls/eventfd/eventfd01.c @@ -729,7 +729,7 @@ static void setup(void) tst_sig(FORK, DEF_HANDLER, cleanup); if (tst_kvercmp(2, 6, 22) < 0) - tst_brkm(TCONF, cleanup, "2.6.22 or greater kernel required"); + tst_brkm(TCONF, tst_exit, "2.6.22 or greater kernel required"); /* Create a temporary directory & chdir there */ tst_tmpdir(); hooks/post-receive -- ltp |
From: Garrett C. <ris...@li...> - 2010-04-08 04:58:39
|
The branch, pu, has been updated via 2eb2342d3a9db5a089742473895af4fdf1e6f4c8 (commit) via 5da1b33941b513ac1f693cf86e27b5750b43dea2 (commit) from e90e0138cb7444d5db967183397b776979efd593 (commit) - Log ----------------------------------------------------------------- commit 2eb2342d3a9db5a089742473895af4fdf1e6f4c8 Author: Garrett Cooper <yan...@gm...> Date: Wed Apr 7 21:57:26 2010 -0700 Fix more deprecated malloc.h includes. Signed-off-by: Garrett Cooper <yan...@gm...> commit 5da1b33941b513ac1f693cf86e27b5750b43dea2 Author: Garrett Cooper <yan...@gm...> Date: Wed Apr 7 21:53:54 2010 -0700 Fix incorrect / missing included headers. POSIX 1003.1 2004 states that stdlib.h supplants malloc.h and signal.h is required for sigaction and sigemptyset. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../conformance/interfaces/aio_cancel/3-1.c | 2 +- .../conformance/interfaces/aio_cancel/4-1.c | 1 - .../conformance/interfaces/aio_cancel/5-1.c | 1 - .../conformance/interfaces/aio_cancel/6-1.c | 1 - .../conformance/interfaces/aio_cancel/7-1.c | 1 - .../conformance/interfaces/aio_error/2-1.c | 1 - 6 files changed, 1 insertions(+), 6 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c index 4b75c08..29db1ec 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/3-1.c @@ -35,8 +35,8 @@ #include <fcntl.h> #include <string.h> #include <errno.h> +#include <signal.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c index a3a3c6c..9499df5 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/4-1.c @@ -35,7 +35,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c index 65531cf..956e749 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/5-1.c @@ -33,7 +33,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c index cc0b5e2..5e35427 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/6-1.c @@ -36,7 +36,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c index 8db24ab..6b8f70c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_cancel/7-1.c @@ -34,7 +34,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" diff --git a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c index 4940091..0ba1abe 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/aio_error/2-1.c @@ -29,7 +29,6 @@ #include <string.h> #include <errno.h> #include <stdlib.h> -#include <malloc.h> #include <aio.h> #include "posixtest.h" hooks/post-receive -- ltp |