All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP
@ 2009-05-18 19:09 Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 01/21] Add add_key01 test for add_key syscall Manas Kumar Nayak
                   ` (21 more replies)
  0 siblings, 22 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:09 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Hi,

I have ported the following tests from Crackerjack to LTP.
Kindly include them to LTP:

[PATCH 01/21] Add add_key01 test for add_key syscall
[PATCH 02/21] Add add_key02 test for add_key syscall
[PATCH 03/21] Add bdflush01 test for bdflush syscall
[PATCH 04/21] Add exit_group01 test for exit_group syscall
[PATCH 05/21] Add keyctl01 test for keyctl syscall
[PATCH 06/21] Add newuname01 test for newuname syscall
[PATCH 07/21] Add rt_sigaction01 test for rt_sigaction syscall
[PATCH 08/21] Add rt_sigprocmask01 test for rt_sigprocmask syscall
[PATCH 09/21] Add rt_sigprocmask02 test for rt_sigprocmask syscall
[PATCH 10/21] Add rt_sigqueueinfo01 test for rt_sigqueueinfo syscall
[PATCH 11/21] Add rt_sigsuspend01 test for rt_sigsuspend syscall
[PATCH 12/21] Add set_thread_area01 test for set_thread_area syscall
[PATCH 13/21] Add set_thread_area02 test for set_thread_area syscall
[PATCH 14/21] Add set_tid_address01 test for set_tid_address syscall
[PATCH 15/21] Add sgetmask01 test for sgetmask syscall
[PATCH 16/21] Add sigreturn01 test for sigreturn syscall
[PATCH 17/21] Add ssetmask01 test for ssetmask syscall
[PATCH 18/21] Add timer_getoverrun01 test for timer_getoverrun01 syscall
[PATCH 19/21] Add timer_gettime01 test for timer_gettime syscall
[PATCH 20/21] Add tkill01 test for tkill syscall
[PATCH 21/21] Add tkill02 test for tkill syscall

Todo:
	1) Port the Remaining ones (next week),

Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 01/21] Add add_key01 test for add_key syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
@ 2009-05-18 19:09 ` Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 02/21] Add add_key02 " Manas Kumar Nayak
                   ` (20 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:09 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/add_key/add_key01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/add_key/add_key01.c	2009-05-18 18:19:45.000000000 +0530
@@ -0,0 +1,142 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        add_key01.c                                           */
+/*                                                                            */
+/* Description: This tests the add_key() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* add_key01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   add_key01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <linux/keyctl.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "add_key01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        int result;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     TEST(result = syscall(286, "keyring", "wjkey", NULL, 0, KEY_SPEC_THREAD_KEYRING));     //call add_key()
+                     if(TEST_RETURN != -1) {
+        		tst_resm(TPASS, "add_key call succeeded");
+                        cleanup();
+                     }
+                     else {
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+	  	           tst_exit();
+                     }
+                }
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/add_key/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/add_key/Makefile	2009-05-18 18:20:35.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 16:42:10.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 18:22:32.000000000 +0530
@@ -13,6 +13,8 @@ access05 access05
 acct01 acct01
 acct02 acct02
 
+add_key01 add_key01
+
 adjtimex01 adjtimex01
 adjtimex02 adjtimex02
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 02/21] Add add_key02 test for add_key syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 01/21] Add add_key01 test for add_key syscall Manas Kumar Nayak
@ 2009-05-18 19:09 ` Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 03/21] Add bdflush01 test for bdflush syscall Manas Kumar Nayak
                   ` (19 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:09 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/add_key/add_key02.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/add_key/add_key02.c	2009-05-18 18:43:42.000000000 +0530
@@ -0,0 +1,173 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        add_key02.c                                           */
+/*                                                                            */
+/* Description: This tests the add_key() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* add_key02 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   add_key02                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <linux/keyctl.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "add_key02";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+struct test_case_t {
+        char *type;
+        char *desc;
+        void *payload;
+        int plen;
+        int exp_errno;
+} test_cases[] = {
+        { "user", "firstkey", NULL, 1, EINVAL }
+};
+
+int test_count = sizeof(test_cases) / sizeof(struct test_case_t);
+
+
+int main(int ac, char **av) {
+	int i, succeed=0, fail=0;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+
+		for(i=0; i<test_count; i++) {
+                	TEST(syscall(286, test_cases[i].type, test_cases[i].desc, test_cases[i].payload, test_cases[i].plen, KEY_SPEC_USER_KEYRING));    //call add_key()
+                	if(TEST_RETURN != -1){
+                        	tst_resm(TINFO,"call add_key() with wrong args succeed, but should fail");
+                        	fail++;
+                	}else{
+	                        if(errno == test_cases[i].exp_errno){
+	                                tst_resm(TINFO,"call add_key() with wrong args got EXPECTED errno:%d", TEST_ERRNO);
+	                                succeed++;
+	                        }else{
+	                                tst_resm(TINFO,"call add_key() with wrong args got UNEXPECTED errno:%d", TEST_ERRNO);
+	                                fail++;
+				}
+                        }
+
+                }
+        
+		 if(fail != 0){
+                 	tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                        cleanup();
+	  	        tst_exit();
+	        } else {
+        		tst_resm(TPASS, "add_key call succeeded");
+                        cleanup();
+	        }
+
+
+           }
+      }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 18:35:12.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 18:44:42.000000000 +0530
@@ -14,6 +14,7 @@ acct01 acct01
 acct02 acct02
 
 add_key01 add_key01
+add_key02 add_key02
 
 adjtimex01 adjtimex01
 adjtimex02 adjtimex02

---
Regards--
Manas

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 03/21] Add bdflush01 test for bdflush syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 01/21] Add add_key01 test for add_key syscall Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 02/21] Add add_key02 " Manas Kumar Nayak
@ 2009-05-18 19:09 ` Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 04/21] Add exit_group01 test for exit_group syscall Manas Kumar Nayak
                   ` (18 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:09 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/bdflush/bdflush01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/bdflush/bdflush01.c	2009-05-18 18:56:35.000000000 +0530
@@ -0,0 +1,208 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        bdflush01.c                                            */
+/*                                                                            */
+/* Description: bdflush() starts, flushes, or tunes the buffer-dirty-flush    */
+/*		daemon. Only a privileged process (one with the CAP_SYS_ADMIN */
+/*		capability) may call bdflush().				      */
+/*									      */
+/*		If func is negative or 0, and no daemon has been started,     */
+/*	        then bdflush() enters the daemon code and never returns.      */	
+/*									      */	
+/*		If func is 1, some dirty buffers are written to disk.	      */
+/*		If func is 2 or more and is even (low bit is 0), then address */
+/*		is the address of a long word, and the tuning parameter       */
+/*		numbered (func-2)/2 is returned to the caller in that address.*/
+/*									      */	
+/*		If func is 3 or more and is odd (low bit is 1), then data is  */ 
+/*		a long word, and the kernel sets tuning parameter numbered    */
+/*		(func-3)/2 to that value.				      */
+/*		    							      */
+/*		The set of parameters, their values, and their legal ranges   */
+/*		are defined in the kernel source file fs/buffer.c. 	      */
+/*									      */
+/*		Return Value:						      */
+/*		If func is negative or 0 and the daemon successfully starts,  */
+/*		bdflush() never returns. Otherwise, the return value is 0 on  */
+/*		success and -1 on failure, with errno set to indicate the     */
+/*		error.							      */	
+/*									      */	
+/*		Errors:							      */
+/*			EBUSY						      */
+/*			    An attempt was made to enter the daemon code after*/ 
+/*			    another process has already entered. 	      */
+/*			EFAULT						      */
+/*			   address points outside your accessible address     */
+/*			   space. 					      */	
+/*			EINVAL						      */
+/*			    An attempt was made to read or write an invalid   */
+/*			    parameter number, or to write an invalid value to */
+/*			    a parameter. 				      */
+/*			EPERM						      */		
+/*			    Caller does not have the CAP_SYS_ADMIN capability.*/
+/*									      */
+/* Usage:  <for command-line>                                                 */
+/* bdflush01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                      */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   bdflush01                                              */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/kdaemon.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "bdflush01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int errnochoose(void)   //choose the relative errno
+{
+    switch errno
+    {
+        case    EFAULT: perror("EFAULT");
+            break;
+        case    EINVAL: perror("EINVAL");
+            break;
+        case    EPERM:  perror("EPERM");
+            break;
+        case    EBUSY:  perror("EBUSY");
+            break;
+        default:        perror("Other Error");
+            break;
+    }
+    TEST_ERRNO=0;
+    return 0 ;
+}
+
+
+
+int main(int ac, char **av) {
+	long data;
+	int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+			TEST(syscall(134,0,data));	//bdflush(0,data);
+			if(TEST_RETURN < 0){
+				tst_resm(TFAIL,"Call to bdflush() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+			}else {
+				tst_resm(TPASS,"Test PASSED and %d is returned \n",TEST_RETURN);
+				tst_resm(TINFO,"bdflush() activated...\n");
+                        	cleanup();
+				tst_exit();
+		        }
+
+	
+                }
+	Tst_count++;
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/bdflush/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/bdflush/Makefile	2009-05-18 14:25:03.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 18:48:57.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 18:57:42.000000000 +0530
@@ -31,6 +31,8 @@ asyncio02 asyncio02
 bind01 bind01
 bind02 bind02
 
+bdflush01 bdflush01
+
 brk01 brk01
 
 capget01 capget01

---
Regards--
Manas

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 04/21] Add exit_group01 test for exit_group syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (2 preceding siblings ...)
  2009-05-18 19:09 ` [LTP] [PATCH 03/21] Add bdflush01 test for bdflush syscall Manas Kumar Nayak
