Re: [LTP] [PATCH] Fix build failures of pidns on ia64 arch

2009-01-15 Thread Mike Frysinger
On Thursday 15 January 2009 02:17:27 Seiichi Ikarashi wrote:
 +#ifdef __ia64__
 +   ret = clone2(fn1, childstack, getpagesize(), clone_flags, arg1,
 NULL, NULL, NULL); +#else
 +   ret = clone(fn1, childstack, clone_flags, arg1);
 +#endif

look at the clone testcases under kernel syscalls and you'll see the magic 
formula for working with __hppa__.  otherwise i dont see a problem with this.
-mike


signature.asc
Description: This is a digitally signed message part.
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] [PATCH] sched_cli_serv: fopen: No such file or directory

2009-01-15 Thread CAI Qian
Hi,

This patch fixes the following error when running sched_cli_serv test
case via runltp by making the path of the data file as a runtime 
option and giving an absolute path of it.

# ./runltp -p -d /tmp -l /tmp/1.log -o /tmp/2.log -f sched

# cat 2.log
...
test_start
tag=sched_cli_serv stime=1231923084
cmdline=run_sched_cliserv.sh
contacts=
analysis=exit
initiation_status=ok
test_output
fopen: No such file or directory
/mnt/tests/kernel/distribution/ltp/20081031/ltp-full-20081031/testcases
/bin/run_sched_cliserv.sh: line 6:  5206 Terminated  pthserv
execution_status
duration=0 termination_type=exited termination_id=1 corefile=no
cutime=1 cstime=1
test_end
...

Signed-off-by: CAI Qian caiq...@cclom.cn

--- ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh.orig   
2009-01-15 01:38:32.0 -0500
+++ ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh
2009-01-15 03:16:44.0 -0500
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/bin/sh -x
 
 pthserv 
-pthcli 127.0.0.1
+pthcli 127.0.0.1 $LTPROOT/testcases/bin/data
 clientCode=$?
 killall pthserv
 serverCode=$?

--- ltp-full-20081031/testcases/kernel/sched/clisrv/pthcli.c.orig   
2009-01-15 01:35:38.0 -0500
+++ ltp-full-20081031/testcases/kernel/sched/clisrv/pthcli.c2009-01-15 
03:10:50.0 -0500
@@ -104,9 +104,9 @@
 struct sockaddr_in serv_addr;
 
 pname = argv[0];
-if (argc  2) 
+if (argc  3) 
 {
-   printf(\nusage: %s ip#\n, pname);
+   printf(\nusage: %s ip data\n, pname);
exit(1);
 }
 
@@ -141,7 +141,7 @@
exit(1);
 }
 #ifdef _LINUX
