Port Crackerjack Syscall tests(missing) to LTP
cover Port Crackerjack Syscall tests(missing) to LTP
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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 1/21 Add add_key01 test for add_key syscall
To: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/add_key/add_key01.c +142 -0
@@ -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 [email protected]> */ +/******************************************************************************/ + +#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 (); +} +
testcases/kernel/syscalls/add_key/Makefile +31 -0
@@ -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)
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 2/21 Add add_key02 test for add_key syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/add_key/add_key02.c +173 -0
@@ -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 [email protected]> */ +/******************************************************************************/ + +#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 (); +} +
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 3/21 Add bdflush01 test for bdflush syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/bdflush/bdflush01.c +208 -0
@@ -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 [email protected]> */ +/******************************************************************************/ +#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 (); +} +
testcases/kernel/syscalls/bdflush/Makefile +31 -0
@@ -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)
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 4/21 Add exit_group01 test for exit_group syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/exit_group/exit_group01.c +156 -0
@@ -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 [email protected]> */ +/******************************************************************************/ + +#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 (); +} +
testcases/kernel/syscalls/exit_group/Makefile +31 -0
@@ -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)
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 5/21 Add keyctl01 test for keyctl syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/keyctl/keyctl01.c +161 -0
@@ -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 [email protected]> */ +/******************************************************************************/ + +#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 (); +} +
testcases/kernel/syscalls/keyctl/Makefile +31 -0
@@ -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)
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 6/21 Add newuname01 test for newuname syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/newuname/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/newuname/newuname01.c +161 -0
161 lines not on this page · raw message
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 7/21 Add rt_sigaction01 test for rt_sigaction syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/rt_sigaction/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/rt_sigaction/rt_sigaction01.c +208 -0
208 lines not on this page · raw message
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 8/21 Add rt_sigprocmask01 test for rt_sigprocmask syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/rt_sigprocmask/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask01.c +233 -0
233 lines not on this page · raw message
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 9/21 Add rt_sigprocmask02 test for rt_sigprocmask syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/rt_sigprocmask/rt_sigprocmask02.c +213 -0
@@ -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 [email protected]> */ +/******************************************************************************/ +#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 (); +} +
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 10/21 Add rt_sigqueueinfo01 test for rt_sigqueueinfo syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/rt_sigqueueinfo/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/rt_sigqueueinfo/rt_sigqueueinfo01.c +179 -0
179 lines not on this page · raw message
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 11/21 Add rt_sigsuspend01 test for rt_sigsuspend syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/rt_sigsuspend/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/rt_sigsuspend/rt_sigsuspend01.c +187 -0
187 lines not on this page · raw message
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 12/21 Add set_thread_area01 test for set_thread_area syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/set_thread_area/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/set_thread_area/set_thread_area01.c +177 -0
177 lines not on this page · raw message
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 13/21 Add set_thread_area02 test for set_thread_area syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/set_thread_area/set_thread_area02.c +198 -0
@@ -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 [email protected]> */ +/******************************************************************************/ + +#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 (); +} +
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 14/21 Add set_tid_address01 test for set_tid_address syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/set_tid_address/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/set_tid_address/set_tid_address01.c +142 -0
142 lines not on this page · raw message
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 15/21 Add sgetmask01 test for sgetmask syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/sgetmask/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/sgetmask/sgetmask01.c +159 -0
159 lines not on this page · raw message
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 16/21 Add sigreturn01 test for sigreturn syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/sigreturn/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/sigreturn/sigreturn01.c +172 -0
172 lines not on this page · raw message
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Re: [LTP] [PATCH 16/21] Add sigreturn01 test for sigreturn syscall
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.
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 17/21 Add ssetmask01 test for ssetmask syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/ssetmask/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/ssetmask/ssetmask01.c +147 -0
147 lines not on this page · raw message
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 18/21 Add timer_getoverrun01 test for timer_getoverrun01 syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/timer_getoverrun/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/timer_getoverrun/timer_getoverrun01.c +204 -0
204 lines not on this page · raw message
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 19/21 Add timer_gettime01 test for timer_gettime syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/timer_gettime/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/timer_gettime/timer_gettime01.c +199 -0
199 lines not on this page · raw message
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 20/21 Add tkill01 test for tkill syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/tkill/Makefile +31 -0
@@ -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)
testcases/kernel/syscalls/tkill/tkill01.c +163 -0
163 lines not on this page · raw message
runtest/syscalls +2 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH 21/21 Add tkill02 test for tkill syscall
In reply to Manas Kumar NayakTo: LTP List <[email protected]>,
Cc: Deepakraj B Himavantharaj <[email protected]>,
Cc: Subrata Modak <[email protected]>,
Cc: Masatake YAMATO <[email protected]>,
---
testcases/kernel/syscalls/tkill/tkill02.c +172 -0
@@ -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 [email protected]> */ +/******************************************************************************/ + +#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 (); +} +
runtest/syscalls +1 -0
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 18 lines · Manas Kumar Nayak
Hi,
I have ported the following tests from Crackerjack to LTP. Kindly include them to LTP:
[PATCH 01/21] Add
add_key01test foradd_keysyscall [PATCH 02/21] Addadd_key02test foradd_keysyscall [PATCH 03/21] Add bdflush01 test for bdflush syscall [PATCH 04/21] Addexit_group01test forexit_groupsyscall [PATCH 05/21] Add keyctl01 test for keyctl syscall
[PATCH 06/21] Add newuname01 test for newuname syscall [PATCH 07/21] Addrt_sigaction01test forrt_sigactionsyscall [PATCH 08/21] Addrt_sigprocmask01test forrt_sigprocmasksyscall [PATCH 09/21] Addrt_sigprocmask02test forrt_sigprocmasksyscall [PATCH 10/21] Addrt_sigqueueinfo01test forrt_sigqueueinfosyscall [PATCH 11/21] Addrt_sigsuspend01test forrt_sigsuspendsyscall [PATCH 12/21] Addset_thread_area01test forset_thread_areasyscall [PATCH 13/21] Addset_thread_area02test forset_thread_areasyscall
Quoted 8 lines
[PATCH 14/21] Add
set_tid_address01test forset_tid_addresssyscall [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] Addtimer_getoverrun01test fortimer_getoverrun01syscall [PATCH 19/21] Addtimer_gettime01test fortimer_gettimesyscall [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.
Quoted 3 lines
Todo:
1) Port the Remaining ones (next week),
Would be equally happy to welcome them.
Regards--
Subrata
Quoted 4 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list