@ 2009-05-18 19:09 ` Manas Kumar Nayak
  2009-05-18 19:09 ` [LTP] [PATCH 05/21] Add keyctl01 test for keyctl syscall Manas Kumar Nayak
                   ` (17 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:09 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/exit_group/exit_group01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/exit_group/exit_group01.c	2009-05-18 19:09:04.000000000 +0530
@@ -0,0 +1,156 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        exit_group01.c                                           */
+/*                                                                            */
+/* Description: This tests the exit_group() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* exit_group01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   exit_group01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <linux/unistd.h>
+#include <sys/wait.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "exit_group01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        int status;
+        pid_t cpid, w;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     
+		     TEST(cpid = fork());     //call exit_group()
+                     if(TEST_RETURN == -1) {
+        			tst_resm(TFAIL, "fork() error ...errno %d",TEST_ERRNO);
+                        	cleanup();
+				tst_exit();
+                     } else if (TEST_RETURN == 0){
+	                 	tst_resm(TINFO, "In the child process");
+                           	sleep(5);
+				TEST(syscall(252,4));
+                     }else {
+				tst_resm(TINFO,"in the parent process");
+				TEST(w = wait(&status));
+				if(WIFEXITED(status) && (WEXITSTATUS(status) == 4)) {
+		                       tst_resm(TPASS,"exit_group call Succeed");
+		                        cleanup();
+		                }
+			  }
+			tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                        cleanup();
+                        tst_exit();
+
+                }
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/exit_group/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/exit_group/Makefile	2009-04-05 01:49:46.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 19:03:25.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 19:16:03.000000000 +0530
@@ -141,6 +141,8 @@ execvp01 execvp01
 exit01 exit01
 exit02 exit02
 
+exit_group01 exit_group01
+
 #faccessat test cases
 faccessat01 faccessat01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 05/21] Add keyctl01 test for keyctl syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (3 preceding siblings ...)
  2009-05-18 19:09 ` [LTP] [PATCH 04/21] Add exit_group01 test for exit_group syscall Manas Kumar Nayak
@ 2009-05-18 19:09 ` Manas Kumar Nayak
  2009-05-18 19:10 ` [LTP] [PATCH 06/21] Add newuname01 test for newuname syscall Manas Kumar Nayak
                   ` (16 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:09 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/keyctl/keyctl01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/keyctl/keyctl01.c	2009-05-18 19:27:10.000000000 +0530
@@ -0,0 +1,161 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        keyctl01.c                                   		      */
+/*                                                                            */
+/* Description: This tests the keyctl() syscall                		      */
+/*		Manipulate the kernel's key management facility               */
+/* Usage:  <for command-line>                                                 */
+/* keyctl01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     	      */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 2                                                             */
+/*                                                                            */
+/* Test Name:   keyctl01                                             	      */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <linux/keyctl.h>
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "keyctl01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+	int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     TEST(syscall(258, KEYCTL_GET_KEYRING_ID, KEY_SPEC_USER_SESSION_KEYRING));    //call keyctl() and Ask for a keyring's ID
+                     if(TEST_RETURN != -1) {
+        		tst_resm(TPASS,"KEYCTL_GET_KEYRING_ID succeed");
+                     /*   cleanup(); */
+                     }
+                     else {
+                 	   tst_resm(TFAIL, "(%s failed) KEYCTL_GET_KEYRING_ID fail with - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+	  	           tst_exit();
+                     }
+
+
+		     TEST(syscall(288, KEYCTL_REVOKE, "MyKey"));    //call keyctl()
+                     if(TEST_RETURN != -1) {
+                        tst_resm(TFAIL,"KEYTL_REVOKE succeededs, but should fail");
+                        cleanup();
+			tst_exit();
+                     }
+                     else {
+				if(TEST_ERRNO == ENOKEY)	//Check for correct error no.	
+								//if no  matching key was found or an invalid key was specified. 
+                           	{
+					tst_resm(TPASS,"KEYCTL_REVOKE got expected errno:%ld",TEST_ERRNO);
+                        		cleanup();
+				}else{
+					tst_resm(TFAIL,"KEYCTL_REVOKE got unexpected errno:%ld", TEST_ERRNO);
+                        		cleanup();
+					tst_exit();
+				}
+                     }
+
+                }
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/keyctl/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/keyctl/Makefile	2009-03-29 15:56:15.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 19:22:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 19:28:35.000000000 +0530
@@ -444,6 +444,8 @@ io_getevents01 run-io_getevents.sh
 io_setup01 run-io_setup.sh
 io_submit01 run-io_submit.sh
 
+keyctl01 keyctl01
+
 kill01 kill01
 kill02 kill02
 kill03 kill03

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 06/21] Add newuname01 test for newuname syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (4 preceding siblings ...)
  2009-05-18 19:09 ` [LTP] [PATCH 05/21] Add keyctl01 test for keyctl syscall Manas Kumar Nayak
@ 2009-05-18 19:10 ` Manas Kumar Nayak
  2009-05-18 19:10 ` [LTP] [PATCH 07/21] Add rt_sigaction01 test for rt_sigaction syscall Manas Kumar Nayak
                   ` (15 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:10 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/newuname/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/newuname/Makefile	2009-03-31 23:25:17.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/newuname/newuname01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/newuname/newuname01.c	2009-05-18 19:39:19.000000000 +0530
@@ -0,0 +1,161 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        newuname01.c                                           */
+/*                                                                            */
+/* Description: This tests the newuname() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* newuname01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   newuname01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <unistd.h>
+#include <sys/utsname.h>
+#include <errno.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "newuname01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        struct utsname name;
+	int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     TEST(syscall(122,&name));     //call newuname()
+                     if(TEST_RETURN == -1) {
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+	  	           tst_exit();
+                     }else {
+	   		tst_resm(TPASS, "newuname call succeed: return value = %d ",TEST_RETURN);
+			TEST(strcmp(name.sysname,"Linux")); //Linux ?
+			if(TEST_RETURN == 0){
+				tst_resm(TINFO,"This system is %s",name.sysname);
+				tst_resm(TINFO,"The system infomation is :");
+				tst_resm(TINFO,"System is %s on %s hardware",name.sysname,name.machine);
+
+				tst_resm(TINFO,"Nodename is %s",name.nodename);
+				tst_resm(TINFO,"Version is %s, %s",name.release,name.version);
+				tst_resm(TINFO,"Domainname is %s ",*(&name.machine+1));
+                           	cleanup();
+	  	           	tst_exit();
+	                }else{
+                 	  	tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+			   	tst_resm(TINFO,"This system is not Linux");
+                           	cleanup();
+	  	           	tst_exit();
+			}
+				
+     		   }	
+        
+	}
+     }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 19:34:55.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 19:41:46.000000000 +0530
@@ -670,6 +670,8 @@ madvise01 madvise01
 madvise02 madvise02
 madvise03 madvise03
 
+newuname01 newuname01
+
 pathconf01 pathconf01
 
 pause01 pause01

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 07/21] Add rt_sigaction01 test for rt_sigaction syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (5 preceding siblings ...)
  2009-05-18 19:10 ` [LTP] [PATCH 06/21] Add newuname01 test for newuname syscall Manas Kumar Nayak
@ 2009-05-18 19:10 ` Manas Kumar Nayak
  2009-05-18 19:10 ` [LTP] [PATCH 08/21] Add rt_sigprocmask01 test for rt_sigprocmask syscall Manas Kumar Nayak
                   ` (14 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:10 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigaction/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigaction/Makefile	2009-05-18 14:24:27.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall -O2 -W
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c	2009-05-18 20:11:35.000000000 +0530
@@ -0,0 +1,208 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        rt_sigaction01.c                                              */
+/*                                                                            */
+/* Description: This tests the rt_sigaction() syscall                         */
+/*		rt_sigaction alters an action taken by a process on receipt   */
+/* 		of a particular signal. The action is specified by the        */
+/*		sigaction structure. The previous action on the signal is     */
+/*		saved in oact.sigsetsize should indicate the size of a        */
+/*		sigset_t type.                       			      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* rt_sigaction01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                        */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   rt_sigaction01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <errno.h>
+#include <sys/syscall.h>
+#include <string.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "rt_sigaction01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int test_flags[] = {SA_RESETHAND|SA_SIGINFO, SA_RESETHAND, SA_RESETHAND|SA_SIGINFO, SA_RESETHAND|SA_SIGINFO, SA_NOMASK};
+
+void
+handler(int sig)
+{
+        tst_resm(TINFO,"Here is signal handler. Got signal: %d, do nothing here\n", sig);
+        return;
+}
+
+int
+set_handler(int sig, int sig_to_mask, int flag, int mask_flags)
+{
+        struct sigaction sa, oldaction;
+        int err = 0;
+
+        if (flag == 0) {
+                tst_resm(TINFO,"flag0 - ");
+                sa.sa_sigaction = (void *)handler;
+                sa.sa_flags = mask_flags;
+                TEST(sigemptyset(&sa.sa_mask));
+                TEST(sigaddset(&sa.sa_mask, sig_to_mask));
+                TEST(err = syscall(__NR_rt_sigaction,sig, &sa, NULL,8));
+        } else if (flag == 1) {
+                tst_resm(TINFO,"flag1 - ");
+                TEST(err = syscall(__NR_rt_sigaction,sig, (void *)-1, NULL,8));
+        } else if (flag == 2) {
+               	tst_resm(TINFO,"flag2 - ");
+                TEST(err = syscall(__NR_rt_sigaction,sig, NULL, (void *)-1,8));
+	} else if (flag == 3) {
+                tst_resm(TINFO,"flag3 - ");
+                sa.sa_sigaction = (void *)handler;
+                sa.sa_flags = mask_flags;
+                TEST(sigemptyset(&sa.sa_mask));
+                TEST(sigaddset(&sa.sa_mask, sig_to_mask));
+                TEST(err = syscall(__NR_rt_sigaction,sig, &sa, &oldaction, 8));
+                if (TEST_RETURN == 0) {
+                        return 0;
+                } else {
+                        return TEST_ERRNO;
+                }
+        } else if (flag == 4){
+                        TEST(err = syscall(__NR_rt_sigaction,sig, &sa, NULL,9));
+        }
+        if (TEST_RETURN == 0) {
+                return 0;
+        } else {
+                return TEST_ERRNO;
+        }
+}
+
+
+int main(int ac, char **av) {
+	int retnval, i, j;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                
+			for (i = 0; i <= (SIGRTMAX + 1); i++){//signal for 0 to 65 
+	    			tst_resm(TINFO,"Signal : %d",i);
+			                for (j = 0; j < 4; j++){
+			                       	 TEST(retnval = set_handler(i, 0, j, test_flags[j]));
+						 if (TEST_RETURN == 0) {
+        						tst_resm(TPASS, "rt_sigaction call succeeded: result = %d",TEST_RETURN);
+			                         } else {
+                 	   				tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+							cleanup();
+							tst_exit();
+                       				}
+                			}
+        		}
+
+
+
+                }
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 19:48:56.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 20:17:24.000000000 +0530
@@ -786,6 +786,8 @@ rmdir03A symlink01 -T rmdir03
 rmdir04 rmdir04
 rmdir05 rmdir05
 
+rt_sigaction01 rt_sigaction01
+
 sbrk01 sbrk01
 
 sched_get_priority_max01 sched_get_priority_max01

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 08/21] Add rt_sigprocmask01 test for rt_sigprocmask syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (6 preceding siblings ...)
  2009-05-18 19:10 ` [LTP] [PATCH 07/21] Add rt_sigaction01 test for rt_sigaction syscall Manas Kumar Nayak