-if ((input = fopen(./data, r)) == NULL) 
+if ((input = fopen(argv[2], r)) == NULL) 
 {
perror(fopen);
 return(errno);


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix build failures of pidns on ia64 arch

2009-01-15 Thread Seiichi Ikarashi
Mike Frysinger さんは書きました:
 On Thursday 15 January 2009 02:17:27 Seiichi Ikarashi wrote:
 +#ifdef __ia64__
 +   ret = clone2(fn1, childstack, getpagesize(), clone_flags, arg1,
 NULL, NULL, NULL); +#else
 +   ret = clone(fn1, childstack, clone_flags, arg1);
 +#endif
 
 look at the clone testcases under kernel syscalls and you'll see the magic 
 formula for working with __hppa__.  otherwise i dont see a problem with this.
 -mike

Like this?

Signed-off-by: Seiichi Ikarashi s.ikara...@jp.fujitsu.com

Regards,
--- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.c	2008-02-14 17:49:30.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.c	2009-01-15 18:01:37.0 +0900
@@ -18,25 +18,53 @@
 
 /* Serge: should I be passing in strings for error messages? */
 
+int do_clone(unsigned long clone_flags,
+			int(*fn1)(void *arg), void *arg1)
+{
+	int ret;
+	int stack_size = getpagesize() * 4;
+	void *stack = malloc (stack_size);
+
+	if (!stack) {
+		perror(malloc);
+		return -1;
+	}
+
+#if defined(__hppa__)
+	ret = clone(fn1, stack, clone_flags, arg1);
+#elif defined(__ia64__)
+	ret = clone2(fn1, stack, stack_size, clone_flags, arg1, NULL, NULL, NULL);
+#else
+	ret = clone(fn1, stack + stack_size, clone_flags, arg1);
+#endif
+
+	if (ret == -1) {
+		perror(clone);
+		free(stack);
+	}
+
+	return ret;
+}
+
 int do_clone_tests(unsigned long clone_flags,
 			int(*fn1)(void *arg), void *arg1,
 			int(*fn2)(void *arg), void *arg2)
 {
 	int ret;
 	int stack_size = getpagesize() * 4;
-	void *childstack, *stack = malloc (stack_size);
+	void *stack = malloc (stack_size);
 
 	if (!stack) {
 		perror(malloc);
 		return -1;
 	}
 
-	childstack = stack + stack_size;
-
-#ifdef __ia64__
-	ret = clone2(fn1, childstack, getpagesize(), clone_flags | SIGCHLD, arg1, NULL, NULL, NULL);
+#if defined(__hppa__)
+	ret = clone(fn1, stack, clone_flags | SIGCHLD, arg1);
+#elif defined(__ia64__)
+	ret = clone2(fn1, stack, stack_size, clone_flags | SIGCHLD, arg1, NULL, NULL, NULL);
 #else
-	ret = clone(fn1, childstack, clone_flags | SIGCHLD, arg1);
+	ret = clone(fn1, stack + stack_size, clone_flags | SIGCHLD, arg1);
 #endif
 
 	if (ret == -1) {
--- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.h	2008-09-19 21:17:10.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.h	2009-01-15 17:50:57.0 +0900
@@ -55,7 +55,10 @@
 #define __NR_unshare SYS_unshare
 #endif
 
-#ifdef __ia64__
+#if defined (__s390__) || (__s390x__)
+#define clone __clone
+extern int __clone(int(void*),void*,int,void*);
+#elif defined(__ia64__)
 #define clone2 __clone2
 extern int  __clone2(int (*fn) (void *arg), void *child_stack_base,
 size_t child_stack_size, int flags, void *arg,
@@ -89,6 +92,9 @@ extern int create_net_namespace(char *, 
  * Fn2 may be NULL.
  */
 
+int do_clone(unsigned long clone_flags,
+			int(*fn1)(void *arg), void *arg1);
+
 int do_clone_tests(unsigned long clone_flags,
 			int(*fn1)(void *arg), void *arg1,
 			int(*fn2)(void *arg), void *arg2);
--- ltp-full-20081231/testcases/kernel/containers/pidns/check_pidns_enabled.c	2007-12-28 18:40:55.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/pidns/check_pidns_enabled.c	2009-01-15 16:10:01.0 +0900
@@ -51,7 +51,6 @@ int dummy(void *v)
 /* MAIN */
 int main()
 {
-void *childstack, *stack;
 int pid;
 
 	/* Test for the running kernel version
@@ -59,19 +58,8 @@ int main()
 	 */
 if (tst_kvercmp(2,6,24)  0)
 return 1;
-stack = malloc(getpagesize());
-if (!stack) {
-perror(malloc);
-return 2;
-}
 
-childstack = stack + getpagesize();
-
-#ifdef __ia64__
-pid = clone2(dummy, childstack, getpagesize(), CLONE_NEWPID, NULL, NULL, NULL, NULL);
-#else
-pid = clone(dummy, childstack, CLONE_NEWPID, NULL);
-#endif
+pid = do_clone(CLONE_NEWPID, dummy, NULL);
 
 	/* Check for the clone function return value */
 if (pid == -1)
--- ltp-full-20081231/testcases/kernel/containers/pidns/pidns12.c	2008-12-16 21:34:49.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/pidns/pidns12.c	2009-01-15 16:10:01.0 +0900
@@ -152,9 +152,7 @@ int child_fn(void *arg)
 
 int main(int argc, char *argv[])
 {
-	int status, stack_size=getpagesize() * 4;
-	void *stack = malloc (stack_size);
-	void *childstack;
+	int status;
 	pid_t pid, cpid;
 	char buf[5];
 
@@ -167,15 +165,7 @@ int main(int argc, char *argv[])
 		cleanup();
 	}
 
-	/* Container creation on PID namespace */
-	if (!stack) {
-		tst_resm(TBROK, parent: stack creation failed.);
-		cleanup();
-	}
-
-	childstack = stack + stack_size;
-
-	cpid = clone(child_fn, childstack, CLONE_NEWPID|SIGCHLD, NULL);
+	cpid = do_clone(CLONE_NEWPID|SIGCHLD, child_fn, NULL);
 	if (cpid  0) {
 		tst_resm(TBROK, parent: clone() failed(%s).,\
 strerror(errno));
--- 

Re: [LTP] [PATCH] update kernel/device-drivers/nls test for 2.6.25

2009-01-15 Thread Subrata Modak

On Wed, 2009-01-14 at 08:14 +0100, Németh Márton wrote:
 Hi,
 Subrata Modak wrote:
  On Sat, 2009-01-10 at 14:31 +0100, Németh Márton wrote:
  Hi,
 
  the attached patch makes the ltp/testcases/kernel/device-drivers/nls
  testsuite compileable under Linux kernel 2.6.25.
 
  Currently the test_nls_base() crashes with 2.6.25, but without calling that
  function the module loads and unloads cleanly. This can be a base for 
  checking
  what is going wrong with nls.
 
  Signed-off-by: Márton Németh nm...@freemail.hu
  
  Thanks Németh for the patch. I tested the build on my machine 2.6.27,
  x86_64. I have merged this Patch. However, i would request you to send
  me another patch containing the following information:
  
  1) Kernel config options to be enabled  any special library(s) to be
  installed to allow these tests to be built/run on kernel(s)  2.6.25 in
  the following README:
  http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/README
  
  2) Then,
  http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/device-drivers/nls/README
  should contain information to build/install/run these tests. Since these
  are device drivers tests, and will be executed through insmod, etc, can
  we have a script which automates these steps and reports error in
  loading/unloading of modules as such. I think it can be a very small
  script as well.
 
 I added some descriptions in the mentioned READMEs. However, I would wait

Thanks for this.

 adding an automated shell script because the tests fails on my x86_32 system

Ok.

 with 2.6.28, and for example rmmod nlsTest reports ERROR: Module nlsTest 
 is in use.
 The real problem is, however, that the one of the test case already caused
 NULL pointer exception.
 
 I also don't have any easy solution to report only the nlsTest output to the
 user other than first running dmesg -c and then load nlsTest.ko. After the
 module was loaded the dmesg will only show the output of the testsuite.
 The drawback is that the user will loose the first part of his/her dmesg
 in this way.

Regards--
Subrata



--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Prevent false negatives in cron_pos_tests caused by returning exit value of wrong command

2009-01-15 Thread Subrata Modak
Not sure why your patches pop up very late. The below was delivered to
my mailbox(at IBM  gmail) today only. Anyways, thanks. This has been
applied.

Regards--
Subrata

On Mon, 2008-12-29 at 14:32 +0100, Jiri Palecek  wrote:
 Hello,
 
 this patch fixes erroneous failure caused by returning return value of a 
 wrong command in cron tests.
 
 Regards
 Jiri Palecek
 
 ---
 testcases/commands/cron/cron_pos_tests.sh |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/testcases/commands/cron/cron_pos_tests.sh 
 b/testcases/commands/cron/cron_pos_tests.sh
 index cc21bd3..2e24af9 100755
 --- a/testcases/commands/cron/cron_pos_tests.sh
 +++ b/testcases/commands/cron/cron_pos_tests.sh
 @@ -24,8 +24,9 @@ if [ $iam = root ]; then
 
   mv $CRON_ALLOW $CRON_ALLOW.old  /dev/null
   su $1 -c $0 $*
 + RC=$?
   mv $CRON_ALLOW.old $CRON_ALLOW  /dev/null
 - exit $?
 + exit $RC
 fi
 
 function restorecrontab () {
 


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] [PATCH] fcntl27 and fcntl28: failed with errno 11

2009-01-15 Thread CAI Qian
Hi,

This patch fixes fcntl27 and fcntl28 test cases failures seen on RHEL 4
kernel (2.6.9 based).

# ./fcntl27
fcntl27 1  FAIL  :  fcntl(tfile_1206, F_SETLEASE, F_RDLCK) failed
with errno 11 : Resource temporarily unavailable

# ./fcntl28
fcntl28 1  FAIL  :  fcntl(tfile_1213, F_SETLEASE, F_RDLCK) failed
with errno 11 : Resource temporarily unavailable

It because the expected result in incorrect. There is a kernel version 
comparison code in both tests.

if ((results=tst_kvercmp(2,6,10)) = 0)
  {
expected_result = -1;
  }
else if( ((results=tst_kvercmp(2,4,0)) = 0)\
 ((results=tst_kvercmp(2,6,0)) 0) )
  {
expected_result = 1;
  }
else if( ((results=tst_kvercmp(2,6,0)) = 0)\
 ((results=tst_kvercmp(2,6,10)) 0) )
  {
expected_result = 0;
  }
else
  {
 expected_result = -1;
  }

Because it is kernel 2.6.9, the expected_result will be 0. However, 
the actual return code is the same as other kernels like 2.6.18,
as it only allow F_RDLCK option to be placed on a read-only file
descriptor (man fcntl).

# strace ./fcntl27
...
open(tfile_1453, O_RDWR|O_CREAT, 0777) = 3
...
fcntl(3, 0x400 /* F_??? */, 0)  = -1 EAGAIN (Resource
temporarily unavailable)

I have no idea where is the above kernel version and expected code
mapping originally came from. I have searched the manpage of fcntl(),
but not found any mention of 2.6.10. Since there is a check already,

#ifdef F_SETLEASE

I have removed the above code like other fcntl* test cases, but I am
willing to listen other options.

Signed-off-by: CAI Qian caiq...@cclom.cn

--- ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl27.c.orig
2009-01-15 04:12:02.0 -0500
+++ ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl27.c 2009-01-15 
04:18:01.0 -0500
@@ -116,8 +116,6 @@
   int lc,expected_result = -1;  /* loop counter, expected */ 
 /* result from system call */ 
 char *msg;  /* message returned from parse_opts */
-int results;/* Stores the result of the */
- /* kernel comparison test */
 /***
  * parse standard options
  ***/
@@ -131,24 +129,7 @@
 
 TEST_EXP_ENOS(exp_enos);
 
-if( (results=tst_kvercmp(2,6,10)) = 0)
- {
-   expected_result = -1;
- }
-else if( ((results=tst_kvercmp(2,4,0)) = 0)\
-((results=tst_kvercmp(2,6,0)) 0) )
-  {
-   expected_result = 1;
-  }
-else if( ((results=tst_kvercmp(2,6,0)) = 0)\
-((results=tst_kvercmp(2,6,10)) 0) )
-  {
-   expected_result = 0;
-  }
-else
-  {
-expected_result = -1;
-  }
+expected_result = -1;
 
 /***
  * check looping state if -c option given
--- ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl28.c.orig
2009-01-15 04:12:08.0 -0500
+++ ltp-full-20081031/testcases/kernel/syscalls/fcntl/fcntl28.c 2009-01-15 
04:17:47.0 -0500
@@ -112,7 +112,6 @@
 int lc,expected_result = -1;   /* loop counter, expected resul*/
   /*   from system call */
 char *msg;/* message returned from parse_opts */
-int results;   /* stores result of kernel comparison 
*/
 /***
  * parse standard options
  ***/
@@ -127,24 +126,7 @@
 /* set the expected errnos... */
 TEST_EXP_ENOS(exp_enos);
 
-if ((results=tst_kvercmp(2,6,10)) = 0)
- {
-   expected_result = -1;
- }
-else if( ((results=tst_kvercmp(2,4,0)) = 0)\
-((results=tst_kvercmp(2,6,0)) 0) )
-  {
-   expected_result = 1;
-  }
-else if( ((results=tst_kvercmp(2,6,0)) = 0)\
-((results=tst_kvercmp(2,6,10)) 0) )
-  {
-   expected_result = 0;
-  }
-else
-  {
-expected_result = -1;
-  }
+expected_result = -1;
 
 /***
  * check looping state if -c option given


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [resend] Introduce autoconf to eventfd test case

2009-01-15 Thread Subrata Modak
Hi Yamato,

On Wed, 2009-01-14 at 11:37 +0900, Masatake YAMATO wrote:
Sorry,

Can you please resend me the patch ?
   
   Yes. Please, try.
   
   
   Signed-off-by: Masatake YAMATO yam...@redhat.com
  
  Yes, even with today´s CVS snapshot, i get the same error again:
  
  cc -Wall  -I../../include -g -Wall -I../../../../include -Wall
  eventfd01.c  -L../../../../lib -laio -lltp -o eventfd01
  eventfd01.c: In function ‘trigger_eventfd_overflow’:
  eventfd01.c:578: warning: implicit declaration of function
  ‘io_set_eventfd’
  /tmp/ccsXOgjk.o: In function `trigger_eventfd_overflow':
  /ltp-intermediate-20090105/testcases/kernel/syscalls/eventfd/eventfd01.c:578:
   undefined reference to `io_set_eventfd'
  collect2: ld returned 1 exit status
  make[4]: *** [eventfd01] Error 1
 
 Could you send me following data?
 

Here they are:

 
 If you get a build error, please report it to ltp-l...@lists.sf.net with
 following information,
 
  1. the error output of build tools(make, gcc, etc...)
  2. the output of ./configure 


Output of ./configure:

$ ./configure 
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking for signalfd... no
checking sys/signalfd.h usability... no
checking sys/signalfd.h presence... no
checking for sys/signalfd.h... no
checking for linux/signalfd.h... no
checking for signalfd.h... no
checking for modify_ldt... yes
checking asm/ldt.h usability... yes
checking asm/ldt.h presence... yes
checking for asm/ldt.h... yes
checking for struct user_desc... yes
checking for struct modify_ldt_ldt_s... no
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking sys/capability.h usability... yes
checking sys/capability.h presence... yes
checking for sys/capability.h... yes
checking libaio.h usability... yes
checking libaio.h presence... yes
checking for libaio.h... yes
checking for io_setup in -laio... yes
checking io_set_eventfd is defined in aio library or aio header... yes
checking for sys/inotify.h... (cached) yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
configure: creating ./config.status
config.status: creating config.mk
config.status: creating include/config.h

Output of make:

cc -Wall  -I../../include -g -Wall -I../../../../include -Wall
eventfd01.c  -L../../../../lib -laio -lltp -o eventfd01
eventfd01.c: In function ‘trigger_eventfd_overflow’:
eventfd01.c:578: warning: implicit declaration of function
‘io_set_eventfd’
/tmp/cc2rMu8w.o: In function `trigger_eventfd_overflow':
/home/subratamodak/OFFICE_WORKS/LTP_PROJECT_CODE/LTP_TARS/DECEMBER_2008_RELEASE/ltp-intermediate-20090115/testcases/kernel/syscalls/eventfd/eventfd01.c:578:
 undefined reference to `io_set_eventfd'
collect2: ld returned 1 exit status
make[4]: *** [eventfd01] Error 1


  3. include/config.h
  4. config.mk
  5. config.log
 
Remaining attached.

Regards--
Subrata

 
 
 Masatake
 
/* include/config.h.  Generated from config.h.in by configure.  */
/* include/config.h.in.  Generated from configure.ac by autoheader.  */

/* Define to 1 if you have the asm/ldt.h header file. */
#define HAVE_ASM_LDT_H 1

/* Define to 1 if you have the ifaddrs.h header file. */
#define HAVE_IFADDRS_H 1

/* Define to 1 if you have the inttypes.h header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `io_set_eventfd' function. */
#define HAVE_IO_SET_EVENTFD 1

/* Define to 1 if you have the libaio.h header file. */
#define HAVE_LIBAIO_H 1

/* Define to 1 if you have the linux/signalfd.h header file. */
/* #undef HAVE_LINUX_SIGNALFD_H */

/* Define to 1 if you have the linux/types.h header file. */
#define HAVE_LINUX_TYPES_H 1

/* Define to 1 if you have the memory.h header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `modify_ldt' function. */
#define

Re: [LTP] [PATCH] sched_cli_serv: fopen: No such file or directory

2009-01-15 Thread Subrata Modak

On Thu, 2009-01-15 at 00:31 -0800, CAI Qian wrote:
 Hi,
 
 This patch fixes the following error when running sched_cli_serv test
 case via runltp by making the path of the data file as a runtime 
 option and giving an absolute path of it.
 
 # ./runltp -p -d /tmp -l /tmp/1.log -o /tmp/2.log -f sched
 
 # cat 2.log
 ...
 test_start
 tag=sched_cli_serv stime=1231923084
 cmdline=run_sched_cliserv.sh
 contacts=
 analysis=exit
 initiation_status=ok
 test_output
 fopen: No such file or directory
 /mnt/tests/kernel/distribution/ltp/20081031/ltp-full-20081031/testcases
 /bin/run_sched_cliserv.sh: line 6:  5206 Terminated  pthserv
 execution_status
 duration=0 termination_type=exited termination_id=1 corefile=no
 cutime=1 cstime=1
 test_end
 ...
 
 Signed-off-by: CAI Qian caiq...@cclom.cn

Thanks.

Regards--
Subrata

 
 --- ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh.orig 
 2009-01-15 01:38:32.0 -0500
 +++ ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh  
 2009-01-15 03:16:44.0 -0500
 @@ -1,7 +1,7 @@
 -#!/bin/sh
 +#!/bin/sh -x
 
  pthserv 
 -pthcli 127.0.0.1
 +pthcli 127.0.0.1 $LTPROOT/testcases/bin/data
  clientCode=$?
  killall pthserv
  serverCode=$?
 
 --- ltp-full-20081031/testcases/kernel/sched/clisrv/pthcli.c.orig 
 2009-01-15 01:35:38.0 -0500
 +++ ltp-full-20081031/testcases/kernel/sched/clisrv/pthcli.c  2009-01-15 
 03:10:50.0 -0500
 @@ -104,9 +104,9 @@
  struct sockaddr_in serv_addr;
 
  pname = argv[0];
 -if (argc  2) 
 +if (argc  3) 
  {
 - printf(\nusage: %s ip#\n, pname);
 + printf(\nusage: %s ip data\n, pname);
   exit(1);
  }
 
 @@ -141,7 +141,7 @@
   exit(1);
  }
  #ifdef _LINUX
 -if ((input = fopen(./data, r)) == NULL) 
 +if ((input = fopen(argv[2], r)) == NULL) 
  {
   perror(fopen);
  return(errno);
 
 
 --
 This SF.net email is sponsored by:
 SourcForge Community
 SourceForge wants to tell your story.
 http://p.sf.net/sfu/sf-spreadtheword
 ___
 Ltp-list mailing list
 Ltp-list@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/ltp-list


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix broken symlink to tst_unzip_file.zip

2009-01-15 Thread Subrata Modak
Hi,

On Thu, 2009-01-15 at 12:35 +0900, Seiichi Ikarashi wrote:
 --- b/testcases/commands/unzip/Makefile 2008-12-12 23:02:42.0
 +0900
 +++ a/testcases/commands/unzip/Makefile 2009-01-14 09:04:02.0
 +0900
 @@ -4,7 +4,7 @@ all:
  install:
 ln -f unzip_tests.sh ../../bin/unzip_tests.sh
 ln -f tst_unzip_file.zip ../../bin/tst_unzip_file.zip
 -   ln -f tst_unzip_file.zip /tmp/tst_unzip_file.zip
 +   ln -fs $(PWD)/unzip/tst_unzip_file.zip /tmp/tst_unzip_file.zip

You would probably wanted to do this:

-   ln -sf tst_unzip_file.zip /tmp/tst_unzip_file.zip
+   ln -fs $(PWD)/unzip/tst_unzip_file.zip /tmp/tst_unzip_file.zip

Done.

Regards--
Subrata

 chmod 777 tst_unzip_file.zip
 
  clean:
 


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix ps -p failures in ltpstress.sh

2009-01-15 Thread Subrata Modak
Hi Le,

On Thu, 2009-01-15 at 12:13 +0900, Seiichi Ikarashi wrote:
 Hi,
 
 I encountered a failure on running ltpstress.sh.
 
 # cd ltp-full-20081231/testscripts
 # ./ltpstress.sh
:
 ERROR: List of process IDs must follow -p.
 * simple selection *  * selection by list
 *
 -A all processes  -C by command name
 -N negate selection   -G by real group ID (supports
 names)
 -a all w/ tty except session leaders  -U by real user ID (supports
 names)
 -d all except session leaders -g by session OR by effective
 group name
 -e all processes  -p by process ID
 T  all processes on this terminal -s processes in the sessions
 given
 a  all w/ tty, including other users  -t by tty
 g  OBSOLETE -- DO NOT USE -u by effective user ID
 (supports names)
 r  only running processes U  processes for specified users
 x  processes w/o controlling ttys t  by tty
 *** output format **  *** long options
 ***
 -o,o user-defined  -f full--Group --User --pid --cols
 --ppid
 -j,j job control   s  signal  --group --user --sid --rows
 --info
 -O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
 -l,l long  u  user-oriented   --sort --tty --forest --version
 -F   extra fullX  registers   --heading --no-heading --context
 * misc options *
 -V,V  show version  L  list format codes  f  ASCII art forest
 -m,m,-L,-T,H  threads   S  children in sum-y change -l format
 -M,Z  security data c  true command name  -c scheduling class
 -w,w  wide output   n  numeric WCHAN,UID  -H process hierarchy
 ERROR: List of process IDs must follow -p.
 * simple selection *  * selection by list
 *
 -A all processes  -C by command name
 -N negate selection   -G by real group ID (supports
 names)
 -a all w/ tty except session leaders  -U by real user ID (supports
 names)
 -d all except session leaders -g by session OR by effective
 group name
 -e all processes  -p by process ID
 T  all processes on this terminal -s processes in the sessions
 given
 a  all w/ tty, including other users  -t by tty
 g  OBSOLETE -- DO NOT USE -u by effective user ID
 (supports names)
 r  only running processes U  processes for specified users
 x  processes w/o controlling ttys t  by tty
 *** output format **  *** long options
 ***
 -o,o user-defined  -f full--Group --User --pid --cols
 --ppid
 -j,j job control   s  signal  --group --user --sid --rows
 --info
 -O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
 -l,l long  u  user-oriented   --sort --tty --forest --version
 -F   extra fullX  registers   --heading --no-heading --context
 * misc options *
 -V,V  show version  L  list format codes  f  ASCII art forest
 -m,m,-L,-T,H  threads   S  children in sum-y change -l format
 -M,Z  security data c  true command name  -c scheduling class
 -w,w  wide output   n  numeric WCHAN,UID  -H process hierarchy
 Error: Could not start nfs server daemon.
 # 
 
 This problem seems to be introduced by
 http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testscripts/ltpstress.sh?r1=1.26r2=1.27
 Since I don't know why it wanted to eliminate rpcinfo command,
 I wrote two solutions attached.

Can you kindly discuss/comment on this patches from Seiichi ?

Regards--
Subrata

 
 Signed-off-by: Seiichi Ikarashi s.ikara...@jp.fujitsu.com
 
 Regards,
 
 
 
 
 
 
 
 
 differences
 between files
 attachment
 (ltpstress.sh.v1.patch)
 
 --- b/testscripts/ltpstress.sh  2008-12-12 00:01:18.0 +0900
 +++ a/testscripts/ltpstress.sh  2009-01-14 09:37:51.0 +0900
 @@ -183,34 +183,34 @@ if [ $NO_NETWORK -eq 0 ];then
  echo The RPC test suite is using portmap
fi
 
 -  ps -p | grep nfs 
 +  rpcinfo -p | grep nfs
if [ $? -eq 1 ];then
  /usr/sbin/rpc.nfsd 
fi
sleep 1
 -  ps -p | grep nfs 
 +  rpcinfo -p | grep nfs
if [ $? -eq 1 ];then
  echo Error: Could not start nfs server daemon.
  exit 1
fi
 
 -  ps -p | grep status 
 +  rpcinfo -p | grep status
if [ $? -eq 1 ];then
  /sbin/rpc.statd 
fi
sleep 1
 -  ps -p | grep status 
 +  rpcinfo -p | grep status
if [ $? -eq 1 ];then
  echo Error: Could not start statd daemon.
  exit 1
fi
 
 -  ps -p | grep mount 
 +  rpcinfo -p | grep mount
if [ $? -eq 1 ];then
  /usr/sbin/rpc.mountd 
fi
sleep 1
 -  ps -p | grep mount 
 +  rpcinfo -p | grep mount
if [ $? -eq 1 ];then
  echo Error: Could not start mountd daemon.
  exit 1
 
 
 
 
 
 
 
 differences
 between files
 attachment
 (ltpstress.sh.v2.patch)
 
 --- b/testscripts/ltpstress.sh  2008-12-12 

Re: [LTP] Fix for msgctl11.c

2009-01-15 Thread Subrata Modak
On Tue, 2009-01-13 at 16:13 +0530, Vinay Sridhar wrote:
 Hello,
 
 Resending the fix after modifications based on suggestions from Mike 
 Frysinger.
 
 PS: I've retained SHRT_MAX return value in the patch below as per the reason 
 stated earlier.
 
 
 
 Signed-off by: Vinay Sridhar vi...@linux.vnet.ibm.com

Thanks Vinay. This has been merged. I will also be introducing similar
solution of writing some library functions in LTP, which any
tests(specifically the
http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testcases/kernel/mem/hugetlb/,) 
can use to determine the Hugepages info of systems.

Regards--
Subrata

 
 diff -Nuarp ltp-full-20081130_orig//include/system_specific_process_info.h 
 ltp-full-20081130/include/system_specific_process_info.h
 --- ltp-full-20081130_orig//include/system_specific_process_info.h
 1969-12-31 18:00:00.0 -0600
 +++ ltp-full-20081130/include/system_specific_process_info.h  2009-01-06 
 14:49:37.0 -0600
 @@ -0,0 +1,29 @@
 +/*
 + *
 + *   Copyright (c) International Business Machines  Corp., 2009
 + *
 + *   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
 + *   the Free Software Foundation; either version 2 of the License, or
 + *   (at your option) any later version.
 + *
 + *   This program is distributed in the hope that it will be useful,
 + *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
 + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 + *   the GNU General Public License for more details.
 + *
 + *   You should have received a copy of the GNU General Public License
 + *   along with this program;  if not, write to the Free Software
 + *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + */
 +
 +#ifndef _SYS_SPECIFIC_PROCESS_INFO_H_
 +#define _SYS_SPECIFIC_PROCESS_INFO_H_
 +
 +/* Returns max pid count obtained from reading /proc/sys/kernel/pid_max */
 +int get_max_pids(void);
 +
 +/* Returns number of free pids */
 +int get_free_pids(void);
 +
 +#endif
 diff -Nuarp ltp-full-20081130_orig//lib/system_specific_process_info.c 
 ltp-full-20081130/lib/system_specific_process_info.c
 --- ltp-full-20081130_orig//lib/system_specific_process_info.c
 1969-12-31 18:00:00.0 -0600
 +++ ltp-full-20081130/lib/system_specific_process_info.c  2009-01-13 
 16:23:55.0 -0600
 @@ -0,0 +1,90 @@
 +/*
 + *
 + *   Copyright (c) International Business Machines  Corp., 2009
 + *
 + *   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
 + *   the Free Software Foundation; either version 2 of the License, or
 + *   (at your option) any later version.
 + *
 + *   This program is distributed in the hope that it will be useful,
 + *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
 + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 + *   the GNU General Public License for more details.
 + *
 + *   You should have received a copy of the GNU General Public License
 + *   along with this program;  if not, write to the Free Software
 + *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 + */
 +
 +/*
 + *   DESCRIPTION
 + *   get_max_pids(): Return the maximum number of pids for this system by
 + *   reading /proc/sys/kernel/pid_max
 + *
 + *   get_free_pids(): Return number of free pids by subtracting the number 
 + *of pids currently used ('ps -eT') from max_pids
 + */
 +
 +
 +
 +#include fcntl.h
 +#include sys/types.h
 +#include test.h
 +
 +#define BUFSIZE 512
 +
 +int get_max_pids(void)
 +{
 +#ifdef __linux__
 +
 + FILE *f;
 + char buf[BUFSIZE];
 +
 + f = fopen(/proc/sys/kernel/pid_max, r);
 + if (!f) {
 + tst_resm(TBROK, Could not open /proc/sys/kernel/pid_max);
 + return -1;
 + }
 + if (!fgets(buf, BUFSIZE, f)) {
 + fclose(f);
 + tst_resm(TBROK, Could not read /proc/sys/kernel/pid_max);
 + return -1;
 + }
 + fclose(f);
 + return atoi(buf);
 +#else
 + return SHRT_MAX;
 +#endif
 +}
 +
 +
 +int get_free_pids(void)
 +{
 + FILE *f;
 + int used_pids, max_pids;
 + char buf[BUFSIZE];
 +
 + f = popen(ps -eT | wc -l, r);
 + if (!f) {
 + tst_resm(TBROK, Could not run 'ps' to calculate used 
 + pids);
 + return -1;
 + }
 + fscanf(f, %i, used_pids);
 + pclose(f);
 +
 + if (used_pids  0) {
 + tst_resm(TBROK, Could not read output of 'ps' to 
 + calculate used pids);
 + return -1;
 + }
 +
 + max_pids = get_max_pids();
 +
 + if (max_pids  0)
 + return -1;
 +
 + return max_pids - used_pids;
 +}
 +
 diff -Nuarp 
 

Re: [LTP] [PATCH] Fix ps -p failures in ltpstress.sh

2009-01-15 Thread Subrata Modak
   Hi,
   Looks Seiichi is right and his patches have to be applied.

He talked 2 different solutions. Which one is the best one ?

Regards--
Subrata

 
   Best Regards



--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix ps -p failures in ltpstress.sh

2009-01-15 Thread Le Rouzic

Hi,
I would take this one using ps -e and not rpcinfo -p
because the first idea was not using rpcinfo to be independant of a possible
bug in rpcinfo which is tested in other place.

Best Regards




Subrata Modak a écrit :

  Hi,
  Looks Seiichi is right and his patches have to be applied.



He talked 2 different solutions. Which one is the best one ?

Regards--
Subrata

  

  Best Regards






  



-- 
-
Company : Bull, Architect of an Open World TM (www.bull.com)
Name: Aime Le Rouzic 
Mail: Bull - BP 208 - 38432 Echirolles Cedex - France
E-Mail  : aime.le-rou...@bull.net
Phone   : 33 (4) 76.29.75.51
Fax : 33 (4) 76.29.75.18
- 


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix ps -p failures in ltpstress.sh

2009-01-15 Thread Subrata Modak

On Thu, 2009-01-15 at 13:28 +0100, Le Rouzic wrote:
 Hi,
 I would take this one using ps -e and not rpcinfo -p
 because the first idea was not using rpcinfo to be independant of a possible
 bug in rpcinfo which is tested in other place.
 

Thanks.

Regards--
Subrata

 Best Regards
 
 
 
 
 Subrata Modak a écrit :
 
   Hi,
   Looks Seiichi is right and his patches have to be applied.
 
 
 
 He talked 2 different solutions. Which one is the best one ?
 
 Regards--
 Subrata
 
   
 
   Best Regards
 
 
 
 
 
 
   
 
 
 


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix ps -p failures in ltpstress.sh

2009-01-15 Thread Subrata Modak
Thanks. As per Le´s comment i chose the 2nd one.

Regards--
Subrata

On Thu, 2009-01-15 at 12:13 +0900, Seiichi Ikarashi wrote:
 Hi,
 
 I encountered a failure on running ltpstress.sh.
 
 # cd ltp-full-20081231/testscripts
 # ./ltpstress.sh
:
 ERROR: List of process IDs must follow -p.
 * simple selection *  * selection by list *
 -A all processes  -C by command name
 -N negate selection   -G by real group ID (supports names)
 -a all w/ tty except session leaders  -U by real user ID (supports names)
 -d all except session leaders -g by session OR by effective group name
 -e all processes  -p by process ID
 T  all processes on this terminal -s processes in the sessions given
 a  all w/ tty, including other users  -t by tty
 g  OBSOLETE -- DO NOT USE -u by effective user ID (supports names)
 r  only running processes U  processes for specified users
 x  processes w/o controlling ttys t  by tty
 *** output format **  *** long options ***
 -o,o user-defined  -f full--Group --User --pid --cols --ppid
 -j,j job control   s  signal  --group --user --sid --rows --info
 -O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
 -l,l long  u  user-oriented   --sort --tty --forest --version
 -F   extra fullX  registers   --heading --no-heading --context
 * misc options *
 -V,V  show version  L  list format codes  f  ASCII art forest
 -m,m,-L,-T,H  threads   S  children in sum-y change -l format
 -M,Z  security data c  true command name  -c scheduling class
 -w,w  wide output   n  numeric WCHAN,UID  -H process hierarchy
 ERROR: List of process IDs must follow -p.
 * simple selection *  * selection by list *
 -A all processes  -C by command name
 -N negate selection   -G by real group ID (supports names)
 -a all w/ tty except session leaders  -U by real user ID (supports names)
 -d all except session leaders -g by session OR by effective group name
 -e all processes  -p by process ID
 T  all processes on this terminal -s processes in the sessions given
 a  all w/ tty, including other users  -t by tty
 g  OBSOLETE -- DO NOT USE -u by effective user ID (supports names)
 r  only running processes U  processes for specified users
 x  processes w/o controlling ttys t  by tty
 *** output format **  *** long options ***
 -o,o user-defined  -f full--Group --User --pid --cols --ppid
 -j,j job control   s  signal  --group --user --sid --rows --info
 -O,O preloaded -o  v  virtual memory  --cumulative --format --deselect
 -l,l long  u  user-oriented   --sort --tty --forest --version
 -F   extra fullX  registers   --heading --no-heading --context
 * misc options *
 -V,V  show version  L  list format codes  f  ASCII art forest
 -m,m,-L,-T,H  threads   S  children in sum-y change -l format
 -M,Z  security data c  true command name  -c scheduling class
 -w,w  wide output   n  numeric WCHAN,UID  -H process hierarchy
 Error: Could not start nfs server daemon.
 # 
 
 This problem seems to be introduced by
 http://ltp.cvs.sourceforge.net/viewvc/ltp/ltp/testscripts/ltpstress.sh?r1=1.26r2=1.27
 Since I don't know why it wanted to eliminate rpcinfo command,
 I wrote two solutions attached.
 
 Signed-off-by: Seiichi Ikarashi s.ikara...@jp.fujitsu.com
 
 Regards,
 
 --
 This SF.net email is sponsored by:
 SourcForge Community
 SourceForge wants to tell your story.
 http://p.sf.net/sfu/sf-spreadtheword
 ___ Ltp-list mailing list 
 Ltp-list@lists.sourceforge.net 
 https://lists.sourceforge.net/lists/listinfo/ltp-list


--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix build failures of pidns on ia64 arch

2009-01-15 Thread Mike Frysinger
On Thursday 15 January 2009 04:04:22 Seiichi Ikarashi wrote:
 Mike Frysinger さんは書きました:
  On Thursday 15 January 2009 02:17:27 Seiichi Ikarashi wrote:
  +#ifdef __ia64__
  +   ret = clone2(fn1, childstack, getpagesize(), clone_flags, arg1,
  NULL, NULL, NULL); +#else
  +   ret = clone(fn1, childstack, clone_flags, arg1);
  +#endif
 
  look at the clone testcases under kernel syscalls and you'll see the
  magic formula for working with __hppa__.  otherwise i dont see a problem
  with this.

 Like this?

i think so, thanks!
-mike


signature.asc
Description: This is a digitally signed message part.
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix build failures of pidns on ia64 arch

2009-01-15 Thread Serge E. Hallyn
Quoting Seiichi Ikarashi (s.ikara...@jp.fujitsu.com):
 Mike Frysinger さんは書きました:
  On Thursday 15 January 2009 02:17:27 Seiichi Ikarashi wrote:
  +#ifdef __ia64__
  +   ret = clone2(fn1, childstack, getpagesize(), clone_flags, arg1,
  NULL, NULL, NULL); +#else
  +   ret = clone(fn1, childstack, clone_flags, arg1);
  +#endif
  
  look at the clone testcases under kernel syscalls and you'll see the magic 
  formula for working with __hppa__.  otherwise i dont see a problem with 
  this.
  -mike
 
 Like this?

Cool, thanks, and thanks for fixing up the do_clone_tests().  However,
you pass the bottom instead of the top of the stack to clone.  See
the use of 'childstack' in the original do_clone_tests().

This still leaves two places to get the per-arch junk right, so how
about using do_clone() inside of do_clone_tests()?

thanks,
-serge

 Signed-off-by: Seiichi Ikarashi s.ikara...@jp.fujitsu.com
 
 Regards,

 --- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.c 
 2008-02-14 17:49:30.0 +0900
 +++ 
 ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.c
 2009-01-15 18:01:37.0 +0900
 @@ -18,25 +18,53 @@
 
  /* Serge: should I be passing in strings for error messages? */
 
 +int do_clone(unsigned long clone_flags,
 + int(*fn1)(void *arg), void *arg1)
 +{
 + int ret;
 + int stack_size = getpagesize() * 4;
 + void *stack = malloc (stack_size);
 +
 + if (!stack) {
 + perror(malloc);
 + return -1;
 + }
 +
 +#if defined(__hppa__)
 + ret = clone(fn1, stack, clone_flags, arg1);
 +#elif defined(__ia64__)
 + ret = clone2(fn1, stack, stack_size, clone_flags, arg1, NULL, NULL, 
 NULL);
 +#else
 + ret = clone(fn1, stack + stack_size, clone_flags, arg1);
 +#endif
 +
 + if (ret == -1) {
 + perror(clone);
 + free(stack);
 + }
 +
 + return ret;
 +}
 +
  int do_clone_tests(unsigned long clone_flags,
   int(*fn1)(void *arg), void *arg1,
   int(*fn2)(void *arg), void *arg2)
  {
   int ret;
   int stack_size = getpagesize() * 4;
 - void *childstack, *stack = malloc (stack_size);
 + void *stack = malloc (stack_size);
 
   if (!stack) {
   perror(malloc);
   return -1;
   }
 
 - childstack = stack + stack_size;
 -
 -#ifdef __ia64__
 - ret = clone2(fn1, childstack, getpagesize(), clone_flags | SIGCHLD, 
 arg1, NULL, NULL, NULL);
 +#if defined(__hppa__)
 + ret = clone(fn1, stack, clone_flags | SIGCHLD, arg1);
 +#elif defined(__ia64__)
 + ret = clone2(fn1, stack, stack_size, clone_flags | SIGCHLD, arg1, NULL, 
 NULL, NULL);
  #else
 - ret = clone(fn1, childstack, clone_flags | SIGCHLD, arg1);
 + ret = clone(fn1, stack + stack_size, clone_flags | SIGCHLD, arg1);
  #endif
 
   if (ret == -1) {
 --- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.h 
 2008-09-19 21:17:10.0 +0900
 +++ 
 ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.h
 2009-01-15 17:50:57.0 +0900
 @@ -55,7 +55,10 @@
  #define __NR_unshare SYS_unshare
  #endif
 
 -#ifdef __ia64__
 +#if defined (__s390__) || (__s390x__)
 +#define clone __clone
 +extern int __clone(int(void*),void*,int,void*);
 +#elif defined(__ia64__)
  #define clone2 __clone2
  extern int  __clone2(int (*fn) (void *arg), void *child_stack_base,
  size_t child_stack_size, int flags, void *arg,
 @@ -89,6 +92,9 @@ extern int create_net_namespace(char *, 
   * Fn2 may be NULL.
   */
 
 +int do_clone(unsigned long clone_flags,
 + int(*fn1)(void *arg), void *arg1);
 +
  int do_clone_tests(unsigned long clone_flags,
   int(*fn1)(void *arg), void *arg1,
   int(*fn2)(void *arg), void *arg2);
 --- ltp-full-20081231/testcases/kernel/containers/pidns/check_pidns_enabled.c 
 2007-12-28 18:40:55.0 +0900
 +++ 
 ltp-full-20081231.modified/testcases/kernel/containers/pidns/check_pidns_enabled.c
 2009-01-15 16:10:01.0 +0900
 @@ -51,7 +51,6 @@ int dummy(void *v)
  /* MAIN */
  int main()
  {
 -void *childstack, *stack;
  int pid;
 
   /* Test for the running kernel version
 @@ -59,19 +58,8 @@ int main()
*/
  if (tst_kvercmp(2,6,24)  0)
  return 1;
 -stack = malloc(getpagesize());
 -if (!stack) {
 -perror(malloc);
 -return 2;
 -}
 
 -childstack = stack + getpagesize();
 -
 -#ifdef __ia64__
 -pid = clone2(dummy, childstack, getpagesize(), CLONE_NEWPID, NULL, 
 NULL, NULL, NULL);
 -#else
 -pid = clone(dummy, childstack, CLONE_NEWPID, NULL);
 -#endif
 +pid = do_clone(CLONE_NEWPID, dummy, NULL);
 
   /* Check for the clone function return value */
  if (pid == -1)
 --- ltp-full-20081231/testcases/kernel/containers/pidns/pidns12.c   

Re: [LTP] [patch] vcontainer testcase on IPC NS - semaphore.patch

2009-01-15 Thread Serge E. Hallyn
Quoting Veerendra (vee...@linux.vnet.ibm.com):
 Hi


Submitting a new testcase on semaphore to test the IPCNS in the  
 containers. This patch contains the batch file to run the test on LTP.

 In this patch , I am checking  the IPCNS functionaity:
 Semaphore in parent NS is isolated from the container


 Changelog:
   Removed the extra semget call in the check_semaphore().
   Corrected the indentation.

 Results:

 sysvipc: Semaphore none
 sem_nstest0  INFO  :  Semaphore namespaces Isolation test : none

 sem_nstest0  INFO  :  PID 9262: Fetched existing semaphore..id = 2031616

 sem_nstest1  PASS  :  Plain cloned process found semaphore inside 
 container

 sysvipc: Semaphore clone
 sem_nstest0  INFO  :  Semaphore namespaces Isolation test : clone

 sem_nstest1  PASS  :  clone: Container didn't find semaphore
 sysvipc: Semaphore unshare
 sem_nstest0  INFO  :  Semaphore namespaces Isolation test : unshare

 sem_nstest1  PASS  :  unshare: Container didn't find semaphore





 Regardz
 Veerendra C





 Signed-off-by: Veerendra C veeren...@in.ibm.com

Acked-by: Serge Hallyn se...@us.ibm.com

EXCEPT  you should probably use a tst_resm(TBROK) + tst_exit() when
semget fails in main().

thanks,
-serge

 Index: ltp-full-20081231/testcases/kernel/containers/sysvipc/sem_nstest.c
 ===
 --- /dev/null
 +++ ltp-full-20081231/testcases/kernel/containers/sysvipc/sem_nstest.c
 @@ -0,0 +1,143 @@
 +/* *
 +* Copyright (c) International Business Machines Corp., 2009
 +* 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
 +* the Free Software Foundation; either version 2 of the License, or
 +* (at your option) any later version.
 +*
 +* This program is distributed in the hope that it will be useful,
 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
 +* the GNU General Public License for more details.
 +* You should have received a copy of the GNU General Public License
 +* along with this program; if not, write to the Free Software
 +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 +*
 +* Author: Veerendra C vecha...@in.ibm.com
 +*
 +* In Parent Process , create semaphore with key 154326L
 +* Now create container by passing 1 of the below flag values..
 +*clone(NONE), clone(CLONE_NEWIPC), or unshare(CLONE_NEWIPC)
 +* In cloned process, try to access the created semaphore
 +* Test PASS: If the semaphore is readable when flag is None.
 +* Test FAIL: If the semaphore is readable when flag is Unshare or Clone.
 +***/
 +
 +#define _GNU_SOURCE 1
 +#include stdio.h
 +#include stdlib.h
 +#include unistd.h
 +#include string.h
 +#include sys/ipc.h
 +#include sys/sem.h
 +#include libclone.h
 +#include test.h
 +
 +#define MY_KEY 154326L
 +#define UNSHARESTR unshare
 +#define CLONESTR   clone
 +#define NONESTRnone
 +
 +char *TCID = sem_nstest;
 +int TST_TOTAL = 1;
 +int p1[2];
 +int p2[2];
 +
 +int check_semaphore(void *vtest)
 +{
 + char buf[3];
 + int id;
 +
 + close(p1[1]);
 + close(p2[0]);
 +
 + read(p1[0], buf, 3);
 + id = semget(MY_KEY, 1, 0);
 + if (id == -1)
 + write(p2[1], notfnd, 7);
 + else {
 + write(p2[1], exists, 7);
 + tst_resm(TINFO, PID %d: Fetched existing semaphore..id = %d\n,
 + getpid(), id );
 + }
 + tst_exit();
 +
 + /* NOT REACHED */
 + return 0;
 +}
 +
 +int main(int argc, char *argv[])
 +{
 + int ret, use_clone = T_NONE, id;
 + char *tsttype = NONESTR;
 + char buf[7];
 +
 + if (argc != 2) {
 + tst_resm(TFAIL, Usage: %s clone| unshare| none\n, argv[0]);
 + tst_resm(TFAIL,  where clone, unshare, or fork specifies
 +  unshare method.);
 + tst_exit();
 + }
 +
 + /* Using PIPE's to sync between container and Parent */
 + if (pipe(p1) == -1) { perror(pipe); exit(EXIT_FAILURE); }
 + if (pipe(p2) == -1) { perror(pipe); exit(EXIT_FAILURE); }
 +
 + if (strcmp(argv[1], clone) == 0) {
 + use_clone = T_CLONE;
 + tsttype = CLONESTR;
 + } else if (strcmp(argv[1], unshare) == 0) {
 + use_clone = T_UNSHARE;
 + tsttype = UNSHARESTR;
 + }
 +
 +
 +   /* 1. Create (or fetch if existing) the binary semaphore */
 +   id = semget(MY_KEY, 1, IPC_CREAT | IPC_EXCL | 0666);
 +   if (id == -1) {
 + perror( Semaphore create );
 + if (errno != EEXIST) {
 + perror(semget failure);
 + exit(1);
 + }
 +

Re: [LTP] [patch] docuemtn for macro usage in Makefile (Was: tcore.c fails to build on ppc64)

2009-01-15 Thread Mike Frysinger
On Thursday 15 January 2009 01:56:47 Masatake YAMATO wrote:
 --- a/Makefile
 +++ b/Makefile

not sure we want to encourage documentation-in-the-build-system.  could you 
add this stuff to INSTALL instead ?  when people think how do i build this 
package, i'd think they'd (or at least they should) look at the documentation 
first rather than the build system.

 +# Macros

these are variables, not macros.
-mike


signature.asc
Description: This is a digitally signed message part.
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] Fix build failures of pidns on ia64 arch

2009-01-15 Thread Seiichi Ikarashi
Serge E. Hallyn wrote:
 Quoting Seiichi Ikarashi (s.ikara...@jp.fujitsu.com):
 Like this?
 
 Cool, thanks, and thanks for fixing up the do_clone_tests().  However,
 you pass the bottom instead of the top of the stack to clone.  See
 the use of 'childstack' in the original do_clone_tests().

I just copied it from testcases/kernel/syscalls/clone/clone01.c,
which passes the stack bottom to clone2() for __ia64__.
Since you pointed it out, I investigated a little.
In glibc-2.5.24, nptl/allocatestack.c:allocate_stack()
sets the stack variable as the bottom of the stack for
NEED_SEPARATE_REGISTER_STACK-defined arch, namely ia64.
In linux-2.6.28, arch/ia64/kernel/process.c:copy_thread()
sets child_ptregs-r12 as user_stack_base (the 2nd arg of __clone2)
+ user_stack_size (the 3rd arg of __clone2) - 16.
The r12 is the stack pointer on ia64.
So I bet passing the bottom is right in this case.

 
 This still leaves two places to get the per-arch junk right, so how
 about using do_clone() inside of do_clone_tests()?

You're right.

Signed-off-by: Seiichi Ikarashi s.ikara...@jp.fujitsu.com

Regards,
--- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.c	2008-02-14 17:49:30.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.c	2009-01-16 11:39:32.0 +0900
@@ -18,30 +18,43 @@
 
 /* Serge: should I be passing in strings for error messages? */
 
-int do_clone_tests(unsigned long clone_flags,
-			int(*fn1)(void *arg), void *arg1,
-			int(*fn2)(void *arg), void *arg2)
+int do_clone(unsigned long clone_flags,
+			int(*fn1)(void *arg), void *arg1)
 {
 	int ret;
 	int stack_size = getpagesize() * 4;
-	void *childstack, *stack = malloc (stack_size);
+	void *stack = malloc (stack_size);
 
 	if (!stack) {
 		perror(malloc);
 		return -1;
 	}
 
-	childstack = stack + stack_size;
-
-#ifdef __ia64__
-	ret = clone2(fn1, childstack, getpagesize(), clone_flags | SIGCHLD, arg1, NULL, NULL, NULL);
+#if defined(__hppa__)
+	ret = clone(fn1, stack, clone_flags, arg1);
+#elif defined(__ia64__)
+	ret = clone2(fn1, stack, stack_size, clone_flags, arg1, NULL, NULL, NULL);
 #else
-	ret = clone(fn1, childstack, clone_flags | SIGCHLD, arg1);
+	ret = clone(fn1, stack + stack_size, clone_flags, arg1);
 #endif
 
 	if (ret == -1) {
 		perror(clone);
 		free(stack);
+	}
+
+	return ret;
+}
+
+int do_clone_tests(unsigned long clone_flags,
+			int(*fn1)(void *arg), void *arg1,
+			int(*fn2)(void *arg), void *arg2)
+{
+	int ret;
+
+	ret = do_clone(clone_flags | SIGCHLD, fn1, arg1);
+
+	if (ret == -1) {
 		return -1;
 	}
 	if (fn2)
--- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.h	2008-09-19 21:17:10.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.h	2009-01-15 17:50:57.0 +0900
@@ -55,7 +55,10 @@
 #define __NR_unshare SYS_unshare
 #endif
 
-#ifdef __ia64__
+#if defined (__s390__) || (__s390x__)
+#define clone __clone
+extern int __clone(int(void*),void*,int,void*);
+#elif defined(__ia64__)
 #define clone2 __clone2
 extern int  __clone2(int (*fn) (void *arg), void *child_stack_base,
 size_t child_stack_size, int flags, void *arg,
@@ -89,6 +92,9 @@ extern int create_net_namespace(char *, 
  * Fn2 may be NULL.
  */
 
+int do_clone(unsigned long clone_flags,
+			int(*fn1)(void *arg), void *arg1);
+
 int do_clone_tests(unsigned long clone_flags,
 			int(*fn1)(void *arg), void *arg1,
 			int(*fn2)(void *arg), void *arg2);
--- ltp-full-20081231/testcases/kernel/containers/pidns/check_pidns_enabled.c	2007-12-28 18:40:55.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/pidns/check_pidns_enabled.c	2009-01-15 16:10:01.0 +0900
@@ -51,7 +51,6 @@ int dummy(void *v)
 /* MAIN */
 int main()
 {
-void *childstack, *stack;
 int pid;
 
 	/* Test for the running kernel version
@@ -59,19 +58,8 @@ int main()
 	 */
 if (tst_kvercmp(2,6,24)  0)
 return 1;
-stack = malloc(getpagesize());
-if (!stack) {
-perror(malloc);
-return 2;
-}
 
-childstack = stack + getpagesize();
-
-#ifdef __ia64__
-pid = clone2(dummy, childstack, getpagesize(), CLONE_NEWPID, NULL, NULL, NULL, NULL);
-#else
-pid = clone(dummy, childstack, CLONE_NEWPID, NULL);
-#endif
+pid = do_clone(CLONE_NEWPID, dummy, NULL);
 
 	/* Check for the clone function return value */
 if (pid == -1)
--- ltp-full-20081231/testcases/kernel/containers/pidns/pidns12.c	2008-12-16 21:34:49.0 +0900
+++ ltp-full-20081231.modified/testcases/kernel/containers/pidns/pidns12.c	2009-01-15 16:10:01.0 +0900
@@ -152,9 +152,7 @@ int child_fn(void *arg)
 
 int main(int argc, char *argv[])
 {
-	int status, stack_size=getpagesize() * 4;
-	void *stack = malloc (stack_size);
-	void *childstack;
+	int status;
 	pid_t pid, cpid;
 	char buf[5];
 
@@ -167,15 +165,7 @@ int main(int argc, char *argv[])
 		cleanup();
 	}
 
-	/* 

Re: [LTP] [PATCH] Fix build failures of pidns on ia64 arch

2009-01-15 Thread Serge E. Hallyn
Quoting Seiichi Ikarashi (s.ikara...@jp.fujitsu.com):
 Serge E. Hallyn wrote:
  Quoting Seiichi Ikarashi (s.ikara...@jp.fujitsu.com):
  Like this?
  
  Cool, thanks, and thanks for fixing up the do_clone_tests().  However,
  you pass the bottom instead of the top of the stack to clone.  See
  the use of 'childstack' in the original do_clone_tests().
 
 I just copied it from testcases/kernel/syscalls/clone/clone01.c,
 which passes the stack bottom to clone2() for __ia64__.
 Since you pointed it out, I investigated a little.
 In glibc-2.5.24, nptl/allocatestack.c:allocate_stack()
 sets the stack variable as the bottom of the stack for
 NEED_SEPARATE_REGISTER_STACK-defined arch, namely ia64.
 In linux-2.6.28, arch/ia64/kernel/process.c:copy_thread()
 sets child_ptregs-r12 as user_stack_base (the 2nd arg of __clone2)
 + user_stack_size (the 3rd arg of __clone2) - 16.
 The r12 is the stack pointer on ia64.
 So I bet passing the bottom is right in this case.

Wow, so all this time the containers testcases should
have failed on ia64?  Yikes...

  This still leaves two places to get the per-arch junk right, so how
  about using do_clone() inside of do_clone_tests()?
 
 You're right.
 
 Signed-off-by: Seiichi Ikarashi s.ikara...@jp.fujitsu.com

Acked-by: Serge Hallyn se...@us.ibm.com.

Thanks so much,

-serge

 Regards,

 --- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.c 
 2008-02-14 17:49:30.0 +0900
 +++ 
 ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.c
 2009-01-16 11:39:32.0 +0900
 @@ -18,30 +18,43 @@
 
  /* Serge: should I be passing in strings for error messages? */
 
 -int do_clone_tests(unsigned long clone_flags,
 - int(*fn1)(void *arg), void *arg1,
 - int(*fn2)(void *arg), void *arg2)
 +int do_clone(unsigned long clone_flags,
 + int(*fn1)(void *arg), void *arg1)
  {
   int ret;
   int stack_size = getpagesize() * 4;
 - void *childstack, *stack = malloc (stack_size);
 + void *stack = malloc (stack_size);
 
   if (!stack) {
   perror(malloc);
   return -1;
   }
 
 - childstack = stack + stack_size;
 -
 -#ifdef __ia64__
 - ret = clone2(fn1, childstack, getpagesize(), clone_flags | SIGCHLD, 
 arg1, NULL, NULL, NULL);
 +#if defined(__hppa__)
 + ret = clone(fn1, stack, clone_flags, arg1);
 +#elif defined(__ia64__)
 + ret = clone2(fn1, stack, stack_size, clone_flags, arg1, NULL, NULL, 
 NULL);
  #else
 - ret = clone(fn1, childstack, clone_flags | SIGCHLD, arg1);
 + ret = clone(fn1, stack + stack_size, clone_flags, arg1);
  #endif
 
   if (ret == -1) {
   perror(clone);
   free(stack);
 + }
 +
 + return ret;
 +}
 +
 +int do_clone_tests(unsigned long clone_flags,
 + int(*fn1)(void *arg), void *arg1,
 + int(*fn2)(void *arg), void *arg2)
 +{
 + int ret;
 +
 + ret = do_clone(clone_flags | SIGCHLD, fn1, arg1);
 +
 + if (ret == -1) {
   return -1;
   }
   if (fn2)
 --- ltp-full-20081231/testcases/kernel/containers/libclone/libclone.h 
 2008-09-19 21:17:10.0 +0900
 +++ 
 ltp-full-20081231.modified/testcases/kernel/containers/libclone/libclone.h
 2009-01-15 17:50:57.0 +0900
 @@ -55,7 +55,10 @@
  #define __NR_unshare SYS_unshare
  #endif
 
 -#ifdef __ia64__
 +#if defined (__s390__) || (__s390x__)
 +#define clone __clone
 +extern int __clone(int(void*),void*,int,void*);
 +#elif defined(__ia64__)
  #define clone2 __clone2
  extern int  __clone2(int (*fn) (void *arg), void *child_stack_base,
  size_t child_stack_size, int flags, void *arg,
 @@ -89,6 +92,9 @@ extern int create_net_namespace(char *, 
   * Fn2 may be NULL.
   */
 
 +int do_clone(unsigned long clone_flags,
 + int(*fn1)(void *arg), void *arg1);
 +
  int do_clone_tests(unsigned long clone_flags,
   int(*fn1)(void *arg), void *arg1,
   int(*fn2)(void *arg), void *arg2);
 --- ltp-full-20081231/testcases/kernel/containers/pidns/check_pidns_enabled.c 
 2007-12-28 18:40:55.0 +0900
 +++ 
 ltp-full-20081231.modified/testcases/kernel/containers/pidns/check_pidns_enabled.c
 2009-01-15 16:10:01.0 +0900
 @@ -51,7 +51,6 @@ int dummy(void *v)
  /* MAIN */
  int main()
  {
 -void *childstack, *stack;
  int pid;
 
   /* Test for the running kernel version
 @@ -59,19 +58,8 @@ int main()
*/
  if (tst_kvercmp(2,6,24)  0)
  return 1;
 -stack = malloc(getpagesize());
 -if (!stack) {
 -perror(malloc);
 -return 2;
 -}
 
 -childstack = stack + getpagesize();
 -
 -#ifdef __ia64__
 -pid = clone2(dummy, childstack, getpagesize(), CLONE_NEWPID, NULL, 
 NULL, NULL, NULL);
 -#else
 -pid = clone(dummy, childstack, CLONE_NEWPID, NULL);
 

Re: [LTP] [revised] Introduce autoconf to eventfd test case

2009-01-15 Thread Masatake YAMATO
Subrata,

Thank you for sending the files.
I found my mistake in m4/ltp-eventfd.m4.
To use AC_TRY_LINI, 'main' function is not needed.


Here is the revised patch:

Signed-off-by: Masatake YAMATO yam...@redhat.com


diff --git a/config.mk.in b/config.mk.in
new file mode 100644
index 000..22bad68
--- /dev/null
+++ b/config.mk.in
@@ -0,0 +1 @@
+AIO_LIBS = @AIO_LIBS@
diff --git a/configure.ac b/configure.ac
index e137d5b..b5f0d30 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,7 @@
 AC_PREREQ([2.61])
 AC_INIT([ltp], [cvs], [ltp-resu...@lists.sourceforge.net])
 AC_CONFIG_HEADERS([include/config.h])
+AC_CONFIG_FILES([config.mk])
 
 
 m4_include([m4/ltp-signalfd.m4])
@@ -9,6 +10,11 @@ LTP_CHECK_SYSCALL_SIGNALFD
 m4_include([m4/ltp-modify_ldt.m4])
 LTP_CHECK_SYSCALL_MODIFY_LDT
 
+m4_include([m4/ltp-eventfd.m4])
+LTP_CHECK_SYSCALL_EVENTFD
+
+AC_CHECK_HEADERS([sys/inotify.h])
+
 AC_CHECK_HEADERS([ifaddrs.h])
 
 AC_OUTPUT
diff --git a/m4/ltp-eventfd.m4 b/m4/ltp-eventfd.m4
new file mode 100644
index 000..12a0321
--- /dev/null
+++ b/m4/ltp-eventfd.m4
@@ -0,0 +1,44 @@
+dnl
+dnl Copyright (c) Red Hat Inc., 2008
+dnl
+dnl This program is free software;  you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY;  without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+dnl the GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program;  if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+dnl
+dnl Author: Masatake YAMATO yam...@redhat.com
+dnl
+
+dnl
+dnl LTP_CHECK_SYSCALL_EVENTFD
+dnl 
+dnl
+AC_DEFUN([LTP_CHECK_SYSCALL_EVENTFD],
+[dnl
+AH_TEMPLATE(HAVE_IO_SET_EVENTFD, 
+[Define to 1 if you have the `io_set_eventfd' function.])
+AC_CHECK_HEADERS(libaio.h,[
+   AC_CHECK_LIB(aio,io_setup,[
+   LIBS=$LIBS -laio
+   AIO_LIBS=-laio
+   AC_MSG_CHECKING([io_set_eventfd is defined in aio library or 
aio header])
+   AC_TRY_LINK([#include stdio.h
+ #include libaio.h
+   ],
+[io_set_eventfd(NULL, 0); return 0;
+   ],
+   [AC_DEFINE(HAVE_IO_SET_EVENTFD)
+AC_MSG_RESULT(yes)],
+[AC_MSG_RESULT(no)])],
+   AIO_LIBS=)])
+AC_SUBST(AIO_LIBS)
+])
diff --git a/testcases/kernel/syscalls/eventfd/Makefile 
b/testcases/kernel/syscalls/eventfd/Makefile
index fc31597..6073b6b 100644
--- a/testcases/kernel/syscalls/eventfd/Makefile
+++ b/testcases/kernel/syscalls/eventfd/Makefile
@@ -16,42 +16,17 @@
 #  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 
-include ../utils/cond.mk
+
+include ../../../../config.mk
 
 
 CFLAGS += -I../../../../include -Wall
-LDLIBS += -L../../../../lib -lltp
-
-check_aio_eventfd = $(shell \
-   if printf \
-   \#include libaio.h\n\
-   int main() \
-   { \
-   io_set_eventfd(NULL, 0); \
-   return 0; \
-   } | $(CC) -xc -laio -  /dev/null 21 ; \
-   then echo yes ; \
-   else echo no ; fi)
-
-HAS_LIBAIO = $(call check_header,libaio.h)
-HAS_LIBAIO_EVENTFD = $(call check_aio_eventfd)
-
-ifeq ($(HAS_LIBAIO_EVENTFD),yes)
-CFLAGS += -DHAS_AIO_EVENTFD
-LDLIBS += -laio
-endif
+LDLIBS += -L../../../../lib $(AIO_LIBS) -lltp
 
 SRCS= $(wildcard *.c)
 TARGETS = $(patsubst %.c, %, $(wildcard *.c))
 
 all: $(TARGETS)
-ifeq ($(HAS_LIBAIO),no)
-   @echo Note: Libaio is required for eventfd overflow testing.;
-else
-ifeq ($(HAS_LIBAIO_EVENTFD),no)
-   @echo Note: Eventfd support is required in libaio for overflow 
testing.;
-endif
-endif
 
 install:
@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
diff --git a/testcases/kernel/syscalls/eventfd/eventfd01.c 
b/testcases/kernel/syscalls/eventfd/eventfd01.c
index 4cf0bc4..2eac57d 100644
--- a/testcases/kernel/syscalls/eventfd/eventfd01.c
+++ b/testcases/kernel/syscalls/eventfd/eventfd01.c
@@ -44,6 +44,8 @@
  * None
  */
 
+#include config.h
+
 #include sys/select.h
 #include sys/signal.h
 #include sys/types.h
@@ -59,21 +61,27 @@
 #include usctest.h
 #include linux_syscall_numbers.h
 
-#ifdef HAS_AIO_EVENTFD
+#ifdef HAVE_LIBAIO_H
 #include libaio.h
 #endif
 
 static void setup(void);
 static void cleanup(void);
 
-char *TCID = eventfd01;
+TCID_DEFINE(eventfd01);
 int TST_TOTAL = 15;
 extern int Tst_count;
 
 static int
 myeventfd(unsigned int initval, int flags)
 {
-   return syscall(__NR_eventfd, initval);
+  /* eventfd2 uses FLAGS but 

[LTP] [PATCH] add tc parameter for block testsuite

2009-01-15 Thread Németh Márton
Add tc paramter for block testsuite which enables the testsuite
to run test cases separately. The default value of tc is 0 which
preserves the original behaviour and runs all the available test cases.

A user space shell script run.sh is also added which helps to run
the test cases in kernel space.

Signed-off-by: Márton Németh nm...@freemail.hu
diff -uprN ltp.orig/testcases/kernel/device-drivers/block/kernel_space/Makefile ltp/testcases/kernel/device-drivers/block/kernel_space/Makefile
--- ltp.orig/testcases/kernel/device-drivers/block/kernel_space/Makefile	2009-01-16 07:36:17.0 +0100
+++ ltp/testcases/kernel/device-drivers/block/kernel_space/Makefile	2009-01-16 07:29:16.0 +0100
@@ -13,6 +13,7 @@ modules:
 
 clean:
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) clean
+	rm -f modules.order
 
 help:
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) help
diff -uprN ltp.orig/testcases/kernel/device-drivers/block/kernel_space/run.sh ltp/testcases/kernel/device-drivers/block/kernel_space/run.sh
--- ltp.orig/testcases/kernel/device-drivers/block/kernel_space/run.sh	1970-01-01 01:00:00.0 +0100
+++ ltp/testcases/kernel/device-drivers/block/kernel_space/run.sh	2009-01-16 07:27:15.0 +0100
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# Tell the system to flush write buffers in order to minimize data loss in
+# case of a crash.
+sync
+
+echo Running Test Cases of block testsuite one by one.
+echo The test results are printed to dmesg.
+echo
+
+#
+# Valid test cases (should run stable)
+#
+echo Test Case 1
+insmod ./test_block.ko tc=1
+rmmod test_block
+
+echo Test Case 2
+insmod ./test_block.ko tc=2
+rmmod test_block
+
+echo Test Case 5
+insmod ./test_block.ko tc=5
+rmmod test_block
+
+#
+# Invalid testcases (more probable to crash the module under test)
+#
+echo Test Case 3
+insmod ./test_block.ko tc=3
+rmmod test_block
+
+echo Test Case 4
+insmod ./test_block.ko tc=4
+rmmod test_block
+
+echo Test Case 6
+insmod ./test_block.ko tc=6
+rmmod test_block
+
+echo Test Case 7
+insmod ./test_block.ko tc=7
+rmmod test_block
+
+echo Test Case 10
+insmod ./test_block.ko tc=10
+rmmod test_block
diff -uprN ltp.orig/testcases/kernel/device-drivers/block/kernel_space/test_block.c ltp/testcases/kernel/device-drivers/block/kernel_space/test_block.c
--- ltp.orig/testcases/kernel/device-drivers/block/kernel_space/test_block.c	2009-01-16 07:36:22.0 +0100
+++ ltp/testcases/kernel/device-drivers/block/kernel_space/test_block.c	2009-01-16 07:16:06.0 +0100
@@ -10,12 +10,21 @@
  *   3. insmod ./test_block.ko
  *   4. Check the test results in dmesg
  *   5. rmmod test_block
+ *
+ * Changes:
+ * 16 Jan 2009  0.2  Added tc parameter to run test cases separately
+ * 11 Jan 2009  0.1  First release
  */
 
 
 #include linux/module.h
 #include linux/fs.h
 
+static unsigned int __initdata tc;
+module_param_named(tc, tc, int, 0);
+MODULE_PARM_DESC(tc, Test Case to run. Default is 0 which means that run all tests.);
+
+
 MODULE_AUTHOR(Márton Németh nm...@freemail.hu);
 MODULE_DESCRIPTION(Test block drivers);
 MODULE_LICENSE(GPL);
@@ -249,15 +258,30 @@ static void tc10(void) {
 static int test_init_module(void)
 {
 	printk(KERN_INFO Starting test_block module\n);
-	tc01();
-	tc02();
-	tc03();
-	tc04();
-	tc05();
-	tc06();
-	tc07();
 
-	tc10();
+	if (tc == 0 || tc == 1)
+		tc01();
+
+	if (tc == 0 || tc == 2)
+		tc02();
+
+	if (tc == 0 || tc == 3)
+		tc03();
+
+	if (tc == 0 || tc == 4)
+		tc04();
+
+	if (tc == 0 || tc == 5)
+		tc05();
+
+	if (tc == 0 || tc == 6)
+		tc06();
+
+	if (tc == 0 || tc == 7)
+		tc07();
+
+	if (tc == 0 || tc == 10)
+		tc10();
 
 	return 0;
 }
--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] [PATCH] sched_cli_serv: client: connect failure, no = 111

2009-01-15 Thread CAI Qian
Hi,

Sometimes, sched_cli_serv test case can still fail due to,

client: connect failure, no = 111

This is because when the system is under load, the client may connect
before the server is ready. This patch fixes it by letting the server
run for 10 seconds first.

Signed-off-by: CAI Qian caiq...@cclom.cn

--- ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh.orig   
2009-01-16 11:12:49.821546689 +0800
+++ ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh
2009-01-16 11:13:18.935562956 +0800
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 pthserv 
+sleep 10
 pthcli 127.0.0.1 $LTPROOT/testcases/bin/data
 clientCode=$?
 killall pthserv

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


[LTP] [PATCH] sched_cli_serv: client: connect failure, no = 111 v2

2009-01-15 Thread CAI Qian
Hi,

Sometimes, sched_cli_serv test case can still fail due to,

client: connect failure, no = 111

This is because when the system is under load, the client may connect
before the server is ready. This patch fixes it by letting the server
run for 10 seconds first. It also disable shell command tracing by
default which was accidentally introduced by the last patch,

http://article.gmane.org/gmane.linux.ltp/7149

Signed-off-by: CAI Qian caiq...@cclom.cn

--- ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh.orig   
2009-01-16 11:12:49.821546689 +0800
+++ ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh
2009-01-16 11:13:18.935562956 +0800
@@ -1,6 +1,7 @@
-#!/bin/sh -x
+#!/bin/sh
 
 pthserv 
+sleep 10
 pthcli 127.0.0.1 $LTPROOT/testcases/bin/data
 clientCode=$?
 killall pthserv

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list


Re: [LTP] [PATCH] sched_cli_serv: client: connect failure, no = 111 v2

2009-01-15 Thread Garrett Cooper
On Thu, Jan 15, 2009 at 11:25 PM, CAI Qian caiq...@cclom.cn wrote:
 Hi,

 Sometimes, sched_cli_serv test case can still fail due to,

 client: connect failure, no = 111

 This is because when the system is under load, the client may connect
 before the server is ready. This patch fixes it by letting the server
 run for 10 seconds first. It also disable shell command tracing by
 default which was accidentally introduced by the last patch,

 http://article.gmane.org/gmane.linux.ltp/7149

 Signed-off-by: CAI Qian caiq...@cclom.cn

 --- ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh.orig 
   2009-01-16 11:12:49.821546689 +0800
 +++ ltp-full-20081031/testcases/kernel/sched/clisrv/run_sched_cliserv.sh  
   2009-01-16 11:13:18.935562956 +0800
 @@ -1,6 +1,7 @@
 -#!/bin/sh -x
 +#!/bin/sh

  pthserv 
 +sleep 10
  pthcli 127.0.0.1 $LTPROOT/testcases/bin/data
  clientCode=$?
  killall pthserv

Sorry for interjecting, but I don't like hacks like this; there are
some bad decisions like this that occur in my everyday work, and in
order to make everything magically work the timeout keeps on growing,
instead of the components working together with some level of
cohesion. A better idea: make pthserv and pthcli more forgiving in
terms of timeouts in their respective codebases, so that they're more
robust when it comes to latency issues when connecting.

Should be simple to implement -- add a counter and a loop / condition
at the top of a loop to wait for the connection to occur or fail.

If you want I'll write up the required changes in C.

Cheers,
-Garrett

--
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
___
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list