@ 2009-05-18 19:10 ` Manas Kumar Nayak
  2009-05-18 19:10 ` [LTP] [PATCH 09/21] Add rt_sigprocmask02 " Manas Kumar Nayak
                   ` (13 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:10 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigprocmask/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigprocmask/Makefile	2009-05-18 20:26:18.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c	2009-05-18 20:27:40.000000000 +0530
@@ -0,0 +1,233 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        rt_sigprocmask01.c                                              */
+/*                                                                            */
+/* Description: This tests the rt_sigprocmask() syscall                       */
+/*		rt_sigprocmask changes the list of currently blocked signals. */
+/*		The set value stores the signal mask of the pending signals.  */
+/*		The previous action on the signal is saved in oact. The value */
+/*		of how indicates how the call should behave; its values are   */
+/*		as follows:						      */
+/*									      */
+/*		SIG_BLOCK						      */
+/*		    The set of blocked signals is the union of the current set*/ 
+/*		    and the set argument. 				      */
+/*		SIG_UNBLOCK						      */
+/*		    The signals in set are removed from the current set of    */
+/*		    blocked signals. It is okay to unblock a signal that is   */
+/*		    not blocked. 					      */
+/*		SIG_SETMASK						      */
+/*		    The set of blocked signals is set to the set argument.    */
+/*		    sigsetsize should indicate the size of a sigset_t type.   */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* rt_sigprocmask01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                      */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   rt_sigprocmask01                                              */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <stdio.h>
+#include <signal.h>
+#include <errno.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "rt_sigprocmask01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 8;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int sig_count = 0;
+
+void sig_handler(int sig)
+{
+        sig_count++;
+}
+
+int main(int ac, char **av) {
+	struct sigaction act, oact;
+        sigset_t set, oset;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+			TEST(sigemptyset(&set));
+			if(TEST_RETURN == -1){
+				tst_resm(TFAIL,"Call to sigemptyset() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+			}
+			TEST(sigaddset(&set, 33));
+			if(TEST_RETURN == -1){
+				tst_resm(TFAIL,"Call to sigaddset() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+			}
+			
+			/* call rt_sigaction() */
+			act.sa_handler = sig_handler;
+                        TEST(syscall(174, 33, &act, &oact, 8));
+			if(TEST_RETURN != 0){
+				tst_resm(TFAIL,"Call to rt_sigaction() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+			}
+			/* call rt_sigprocmask() to block signal#33 */
+                        TEST(syscall(175, SIG_BLOCK, &set, &oset, 8));
+			if(TEST_RETURN == -1){
+				tst_resm(TFAIL,"Call to rt_sigprocmask()**** Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+			}
+			
+			else {
+				TEST(kill(getpid(), 33));
+				if(TEST_RETURN != 0){
+					tst_resm(TFAIL,"Call to kill() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        		cleanup();
+					tst_exit();
+					
+				}
+				if(sig_count){
+					tst_resm(TFAIL,"FAIL --- rt_sigprocmask() fail to change the process's signal mask, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        		cleanup();
+					tst_exit();
+				}
+				else {
+					/* call rt_sigpending() */
+					TEST(syscall(176, &oset, 8));
+					if(TEST_RETURN == -1){
+						tst_resm(TFAIL,"call rt_sigpending() failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        			cleanup();
+						tst_exit();
+					}
+					TEST(sigismember(&oset, 33));
+					if(TEST_RETURN == 0 ){
+						tst_resm(TFAIL,"call sigismember() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        			cleanup();
+						tst_exit();
+					}
+					/* call rt_sigprocmask() to unblock signal#33 */
+					TEST(syscall(175, SIG_UNBLOCK, &set, &oset, 8));
+					if(TEST_RETURN == -1){
+						tst_resm(TFAIL,"Call to rt_sigprocmask() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        			cleanup();
+						tst_exit();
+					}
+					if(sig_count) {
+						tst_resm(TPASS,"rt_sigprocmask() PASSED");
+                        			cleanup();
+						tst_exit();
+					}
+		                        else {
+						tst_resm(TFAIL,"rt_sigprocmask() functionality failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+		                                cleanup();
+						tst_exit();
+		                        }
+
+				}
+			}
+
+                }
+	Tst_count++;
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 20:21:15.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 20:28:40.000000000 +0530
@@ -787,6 +787,7 @@ rmdir04 rmdir04
 rmdir05 rmdir05
 
 rt_sigaction01 rt_sigaction01
+rt_sigprocmask01 rt_sigprocmask01
 
 sbrk01 sbrk01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 09/21] Add rt_sigprocmask02 test for rt_sigprocmask syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (7 preceding siblings ...)
  2009-05-18 19:10 ` [LTP] [PATCH 08/21] Add rt_sigprocmask01 test for rt_sigprocmask syscall Manas Kumar Nayak
@ 2009-05-18 19:10 ` Manas Kumar Nayak
  2009-05-18 19:10 ` [LTP] [PATCH 10/21] Add rt_sigqueueinfo01 test for rt_sigqueueinfo syscall Manas Kumar Nayak
                   ` (12 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:10 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c	2009-05-18 20:40:59.000000000 +0530
@@ -0,0 +1,213 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        rt_sigprocmask02.c                                              */
+/*                                                                            */
+/* Description: This tests the rt_sigprocmask() syscall                       */
+/*		rt_sigprocmask changes the list of currently blocked signals. */
+/*		The set value stores the signal mask of the pending signals.  */
+/*		The previous action on the signal is saved in oact. The value */
+/*		of how indicates how the call should behave; its values are   */
+/*		as follows:						      */
+/*									      */
+/*		SIG_BLOCK						      */
+/*		    The set of blocked signals is the union of the current set*/ 
+/*		    and the set argument. 				      */
+/*		SIG_UNBLOCK						      */
+/*		    The signals in set are removed from the current set of    */
+/*		    blocked signals. It is okay to unblock a signal that is   */
+/*		    not blocked. 					      */
+/*		SIG_SETMASK						      */
+/*		    The set of blocked signals is set to the set argument.    */
+/*		    sigsetsize should indicate the size of a sigset_t type.   */
+/* 									      */	
+/* 		RETURN VALUE:i						      */
+/* 		rt_sigprocmask returns 0 on success; otherwise, rt_sigprocmask*/ 
+/* 		returns one of the errors listed in the "Errors" section.     */
+/* 									      */
+/* 		Errors:							      */
+/* 			-EINVAL						      */	
+/* 			    sigsetsize was not equivalent to the size of a    */
+/* 			    sigset_t type or the value specified in how was   */
+/* 			    invalid. 					      */
+/* 			-EFAULT						      */
+/* 			    An invalid set, act, or oact was specified.       */
+/*                                                                            */
+/*									      */
+/* Usage:  <for command-line>                                                 */
+/* rt_sigprocmask02 [-c n] [-e][-i n] [-I x] [-p x] [-t]                      */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   rt_sigprocmask02                                              */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <stdio.h>
+#include <signal.h>
+#include <errno.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "rt_sigprocmask02";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+sigset_t set;
+
+struct test_case_t {
+        sigset_t *ss;
+        int sssize;
+        int exp_errno;
+} test_cases[] = {
+        { &set, 1, EINVAL },
+        { (sigset_t *)-1, 8, EFAULT }
+};
+
+int test_count = sizeof(test_cases) / sizeof(struct test_case_t);
+
+int main(int ac, char **av) {
+	int i, succeed=0, fail=0;
+        sigset_t s;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+			TEST(sigfillset(&s));
+			if(TEST_RETURN == -1){
+				tst_resm(TFAIL,"Call to sigfillset() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+			}
+
+			for(i=0; i<test_count; i++)
+		        {
+				TEST(syscall(175, SIG_BLOCK, &s, test_cases[i].ss, test_cases[i].sssize));
+				if(TEST_RETURN == 0){
+					tst_resm(TFAIL,"Call to rt_sigprocmask()succeeded,but should failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+					fail++;
+				}
+				else {
+					if(TEST_ERRNO == test_cases[i].exp_errno) {
+						tst_resm(TINFO,"got expected errno:%d", TEST_ERRNO);
+		                                succeed++;
+		                        }
+		                        else {
+		                                tst_resm(TINFO,"got unexpected errno:%d", TEST_ERRNO);
+                                		fail++;
+		                        }
+		                }
+		        }
+
+			if(fail != 0) {
+				tst_resm(TFAIL,"Test Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+		        }
+		        else {
+				tst_resm(TPASS,"Test PASSED");
+                        	cleanup();
+				tst_exit();
+		        }
+
+	
+                }
+	Tst_count++;
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 20:32:04.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 20:42:26.000000000 +0530
@@ -788,6 +788,7 @@ rmdir05 rmdir05
 
 rt_sigaction01 rt_sigaction01
 rt_sigprocmask01 rt_sigprocmask01
+rt_sigprocmask02 rt_sigprocmask02
 
 sbrk01 sbrk01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 10/21] Add rt_sigqueueinfo01 test for rt_sigqueueinfo syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (8 preceding siblings ...)
  2009-05-18 19:10 ` [LTP] [PATCH 09/21] Add rt_sigprocmask02 " Manas Kumar Nayak
@ 2009-05-18 19:10 ` Manas Kumar Nayak
  2009-05-18 19:10 ` [LTP] [PATCH 11/21] Add rt_sigsuspend01 test for rt_sigsuspend syscall Manas Kumar Nayak
                   ` (11 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:10 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigqueueinfo/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigqueueinfo/Makefile	2009-05-18 14:25:30.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c	2009-05-18 21:18:37.000000000 +0530
@@ -0,0 +1,179 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        rt_sigqueueinfo01.c                                           */
+/*                                                                            */
+/* Description: This tests the rt_sigqueueinfo() syscall.                     */
+/*		rt_sigqueueinfo() Send signal information to a signal	      */
+/*									      */
+/* Usage:  <for command-line>                                                 */
+/* rt_sigqueueinfo01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 2                                                             */
+/*                                                                            */
+/* Test Name:   rt_sigqueueinfo01                                              */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <stdio.h>
+#include <signal.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+#include <string.h>
+
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "rt_sigqueueinfo01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+
+int main(int ac, char **av) {
+	int pid, retval;
+        pid = getpid();
+        siginfo_t uinfo;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+			TEST(pid = fork());
+		        if(TEST_RETURN < 0){
+				tst_resm(TFAIL,"fork() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                        	cleanup();
+				tst_exit();
+		        } else if (TEST_RETURN == 0){
+				  uinfo.si_errno = 0;
+			          uinfo.si_code = -1;
+		                  TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17, &uinfo));
+				   if(TEST_RETURN == 0){
+					tst_resm(TPASS,"Test Succeeded");
+					tst_exit();
+			          } else {
+					tst_resm(TFAIL,"Test Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+	                        	cleanup();
+					tst_exit();
+		                    }
+		        }
+
+			TEST(pid = fork());
+                        if(TEST_RETURN < 0){
+                                tst_resm(TFAIL,"fork() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                                cleanup();
+                                tst_exit();
+                        } else if (TEST_RETURN == 0){
+                                  uinfo.si_errno = 0;
+                                  uinfo.si_code = 0;
+                                  TEST(retval = syscall(__NR_rt_sigqueueinfo, getpid(), 17, &uinfo));
+                                   if(TEST_RETURN == 0){
+                                        tst_resm(TPASS,"Test Succeeded");
+                                        tst_exit();
+                                  } else {
+                                        tst_resm(TFAIL,"Test Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+                                        cleanup();
+                                        tst_exit();
+                                    }
+                        }
+
+                }
+	Tst_count++;
+        }	
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 20:46:35.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 21:19:25.000000000 +0530
@@ -789,6 +789,7 @@ rmdir05 rmdir05
 rt_sigaction01 rt_sigaction01
 rt_sigprocmask01 rt_sigprocmask01
 rt_sigprocmask02 rt_sigprocmask02
+rt_sigqueueinfo01 rt_sigqueueinfo01
 
 sbrk01 sbrk01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 11/21] Add rt_sigsuspend01 test for rt_sigsuspend syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (9 preceding siblings ...)
  2009-05-18 19:10 ` [LTP] [PATCH 10/21] Add rt_sigqueueinfo01 test for rt_sigqueueinfo syscall Manas Kumar Nayak
@ 2009-05-18 19:10 ` Manas Kumar Nayak
  2009-05-18 19:11 ` [LTP] [PATCH 12/21] Add set_thread_area01 test for set_thread_area syscall Manas Kumar Nayak
                   ` (10 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:10 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigsuspend/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigsuspend/Makefile	2009-05-18 14:26:03.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall -g
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c	2009-05-18 21:32:36.000000000 +0530
@@ -0,0 +1,187 @@
+/********************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   	*/
+/*                                                                            	*/
+/* 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    	*/
+/*                                                                            	*/
+/******************************************************************************	*/
+/******************************************************************************	*/
+/*                                                                            	*/
+/* File:        rt_sigsuspend01.c                                           	      	*/
+/*                                                                            	*/
+/* Description: This tests the rt_sigsuspend() syscall.                      	      	*/
+/*		                                                               	*/
+/* Usage:  <for command-line>                                                 	*/
+/* rt_sigsuspend01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     		*/
+/*      where,  -c n : Run n copies concurrently.                             	*/
+/*              -e   : Turn on errno logging.                                 	*/
+/*              -i n : Execute test n times.                                  	*/
+/*              -I x : Execute test for x seconds.                            	*/
+/*              -P x : Pause for x seconds between iterations.                	*/
+/*              -t   : Turn on syscall timing.                                	*/
+/*                                                                            	*/
+/* Total Tests: 2                                                             	*/
+/*                                                                            	*/
+/* Test Name:   rt_sigsuspend01                                             		*/
+/* History:     Porting from Crackerjack to LTP is done by                    	*/
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        	*/
+/********************************************************************************/
+
+#include <stdio.h>
+#include <signal.h>
+#include <errno.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "rt_sigsuspend01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL =4;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate TEST_RETURNurn code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' TEST_RETURNurn code.   */
+/*              On success - Exits calling tst_exit(). With '0' TEST_RETURNurn code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate TEST_RETURNurn code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - TEST_RETURNurns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+
+
+void sig_handler(int sig)
+{
+}
+
+
+int main(int ac, char **av) {
+	
+	sigset_t set, set1, set2;
+	int lc;                 /* loop counter */
+        char *msg;              /* message TEST_RETURNurned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+			TEST(sigemptyset(&set));
+			if(TEST_RETURN == -1){
+				tst_resm(TFAIL,"sigemptyset() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+				cleanup();
+				tst_exit();
+			}
+			struct sigaction act, oact;
+		        act.sa_handler = sig_handler;
+			
+			TEST(syscall(174, SIGALRM, &act, &oact, 8));
+			if(TEST_RETURN == -1){
+		        	tst_resm(TFAIL,"rt_sigaction() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+				cleanup();
+				tst_exit();
+			}
+			TEST(syscall(175, SIG_UNBLOCK, 0, &set1, 8));
+			if(TEST_RETURN == -1){
+		        	tst_resm(TFAIL,"rt_sigprocmask() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+				cleanup();
+				tst_exit();
+			}
+			
+			TEST(alarm(5));
+		        int result;
+			TEST(result = syscall(179, &set, 8));
+		        TEST(alarm(0));
+			if((result == -1) && (TEST_ERRNO != EINTR)){
+				TEST(syscall(175, SIG_UNBLOCK, 0, &set2, 8));
+				if(TEST_RETURN == -1){
+		        		tst_resm(TFAIL,"rt_sigprocmask() Failed, errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+					cleanup();
+					tst_exit();
+				} else if(set1.__val[0] != set2.__val[0]){
+		                        tst_resm(TFAIL," rt_sigsuspend failed to preserve signal mask,errno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+					cleanup();
+					tst_exit();
+			        } else {
+		                        tst_resm(TPASS,"rt_sigsuspend PASSED");
+		                }
+		        }else{
+		             tst_resm(TFAIL," rt_sigsuspend failed ,errrno=%d : %s",TEST_ERRNO, strerror(TEST_ERRNO));
+	                     cleanup();
+			     tst_exit();
+			}
+		
+	
+                }
+	 }
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 21:26:51.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 21:34:12.000000000 +0530
@@ -790,6 +790,7 @@ rt_sigaction01 rt_sigaction01
 rt_sigprocmask01 rt_sigprocmask01
 rt_sigprocmask02 rt_sigprocmask02
 rt_sigqueueinfo01 rt_sigqueueinfo01
+rt_sigsuspend01 rt_sigsuspend01
 
 sbrk01 sbrk01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 12/21] Add set_thread_area01 test for set_thread_area syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (10 preceding siblings ...)
  2009-05-18 19:10 ` [LTP] [PATCH 11/21] Add rt_sigsuspend01 test for rt_sigsuspend syscall Manas Kumar Nayak
@ 2009-05-18 19:11 ` Manas Kumar Nayak
  2009-05-18 19:11 ` [LTP] [PATCH 13/21] Add set_thread_area02 " Manas Kumar Nayak
                   ` (9 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:11 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/set_thread_area/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/set_thread_area/Makefile	2009-05-18 21:42:42.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/set_thread_area/set_thread_area01.c	2009-05-18 21:44:11.000000000 +0530
@@ -0,0 +1,177 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        set_thread_area01.c                                           */
+/*                                                                            */
+/* Description: This test two syscalls 					      */
+/*		1) get__thread_area():					      */
+/*		  get_thread_area returns an entry in the current thread's    */
+/*		  Thread Local Storage (TLS) array.get_thread_area returns 0  */
+/*	          on success. Otherwise, it returns -1			      */
+/*		2)set_thread_area():    				      */
+/*		 set_thread_area() sets an entry in the current thread's      */
+/*	         Thread Local.When  set_thread_area() is passed an            */
+/*		 entry_number of -1, it uses a free TLS entry.                */
+/*		 set_thread_area() returns 0 on success, and -1 on failure    */	
+/*									      */	
+/*              							      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* set_tid_address01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 2                                                             */
+/*                                                                            */
+/* Test Name:   set_thread_area01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <linux/unistd.h>
+#include <asm/ldt.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "set_thread_area01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        
+	struct user_desc u_info;
+        int result;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+	             u_info.entry_number = 6;
+	
+	/*
+         * This call to get_thread_area function should be sucessful.
+         */
+
+                     TEST(result = syscall(244, &u_info));     //call get_thread_area()
+                     if(TEST_RETURN == 0) {
+        		tst_resm(TPASS, "get_thread_area call succeeded");
+                     }
+                     else {
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+	  	           tst_exit();
+                     }
+		     
+		     u_info.entry_number = -1;
+        /*
+         * This call to set_thread_area function should be sucessful.
+         */
+
+                     TEST(result = syscall(243, &u_info));     //call set_thread_area()
+                     if(TEST_RETURN == 0) {
+        		tst_resm(TPASS, "set_thread_area call succeeded");
+                     }
+                     else {
+                 	   tst_resm(TFAIL, "%s failed----- errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+	  	           tst_exit();
+                     }
+                }
+        }	
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 21:53:22.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 21:50:52.000000000 +0530
@@ -970,6 +970,7 @@ setrlimit02 setrlimit02
 setrlimit03 setrlimit03
 
 set_robust_list01 set_robust_list01
+set_thread_area01 set_thread_area01
 
 setsid01 setsid01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 13/21] Add set_thread_area02 test for set_thread_area syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (11 preceding siblings ...)
  2009-05-18 19:11 ` [LTP] [PATCH 12/21] Add set_thread_area01 test for set_thread_area syscall Manas Kumar Nayak
@ 2009-05-18 19:11 ` Manas Kumar Nayak
  2009-05-18 19:11 ` [LTP] [PATCH 14/21] Add set_tid_address01 test for set_tid_address syscall Manas Kumar Nayak
                   ` (8 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:11 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/set_thread_area/set_thread_area02.c	2009-05-18 22:06:44.000000000 +0530
@@ -0,0 +1,198 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        set_thread_area_02.c                                          */
+/*                                                                            */
+/* Description: This test checks for propper error code on syscalls	      */
+/*		1) get__thread_area():					      */
+/*		  get_thread_area returns an entry in the current thread's    */
+/*		  Thread Local Storage (TLS) array.get_thread_area returns 0  */
+/*	          on success. Otherwise, it returns -1			      */
+/*		2)set_thread_area():    				      */
+/*		 set_thread_area() sets an entry in the current thread's      */
+/*	         Thread Local.When  set_thread_area() is passed an            */
+/*		 entry_number of -1, it uses a free TLS entry.                */
+/*		 set_thread_area() returns 0 on success, and -1 on failure    */	
+/*	         with errno set appropriately. 				      */	
+/*              							      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* set_thread_area_02 [-c n] [-e][-i n] [-I x] [-p x] [-t]                    */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 3                                                             */
+/*                                                                            */
+/* Test Name:   set_thread_area_02
+                                            */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <linux/unistd.h>
+#include <asm/ldt.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "set_thread_area_02";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 3;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        
+	struct user_desc u_info;
+        int result;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+	             u_info.entry_number = 6;
+	
+	/*
+         * This call to get_thread_area function should be sucessful.
+         */
+
+                     TEST(result = syscall(244, &u_info));     //call get_thread_area()
+                     if(TEST_RETURN == -1) {
+                 	   tst_resm(TFAIL, "call get_thraed_area() failed with errno = %d ", TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+	  	           tst_exit();
+                     }
+		     
+		     u_info.entry_number = -2;
+        /*
+         * This call to set_thread_area function with invalid entry_number should be FAILED.
+         */
+
+                     TEST(result = syscall(243, &u_info));     //call set_thread_area()
+                     if(TEST_RETURN == -1) {
+			if(TEST_ERRNO == EINVAL){
+				tst_resm(TPASS, "Call to set_thread_area call failed with invalid entry_number result = %d (expected EINVAL)",TEST_ERRNO);
+			 }
+			 else {
+                 	  	  tst_resm(TPASS,"Call to set_thread_area with invalid entry_number got unexpected result = %d (expected EINVAL)",TEST_ERRNO);
+		               }
+		     }
+		     else {
+	           	    tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" );
+			    cleanup();
+                            tst_exit();
+                     	  }
+
+	/*
+         * This call to set_thread_area function with an invalid pointer should be FAILED with EFAULT.
+         */
+
+                     TEST(result = syscall(243,(struct user_desc *)-9));     //call set_thread_area()
+                     if(TEST_RETURN == -1) {
+			if(TEST_ERRNO == EFAULT){
+				tst_resm(TPASS, "Call to set_thread_area call with invalid entry_number result = %d (got expected error EFAULT)",TEST_ERRNO);
+			 }
+			 else {
+                 	  	  tst_resm(TPASS,"Call to set_thread_area with invalid entry_number got unexpected result = %d (expected EFAULT)",TEST_ERRNO);
+		               }
+		     }
+		     else {
+	           	    tst_resm(TFAIL,"Call to set_thread_area with invalid entry_number succeed,but should fail" );
+                            tst_exit();
+                     	  }
+                }
+        }
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 21:57:18.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 22:07:55.000000000 +0530
@@ -971,6 +971,7 @@ setrlimit03 setrlimit03
 
 set_robust_list01 set_robust_list01
 set_thread_area01 set_thread_area01
+set_thread_area02 set_thread_area02
 
 setsid01 setsid01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 14/21] Add set_tid_address01 test for set_tid_address syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (12 preceding siblings ...)
  2009-05-18 19:11 ` [LTP] [PATCH 13/21] Add set_thread_area02 " Manas Kumar Nayak
@ 2009-05-18 19:11 ` Manas Kumar Nayak
  2009-05-18 19:11 ` [LTP] [PATCH 15/21] Add sgetmask01 test for sgetmask syscall Manas Kumar Nayak
                   ` (7 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:11 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/set_tid_address/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/set_tid_address/Makefile	2009-03-25 19:28:35.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/set_tid_address/set_tid_address01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/set_tid_address/set_tid_address01.c	2009-05-18 22:45:33.000000000 +0530
@@ -0,0 +1,142 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        set_tid_address01.c                                           */
+/*                                                                            */
+/* Description: This tests the set_tid_address() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* set_tid_address01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   set_tid_address01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "set_tid_address01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        int newtid = -1;
+        int result;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     TEST(result = syscall(258, &newtid));     //call set_tid_address()
+                     if(TEST_RETURN == getpid()) {
+        		tst_resm(TPASS, "set_tid_address call succeeded: result = %d (expected %d)",TEST_RETURN, result);
+                     }
+                     else {
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+	  	           tst_exit();
+                     }
+                }
+        }	
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 22:10:12.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 22:47:02.000000000 +0530
@@ -972,6 +972,7 @@ setrlimit03 setrlimit03
 set_robust_list01 set_robust_list01
 set_thread_area01 set_thread_area01
 set_thread_area02 set_thread_area02
+set_tid_address01 set_tid_address01
 
 setsid01 setsid01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 15/21] Add sgetmask01 test for sgetmask syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (13 preceding siblings ...)
  2009-05-18 19:11 ` [LTP] [PATCH 14/21] Add set_tid_address01 test for set_tid_address syscall Manas Kumar Nayak
@ 2009-05-18 19:11 ` Manas Kumar Nayak
  2009-05-18 19:11 ` [LTP] [PATCH 16/21] Add sigreturn01 test for sigreturn syscall Manas Kumar Nayak
                   ` (6 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:11 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/sgetmask/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/sgetmask/Makefile	2009-04-05 18:10:59.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/sgetmask/sgetmask01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/sgetmask/sgetmask01.c	2009-05-18 23:00:42.000000000 +0530
@@ -0,0 +1,159 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        sgetmask01.c                                           */
+/*                                                                            */
+/* Description: This tests the sgetmask() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* sgetmask01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   sgetmask01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+
+/* NOTE:  This case test the behavior of sgetmask
+# Sometime the returned "Oops"in this case don't mean anything for
+# correct or error, we check the result between different kernel and
+# try to find if there exist different returned code in different kernel
+#
+*/
+
+
+#include <stdio.h>
+#include <signal.h>
+#include <sys/syscall.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <errno.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "sgetmask01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        int sig;
+	int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+
+			for (sig = -3; sig <= SIGRTMAX + 1; sig++){
+				TEST(syscall(__NR_ssetmask,sig));
+                		tst_resm(TINFO,"Setting signal : %d -- return of setmask : %d",sig,TEST_RETURN);     //call sgetmask()
+                     		TEST(syscall(__NR_ssetmask));     //call sgetmask()
+                     		if(TEST_RETURN != sig) {
+        				tst_resm(TINFO,"Oops,setting sig %d, got %d",sig,TEST_RETURN);
+                     		} else
+        				tst_resm(TPASS,"OK,setting sig %d, got %d",sig,TEST_RETURN);
+                     		if(sig == SIGRTMAX + 1){
+					cleanup();
+					tst_exit();
+				}
+                	}
+		}
+        }	
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 22:51:50.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 23:03:55.000000000 +0530
@@ -895,6 +895,8 @@ setgid03_16 setgid03_16
 
 setegid01 setegid01
 
+sgetmask01 sgetmask01
+
 setgroups01 setgroups01
 setgroups01_16 setgroups01_16
 setgroups02 setgroups02

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 16/21] Add sigreturn01 test for sigreturn syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (14 preceding siblings ...)
  2009-05-18 19:11 ` [LTP] [PATCH 15/21] Add sgetmask01 test for sgetmask syscall Manas Kumar Nayak
@ 2009-05-18 19:11 ` Manas Kumar Nayak
  2009-08-31 12:17   ` Cyril Hrubis
  2009-05-18 19:11 ` [LTP] [PATCH 17/21] Add ssetmask01 test for ssetmask syscall Manas Kumar Nayak
                   ` (5 subsequent siblings)
  21 siblings, 1 reply; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:11 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/sigreturn/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/sigreturn/Makefile	2009-05-18 14:23:39.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/sigreturn/sigreturn01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/sigreturn/sigreturn01.c	2009-05-18 23:13:19.000000000 +0530
@@ -0,0 +1,172 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        sigreturn01.c                                           */
+/*                                                                            */
+/* Description: This tests the sigreturn() syscall  
+	sigreturn - return from signal handler and cleanup stack frame.	
+	When the Linux kernel creates the stack frame for a signal handler, 
+	a call to sigreturn() is inserted into the stack frame so that the
+	signal handler will call sigreturn() upon return. This inserted call
+	to sigreturn() cleans up the stack so that the process can restart 
+	from where it was interrupted by the signal.  		
+		                    */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* sigreturn01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   sigreturn01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <limits.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <pwd.h>
+#include <grp.h>
+#include <string.h>
+#include <sys/param.h>
+#include <stdio.h>
+#include <errno.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "sigreturn01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+
+#define PRINT(X) fprintf(stdout,"%s\n", X)
+
+int ngexit(void);
+
+int main(int ac, char **av) {
+        int retval = 0;
+        unsigned long parm = 0;
+	int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                    TEST(retval = sigreturn(parm)); 
+                    if(TEST_RETURN > 0 ) {
+                 	tst_resm(TFAIL, "%s ERROR!! sigreturn never return- errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+			cleanup();
+                        tst_exit();
+                     }
+                     else if (TEST_RETURN <= 0 ){
+        	 	   tst_resm(TPASS, "sigreturn call succeeded: result = %d ",TEST_RETURN);
+                     }
+
+	            parm = 0xffffffff;
+		    TEST(retval = sigreturn(parm)); 
+                    if(TEST_RETURN > 0 ) {
+                 	tst_resm(TFAIL, "%s ERROR!! sigreturn never return- errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+			cleanup();
+			tst_exit();
+                     }
+                     else if (TEST_RETURN <= 0 ){
+        	 	   tst_resm(TPASS, "sigreturn call succeeded: result = %d ",TEST_RETURN);
+                     }
+                }
+        }	
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 23:07:42.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 23:16:19.000000000 +0530
@@ -1035,6 +1035,7 @@ sigpending02 sigpending02
 sigprocmask01 sigprocmask01
 
 sigrelse01 sigrelse01
+sigreturn01 sigreturn01
 
 sigsuspend01 sigsuspend01
 

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 17/21] Add ssetmask01 test for ssetmask syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (15 preceding siblings ...)
  2009-05-18 19:11 ` [LTP] [PATCH 16/21] Add sigreturn01 test for sigreturn syscall Manas Kumar Nayak
@ 2009-05-18 19:11 ` Manas Kumar Nayak
  2009-05-18 19:12 ` [LTP] [PATCH 18/21] Add timer_getoverrun01 test for timer_getoverrun01 syscall Manas Kumar Nayak
                   ` (4 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:11 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/ssetmask/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/ssetmask/Makefile	2009-05-18 23:19:17.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/ssetmask/ssetmask01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/ssetmask/ssetmask01.c	2009-05-18 23:20:27.000000000 +0530
@@ -0,0 +1,147 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        ssetmask01.c                                           */
+/*                                                                            */
+/* Description: This tests the ssetmask() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* ssetmask01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 2                                                             */
+/*                                                                            */
+/* Test Name:   ssetmask01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <signal.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "ssetmask01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int main(int ac, char **av) {
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+		     syscall(69,SIGALRM);
+                     TEST(syscall(68));     //call ssetmask()
+                     if(TEST_RETURN != SIGALRM) {
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+			   tst_exit();
+                     }
+                     TEST(syscall(69,SIGUSR1));     //call ssetmask()
+                     if(TEST_RETURN != SIGALRM) {
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+			   tst_exit();
+                     }
+                 	   tst_resm(TPASS, "Got SIGALRM--Test PASS ",TEST_RETURN);
+                     }
+                }
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 23:23:55.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 23:22:23.000000000 +0530
@@ -1060,6 +1060,8 @@ splice02 seq 1 10000000 | splice02 splic
 
 tee01 tee01
 
+ssetmask01 ssetmask01
+
 stat01 stat01
 stat01_64 stat01_64
 stat02 stat02

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 18/21] Add timer_getoverrun01 test for timer_getoverrun01 syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (16 preceding siblings ...)
  2009-05-18 19:11 ` [LTP] [PATCH 17/21] Add ssetmask01 test for ssetmask syscall Manas Kumar Nayak
@ 2009-05-18 19:12 ` Manas Kumar Nayak
  2009-05-18 19:12 ` [LTP] [PATCH 19/21] Add timer_gettime01 test for timer_gettime syscall Manas Kumar Nayak
                   ` (3 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:12 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/timer_getoverrun/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/timer_getoverrun/Makefile	2009-04-05 11:58:14.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c	2009-05-18 23:29:15.000000000 +0530
@@ -0,0 +1,204 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        timer_getoverrun01.c                                           */
+/*                                                                            */
+/* Description: This tests the timer_getoverrun() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* timer_getoverrun01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   timer_getoverrun01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <time.h>
+#include <signal.h>
+#include <syscall.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "timer_getoverrun01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 1;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+char tmpname[40];
+int parent;
+int block = 1;
+
+#define ENTER(normal) tst_resm(TINFO, "Enter block %d: test %d (%s)", \
+                         block, Tst_count, normal?"NORMAL":"ERROR");
+
+int main(int ac, char **av) {
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	timer_t created_timer_id;
+        struct sigevent ev;
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     
+		ev.sigev_value = (sigval_t)0;
+                ev.sigev_signo = SIGALRM;
+                ev.sigev_notify = SIGEV_SIGNAL;
+
+                TEST(syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &created_timer_id ));
+                
+		ENTER(1);
+                TEST( syscall(__NR_timer_getoverrun, created_timer_id ));
+		if(TEST_RETURN == 0){
+			tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
+                } else {
+			tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
+                        cleanup();
+                        tst_exit();
+                }
+
+
+		ENTER(0);
+                TEST( syscall(__NR_timer_getoverrun, -1 ));
+                if(TEST_RETURN < 0 && TEST_ERRNO == EINVAL ) {
+                        tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
+                } else {
+                        tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
+                        cleanup();
+                        tst_exit();
+                }
+
+
+                }
+        }	
+	cleanup();
+        tst_exit();
+}
+
+
+/*
+
+NAME
+       timer_getoverrun
+SYNOPSIS
+       #include <time.h>
+
+       int timer_getoverrun(timer_t timerid);
+
+	Only a single signal shall be queued to the process for a given  timer
+       at any point in time. When a timer for which a signal is still pending
+       expires, no signal shall be queued, and a timer overrun  shall  occur.
+        When  a timer expiration signal is delivered to or accepted by a pro-
+       cess, if the implementation supports the Realtime  Signals  Extension,
+       the  timer_getoverrun()  function  shall  return  the timer expiration
+       overrun count for the specified timer. The overrun count returned con-
+       tains  the number of extra timer expirations that occurred between the
+       time the signal was generated (queued) and when it  was  delivered  or
+       accepted, up to but not including an implementation-defined maximum of
+       {DELAYTIMER_MAX}. If the number of such extra expirations  is  greater
+       than or equal to {DELAYTIMER_MAX}, then the overrun count shall be set
+       to {DELAYTIMER_MAX}. The value returned  by  timer_getoverrun()  shall
+       apply  to the most recent expiration signal delivery or acceptance for
+       the timer.  If no expiration signal has been delivered for the  timer,
+       or  if  the  Realtime  Signals  Extension is not supported, the return
+       value of timer_getoverrun() is unspecified.
+
+RETURN VALUE
+       If the timer_getoverrun() function succeeds, it shall return the timer
+       expiration overrun count as explained above.
+*/
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 23:26:45.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 23:30:40.000000000 +0530
@@ -1158,6 +1158,8 @@ timerfd01 timerfd01
 timerfd02 timerfd02
 timerfd03 timerfd03
 
+timer_getoverrun01 timer_getoverrun01
+
 truncate01 truncate01
 truncate01_64 truncate01_64
 truncate02 truncate02

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 19/21] Add timer_gettime01 test for timer_gettime syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (17 preceding siblings ...)
  2009-05-18 19:12 ` [LTP] [PATCH 18/21] Add timer_getoverrun01 test for timer_getoverrun01 syscall Manas Kumar Nayak
@ 2009-05-18 19:12 ` Manas Kumar Nayak
  2009-05-18 19:12 ` [LTP] [PATCH 20/21] Add tkill01 test for tkill syscall Manas Kumar Nayak
                   ` (2 subsequent siblings)
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:12 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/timer_gettime/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/timer_gettime/Makefile	2009-04-05 00:48:47.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/timer_gettime/timer_gettime01.c	2009-05-18 23:35:42.000000000 +0530
@@ -0,0 +1,199 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        timer_gettime01.c                                           */
+/*                                                                            */
+/* Description: This tests the timer_gettime() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* timer_gettime01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   timer_gettime01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+#include <time.h>
+#include <signal.h>
+#include <syscall.h>
+#include <stdio.h>
+#include <errno.h>
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "timer_gettime01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 3;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+
+        tst_tmpdir();
+}
+
+#define ENTER(normal) tst_resm(TINFO, "Enter block %d: test %d (%s)", \
+                         block, Tst_count, normal?"NORMAL":"ERROR");
+
+char tmpname[40];
+int parent;
+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;
+        struct sigevent ev;
+        struct itimerspec spec;
+
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+	        for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     ENTER(1);
+	                ev.sigev_value = (sigval_t)0;
+	                ev.sigev_signo = SIGALRM;
+	                ev.sigev_notify = SIGEV_SIGNAL;
+	                TEST(syscall(__NR_timer_create, CLOCK_REALTIME, &ev, &created_timer_id ));
+			TEST( syscall(__NR_timer_gettime, created_timer_id, &spec ));
+			if(TEST_RETURN == 0){
+			      tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
+	                } else {
+				tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
+				cleanup();
+        			tst_exit();
+			 }
+	
+
+			
+/*
+
+ERRORS
+       -EINVAL
+              An invalid timer_id value was specified.
+*/
+                ENTER(0);
+                TEST( syscall(__NR_timer_gettime, -1, &spec ));
+		if(TEST_RETURN < 0 && TEST_ERRNO == EINVAL ) {
+                        tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
+	        } else {
+			tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
+			cleanup();
+        		tst_exit();
+                }
+
+/*
+
+       -EFAULT
+              An invalid address of setting was specified.
+*/
+
+
+                ENTER(0);
+                TEST( syscall(__NR_timer_gettime, created_timer_id, NULL ));
+		if(TEST_RETURN < 0 && TEST_ERRNO == EFAULT ) {
+                       tst_resm(TPASS, "Block %d: test %d PASSED", block, Tst_count );
+	        } else {
+			tst_resm(TFAIL, "Block %d: test %d FAILED... errno = %d : %s", block, Tst_count,TEST_ERRNO, strerror(TEST_ERRNO) );
+			cleanup();
+        		tst_exit();
+                }
+
+
+
+
+                }
+        }	
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 23:38:35.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 23:37:34.000000000 +0530
@@ -1159,6 +1159,7 @@ timerfd02 timerfd02
 timerfd03 timerfd03
 
 timer_getoverrun01 timer_getoverrun01
+timer_gettime01 timer_gettime01
 
 truncate01 truncate01
 truncate01_64 truncate01_64

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 20/21] Add tkill01 test for tkill syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (18 preceding siblings ...)
  2009-05-18 19:12 ` [LTP] [PATCH 19/21] Add timer_gettime01 test for timer_gettime syscall Manas Kumar Nayak
@ 2009-05-18 19:12 ` Manas Kumar Nayak
  2009-05-18 19:12 ` [LTP] [PATCH 21/21] Add tkill02 " Manas Kumar Nayak
  2009-05-21 18:59 ` [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Subrata Modak
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:12 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/tkill/Makefile	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/tkill/Makefile	2009-05-18 23:45:45.000000000 +0530
@@ -0,0 +1,31 @@
+#
+#  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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+CFLAGS += -I../../../../include -Wall
+LDLIBS += -L../../../../lib -lltp
+
+SRCS    = $(wildcard *.c)
+TARGETS = $(patsubst %.c,%,$(SRCS))
+
+all: $(TARGETS)
+
+install:
+	@set -e; for i in $(TARGETS); do ln -f $$i ../../../bin/$$i ; done
+
+clean:
+	rm -f $(TARGETS)
--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/tkill/tkill01.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/tkill/tkill01.c	2009-05-18 23:47:48.000000000 +0530
@@ -0,0 +1,163 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        tkill01.c                                           */
+/*                                                                            */
+/* Description: This tests the tkill() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* tkill01 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   tkill01                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+
+#include <signal.h>
+#include <sys/syscall.h>
+#include <linux/unistd.h>
+#include <sys/types.h>
+
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "tkill01";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+int sig_count = 0;
+
+void sig_action(int sig)
+{
+        sig_count = 1;
+}
+
+int main(int ac, char **av) {
+        int tid;
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+                     TEST(signal(SIGUSR1, &sig_action));     
+                     TEST(tid = syscall(224));     
+		     if(TEST_RETURN == -1) {
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+			   cleanup();
+			   tst_exit();
+                     }
+                     TEST(syscall(238,tid, SIGUSR1));     
+		     if(TEST_RETURN == 0) {
+				if(!sig_count);
+        			tst_resm(TPASS, "tkill call succeeded");
+		     }else{
+                 	   tst_resm(TFAIL, "%s failed - errno = %d : %s", TCID, TEST_ERRNO, strerror(TEST_ERRNO));
+                           cleanup();
+			   tst_exit();
+                     }
+                }
+        }	
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 23:42:14.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-18 23:49:54.000000000 +0530
@@ -1161,6 +1161,8 @@ timerfd03 timerfd03
 timer_getoverrun01 timer_getoverrun01
 timer_gettime01 timer_gettime01
 
+tkill01 tkill01
+
 truncate01 truncate01
 truncate01_64 truncate01_64
 truncate02 truncate02

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [LTP] [PATCH 21/21] Add tkill02 test for tkill syscall
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (19 preceding siblings ...)
  2009-05-18 19:12 ` [LTP] [PATCH 20/21] Add tkill01 test for tkill syscall Manas Kumar Nayak
@ 2009-05-18 19:12 ` Manas Kumar Nayak
  2009-05-21 18:59 ` [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Subrata Modak
  21 siblings, 0 replies; 24+ messages in thread
From: Manas Kumar Nayak @ 2009-05-18 19:12 UTC (permalink / raw)
  To: LTP List; +Cc: Deepakraj B Himavantharaj, Manas Kumar Nayak

Signed-off-by: Manas Kumar Nayak <maknayak@in.ibm.com>,
To: LTP List <ltp-list@lists.sourceforge.net>,
Cc: Deepakraj B Himavantharaj <deepakraj@in.ibm.com>,
Cc: Subrata Modak <subrata@linux.vnet.ibm.com>,
Cc: Masatake YAMATO <yamato@redhat.com>,
---

--- ltp-intermediate-20090518-manas-work-original/testcases/kernel/syscalls/tkill/tkill02.c	1970-01-01 05:30:00.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/testcases/kernel/syscalls/tkill/tkill02.c	2009-05-18 23:58:39.000000000 +0530
@@ -0,0 +1,172 @@
+/******************************************************************************/
+/* Copyright (c) Crackerjack Project., 2007                                   */
+/*                                                                            */
+/* 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    */
+/*                                                                            */
+/******************************************************************************/
+/******************************************************************************/
+/*                                                                            */
+/* File:        tkill02.c                                           */
+/*                                                                            */
+/* Description: This tests the tkill() syscall                      */
+/*                                                                            */
+/* Usage:  <for command-line>                                                 */
+/* tkill02 [-c n] [-e][-i n] [-I x] [-p x] [-t]                     */
+/*      where,  -c n : Run n copies concurrently.                             */
+/*              -e   : Turn on errno logging.                                 */
+/*              -i n : Execute test n times.                                  */
+/*              -I x : Execute test for x seconds.                            */
+/*              -P x : Pause for x seconds between iterations.                */
+/*              -t   : Turn on syscall timing.                                */
+/*                                                                            */
+/* Total Tests: 1                                                             */
+/*                                                                            */
+/* Test Name:   tkill02                                             */
+/* History:     Porting from Crackerjack to LTP is done by                    */
+/*              Manas Kumar Nayak maknayak@in.ibm.com>                        */
+/******************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+#include <sys/syscall.h>
+
+
+/* Harness Specific Include Files. */
+#include "test.h"
+#include "usctest.h"
+#include "linux_syscall_numbers.h"
+
+/* Extern Global Variables */
+extern int Tst_count;           /* counter for tst_xxx routines.         */
+extern char *TESTDIR;           /* temporary dir created by tst_tmpdir() */
+
+/* Global Variables */
+char *TCID = "tkill02";  /* Test program identifier.*/
+int  testno;
+int  TST_TOTAL = 2;                   /* total number of tests in this file.   */
+
+/* Extern Global Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    cleanup                                                       */
+/*                                                                            */
+/* Description: Performs all one time clean up for this test on successful    */
+/*              completion,  premature exit or  failure. Closes all temporary */
+/*              files, removes all temporary directories exits the test with  */
+/*              appropriate return code by calling tst_exit() function.       */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits calling tst_exit(). Non '0' return code.   */
+/*              On success - Exits calling tst_exit(). With '0' return code.  */
+/*                                                                            */
+/******************************************************************************/
+extern void cleanup() {
+        /* Remove tmp dir and all files in it */
+        TEST_CLEANUP;
+        tst_rmdir();
+
+        /* Exit with appropriate return code. */
+        tst_exit();
+}
+
+/* Local  Functions */
+/******************************************************************************/
+/*                                                                            */
+/* Function:    setup                                                         */
+/*                                                                            */
+/* Description: Performs all one time setup for this test. This function is   */
+/*              typically used to capture signals, create temporary dirs      */
+/*              and temporary files that may be used in the course of this    */
+/*              test.                                                         */
+/*                                                                            */
+/* Input:       None.                                                         */
+/*                                                                            */
+/* Output:      None.                                                         */
+/*                                                                            */
+/* Return:      On failure - Exits by calling cleanup().                      */
+/*              On success - returns 0.                                       */
+/*                                                                            */
+/******************************************************************************/
+void setup() {
+        /* Capture signals if any */
+        /* Create temporary directories */
+        TEST_PAUSE;
+        tst_tmpdir();
+}
+
+struct test_case_t {
+        int tid;
+        int exp_errno;
+} test_cases[] = {
+        { -1, EINVAL },
+        { 99999, ESRCH }
+};
+
+int main(int ac, char **av) {
+        int lc;                 /* loop counter */
+        char *msg;              /* message returned from parse_opts */
+	int i, succeed=0, fail=0;
+	
+        /* parse standard options */
+        if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
+             tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
+             tst_exit();
+           }
+
+        setup();
+
+        /* Check looping state if -i option given */
+        for (lc = 0; TEST_LOOPING(lc); ++lc) {
+                Tst_count = 0;
+                for (testno = 0; testno < TST_TOTAL; ++testno) {
+
+			for(i=0; i<2; i++){
+		                TEST(syscall(238, test_cases[i].tid, SIGUSR1));
+		     		if(TEST_RETURN == -1) {
+			            	if(TEST_ERRNO == test_cases[i].exp_errno){
+						tst_resm(TINFO, "%s() call with tid:%d got expected errno:%d", TCID, test_cases[i].tid,TEST_ERRNO);
+						succeed++;
+					}
+					else{
+						tst_resm(TINFO, "%s() call with tif:%d got unexpected errno = %d : %s", TCID, test_cases[i].tid, TEST_ERRNO, strerror(TEST_ERRNO));
+						fail++;
+					}
+				}else{
+					tst_resm(TINFO, "%s() with tid:%d succeed,but should fail", TCID, test_cases[i].tid);
+				}
+			}
+		
+		if(fail != 0){
+			tst_resm(TFAIL, "tkill() call FAILED");
+			cleanup();
+			tst_exit();
+        	}
+        	else{
+			tst_resm(TPASS, "tkill() call PASSED");
+	        }
+
+                
+	    }
+     }	
+	cleanup();
+        tst_exit();
+}
+
--- ltp-intermediate-20090518-manas-work-original/runtest/syscalls	2009-05-18 23:53:08.000000000 +0530
+++ ltp-intermediate-20090518-manas-work/runtest/syscalls	2009-05-19 00:01:05.000000000 +0530
@@ -1162,6 +1162,7 @@ timer_getoverrun01 timer_getoverrun01
 timer_gettime01 timer_gettime01
 
 tkill01 tkill01
+tkill02 tkill02
 
 truncate01 truncate01
 truncate01_64 truncate01_64

---
Regards--
Manas


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP
  2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
                   ` (20 preceding siblings ...)
  2009-05-18 19:12 ` [LTP] [PATCH 21/21] Add tkill02 " Manas Kumar Nayak
@ 2009-05-21 18:59 ` Subrata Modak
  21 siblings, 0 replies; 24+ messages in thread
From: Subrata Modak @ 2009-05-21 18:59 UTC (permalink / raw)
  To: Manas Kumar Nayak; +Cc: LTP List, Deepakraj B Himavantharaj

On Tue, 2009-05-19 at 00:39 +0530, Manas Kumar Nayak wrote:
> Hi,
> 
> I have ported the following tests from Crackerjack to LTP.
> Kindly include them to LTP:
> 
> [PATCH 01/21] Add add_key01 test for add_key syscall
> [PATCH 02/21] Add add_key02 test for add_key syscall
> [PATCH 03/21] Add bdflush01 test for bdflush syscall
> [PATCH 04/21] Add exit_group01 test for exit_group syscall
> [PATCH 05/21] Add keyctl01 test for keyctl syscall
> [PATCH 06/21] Add newuname01 test for newuname syscall
> [PATCH 07/21] Add rt_sigaction01 test for rt_sigaction syscall
> [PATCH 08/21] Add rt_sigprocmask01 test for rt_sigprocmask syscall
> [PATCH 09/21] Add rt_sigprocmask02 test for rt_sigprocmask syscall
> [PATCH 10/21] Add rt_sigqueueinfo01 test for rt_sigqueueinfo syscall
> [PATCH 11/21] Add rt_sigsuspend01 test for rt_sigsuspend syscall
> [PATCH 12/21] Add set_thread_area01 test for set_thread_area syscall
> [PATCH 13/21] Add set_thread_area02 test for set_thread_area syscall
> [PATCH 14/21] Add set_tid_address01 test for set_tid_address syscall
> [PATCH 15/21] Add sgetmask01 test for sgetmask syscall
> [PATCH 16/21] Add sigreturn01 test for sigreturn syscall
> [PATCH 17/21] Add ssetmask01 test for ssetmask syscall
> [PATCH 18/21] Add timer_getoverrun01 test for timer_getoverrun01 syscall
> [PATCH 19/21] Add timer_gettime01 test for timer_gettime syscall
> [PATCH 20/21] Add tkill01 test for tkill syscall
> [PATCH 21/21] Add tkill02 test for tkill syscall

Thanks for Porting/Adding so many testcases to LTP. All of them now
stand merged.

> 
> Todo:
> 	1) Port the Remaining ones (next week),

Would be equally happy to welcome them.

Regards--
Subrata

> 
> Regards--
> Manas
> 


------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [LTP] [PATCH 16/21] Add sigreturn01 test for sigreturn syscall
  2009-05-18 19:11 ` [LTP] [PATCH 16/21] Add sigreturn01 test for sigreturn syscall Manas Kumar Nayak
@ 2009-08-31 12:17   ` Cyril Hrubis
  0 siblings, 0 replies; 24+ messages in thread
From: Cyril Hrubis @ 2009-08-31 12:17 UTC (permalink / raw)
  To: Manas Kumar Nayak; +Cc: LTP List, Deepakraj B Himavantharaj, pasky

Hi!
This test doesn't compile cleanly because on all linuxes I've try to do so
sigreturn() is not defined as manual says.

Instead of:

sigreturn(unsigned long __unused);

It's defined as:

extern int sigreturn (struct sigcontext *__scp) __THROW;

And it also seems to be unimplemented on linux.

Anyway after looking into the source and manual, the test seems to be testing
return value of call that does some magic on the stack of the process in order
to return from signal handler. And the "never return" in manual means IMHO that
execution path of the program is changed in a way the return value of sigreturn
can't be checked at all. To me it looks like some old and unused internal
kernel/glibc api that is not worth testing. So I vote for removing this one
from ltp.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2009-08-31 12:28 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-18 19:09 [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Manas Kumar Nayak
2009-05-18 19:09 ` [LTP] [PATCH 01/21] Add add_key01 test for add_key syscall Manas Kumar Nayak
2009-05-18 19:09 ` [LTP] [PATCH 02/21] Add add_key02 " Manas Kumar Nayak
2009-05-18 19:09 ` [LTP] [PATCH 03/21] Add bdflush01 test for bdflush syscall Manas Kumar Nayak
2009-05-18 19:09 ` [LTP] [PATCH 04/21] Add exit_group01 test for exit_group syscall Manas Kumar Nayak
2009-05-18 19:09 ` [LTP] [PATCH 05/21] Add keyctl01 test for keyctl syscall Manas Kumar Nayak
2009-05-18 19:10 ` [LTP] [PATCH 06/21] Add newuname01 test for newuname syscall Manas Kumar Nayak
2009-05-18 19:10 ` [LTP] [PATCH 07/21] Add rt_sigaction01 test for rt_sigaction syscall Manas Kumar Nayak
2009-05-18 19:10 ` [LTP] [PATCH 08/21] Add rt_sigprocmask01 test for rt_sigprocmask syscall Manas Kumar Nayak
2009-05-18 19:10 ` [LTP] [PATCH 09/21] Add rt_sigprocmask02 " Manas Kumar Nayak
2009-05-18 19:10 ` [LTP] [PATCH 10/21] Add rt_sigqueueinfo01 test for rt_sigqueueinfo syscall Manas Kumar Nayak
2009-05-18 19:10 ` [LTP] [PATCH 11/21] Add rt_sigsuspend01 test for rt_sigsuspend syscall Manas Kumar Nayak
2009-05-18 19:11 ` [LTP] [PATCH 12/21] Add set_thread_area01 test for set_thread_area syscall Manas Kumar Nayak
2009-05-18 19:11 ` [LTP] [PATCH 13/21] Add set_thread_area02 " Manas Kumar Nayak
2009-05-18 19:11 ` [LTP] [PATCH 14/21] Add set_tid_address01 test for set_tid_address syscall Manas Kumar Nayak
2009-05-18 19:11 ` [LTP] [PATCH 15/21] Add sgetmask01 test for sgetmask syscall Manas Kumar Nayak
2009-05-18 19:11 ` [LTP] [PATCH 16/21] Add sigreturn01 test for sigreturn syscall Manas Kumar Nayak
2009-08-31 12:17   ` Cyril Hrubis
2009-05-18 19:11 ` [LTP] [PATCH 17/21] Add ssetmask01 test for ssetmask syscall Manas Kumar Nayak
2009-05-18 19:12 ` [LTP] [PATCH 18/21] Add timer_getoverrun01 test for timer_getoverrun01 syscall Manas Kumar Nayak
2009-05-18 19:12 ` [LTP] [PATCH 19/21] Add timer_gettime01 test for timer_gettime syscall Manas Kumar Nayak
2009-05-18 19:12 ` [LTP] [PATCH 20/21] Add tkill01 test for tkill syscall Manas Kumar Nayak
2009-05-18 19:12 ` [LTP] [PATCH 21/21] Add tkill02 " Manas Kumar Nayak
2009-05-21 18:59 ` [LTP] [PATCH 00/21][1st Bunch] Port Crackerjack Syscall tests(missing) to LTP Subrata Modak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.