fcntl/fcntl29.c: add F_DUPFD_CLOEXEC test for fcntl(2)
PATCH v2 1/3 fcntl/fcntl29.c: add F_DUPFD_CLOEXEC test for fcntl(2)
create a new case to test F_DUPFD_CLOEXEC for fcntl(2)
--- runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl29.c | 124 ++++++++++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 testcases/kernel/syscalls/fcntl/fcntl29.c
runtest/ltplite +1 -0
@@ -223,6 +223,7 @@ fcntl26 fcntl26 # The tests for these system calls fcntl27 and fcntl28 are temporarily being disabled # fcntl27 fcntl27 # fcntl28 fcntl28 +fcntl29 fcntl29 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/stress.part3 +1 -0
@@ -162,6 +162,7 @@ fcntl26 fcntl26 # The tests for these system calls fcntl27 and fcntl28 are temporarily being disabled # fcntl27 fcntl27 # fcntl28 fcntl28 +fcntl29 fcntl29 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/syscalls +2 -0
@@ -252,6 +252,8 @@ fcntl27 fcntl27 fcntl27_64 fcntl27_64 fcntl28 fcntl28 fcntl28_64 fcntl28_64 +fcntl29 fcntl29 +fcntl29_64 fcntl29_64 fdatasync01 fdatasync01 fdatasync02 fdatasync02
testcases/kernel/syscalls/.gitignore +2 -0
@@ -214,6 +214,8 @@ /fcntl/fcntl27_64 /fcntl/fcntl28 /fcntl/fcntl28_64 +/fcntl/fcntl29 +/fcntl/fcntl29_64 /fdatasync/fdatasync01 /fdatasync/fdatasync02 /flock/flock01
testcases/kernel/syscalls/fcntl/fcntl29.c new file +124 -0
124 lines not on this page · raw message
Signature · 13 lines
1.8.2.1 ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH v2 2/3 fcntl/fcntl30.c: add F_SETPIPE_SZ, F_GETPIPE_SZ test for fcntl(2)
create a new case to test F_SETPIPE_SZ, F_GETPIPE_SZ for fcntl(2)
--- runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl30.c | 143 ++++++++++++++++++++++++++++++ 5 files changed, 149 insertions(+) create mode 100644 testcases/kernel/syscalls/fcntl/fcntl30.c
runtest/ltplite +1 -0
@@ -224,6 +224,7 @@ fcntl26 fcntl26 # fcntl27 fcntl27 # fcntl28 fcntl28 fcntl29 fcntl29 +fcntl30 fcntl30 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/stress.part3 +1 -0
@@ -163,6 +163,7 @@ fcntl26 fcntl26 # fcntl27 fcntl27 # fcntl28 fcntl28 fcntl29 fcntl29 +fcntl30 fcntl30 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/syscalls +2 -0
@@ -254,6 +254,8 @@ fcntl28 fcntl28 fcntl28_64 fcntl28_64 fcntl29 fcntl29 fcntl29_64 fcntl29_64 +fcntl30 fcntl30 +fcntl30_64 fcntl30_64 fdatasync01 fdatasync01 fdatasync02 fdatasync02
testcases/kernel/syscalls/.gitignore +2 -0
@@ -216,6 +216,8 @@ /fcntl/fcntl28_64 /fcntl/fcntl29 /fcntl/fcntl29_64 +/fcntl/fcntl30 +/fcntl/fcntl30_64 /fdatasync/fdatasync01 /fdatasync/fdatasync02 /flock/flock01
testcases/kernel/syscalls/fcntl/fcntl30.c new file +143 -0
143 lines not on this page · raw message
Signature · 13 lines
1.8.2.1 ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Re: [LTP] [PATCH v2 2/3] fcntl/fcntl30.c: add F_SETPIPE_SZ, F_GETPIPE_SZ test for fcntl(2)
Hi!
Quoted 7 lines
testcases/kernel/syscalls/fcntl/fcntl30.c new file +7
-0+#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <string.h> +#include <signal.h> +#include <sys/types.h>
testcases/kernel/syscalls/fcntl/fcntl30.c line 41
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl30.c new file +10
-0+#include <pwd.h> + +#include "test.h" +#include "usctest.h" +#include "safe_macros.h" + +char *TCID ="fcntl30" ; +int TST_TOTAL =1 ; + +#if defined(F_SETPIPE_SZ ) && defined(F_GETPIPE_SZ )
The same here.
Quoted 39 lines
testcases/kernel/syscalls/fcntl/fcntl30.c new file +39
-0+static void setup (void ); +static void cleanup (void ); + +static int pipe_fds[2 ]; +static int test_fd; +static int orig_pipe_size; +static int new_pipe_size; + + +int main (int ac,char **av) +{ +int lc; +char *msg; + + msg =parse_opts (ac, av,NULL ,NULL ); +if (msg !=NULL ) +tst_brkm (TBROK ,NULL ,"OPTION PARSING ERROR - %s" , msg); + +setup (); + +for (lc =0 ;TEST_LOOPING (lc); lc++) { + tst_count =0 ; + +TEST (fcntl (test_fd,F_SETPIPE_SZ , new_pipe_size)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl test F_SETPIPE_SZ failed" ); + } + +TEST (fcntl (test_fd,F_GETPIPE_SZ )); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl test F_GETPIPE_SZ failed" ); + } +tst_resm (TINFO ,"orig_pipe_size: %d new_pipe_size: %d" , + orig_pipe_size, new_pipe_size); +if (TEST_RETURN >= new_pipe_size) { +tst_resm (TPASS ,"fcntl test F_GETPIPE_SZ" +"and F_SETPIPE_SZ success" );
testcases/kernel/syscalls/fcntl/fcntl30.c line 91
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl30.c new file +10
-0+ }else { +tst_resm (TFAIL ,"fcntl test F_GETPIPE_SZ" +"and F_SETPIPE_SZ fail" ); + } + +/* restore the original pipe size*/ +TEST (fcntl (test_fd,F_SETPIPE_SZ , orig_pipe_size)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup,"fcntl " +"restore orignal pipe size failed" );
There is a small logic error here. You say that the test has exactly one testcase but if we get here the test will print passed then failed which would indicate that there are two testcases.
What I would do instead is to set the size to new pipe size on even iteration s and original pipe size on odd iterations.
Quoted 66 lines
testcases/kernel/syscalls/fcntl/fcntl30.c new file +52
-0+ } + } + +cleanup (); +tst_exit (); +} + +static void setup (void ) +{ +if ((tst_kvercmp (2 ,6 ,35 )) <0 ) { +tst_brkm (TCONF ,NULL ,"This test can only run on kernels" +"that are 2.6.35 and higher" ); + } + +tst_sig (NOFORK ,DEF_HANDLER , cleanup); + +tst_tmpdir (); + +TEST_PAUSE ; + +SAFE_PIPE (cleanup, pipe_fds); + test_fd = pipe_fds[1 ]; + +TEST (fcntl (test_fd,F_GETPIPE_SZ )); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl get pipe size failed" ); + } + + orig_pipe_size =TEST_RETURN ; + new_pipe_size = orig_pipe_size *2 ; +} + +static void cleanup (void ) +{ +TEST_CLEANUP ; + +if (pipe_fds[0 ] >0 ) +SAFE_CLOSE (NULL , pipe_fds[0 ]); +if (pipe_fds[1 ] >0 ) +SAFE_CLOSE (NULL , pipe_fds[1 ]); + +tst_rmdir (); +} +#else + +int main (void ) +{ +tst_brkm (TCONF ,NULL ,"This test can only run on kernels" +"that are 2.6.35 and higher" ); +} +#endif Signature · 13 lines
1.8.2.1 ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Re: [LTP] [PATCH v2 2/3] fcntl/fcntl30.c: add F_SETPIPE_SZ, F_GETPIPE_SZ test for fcntl(2)
Hi!
Quoted 11 lines
testcases/kernel/syscalls/fcntl/fcntl30.c line 91
Quoted 5 lines
testcases/kernel/syscalls/fcntl/fcntl30.c new file +5
-0+/* restore the original pipe size*/ +TEST (fcntl (test_fd,F_SETPIPE_SZ , orig_pipe_size)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup,"fcntl " +"restore orignal pipe size failed" );There is a small logic error here. You say that the test has exactly one testcase but if we get here the test will print passed then failed which would indicate that there are two testcases.
Quoted 4 lines
What I would do instead is to set the size to new pipe size on even iteration s and original pipe size on odd iterations.
But then we would have to abort on first failure, because in case the fcntl() failed to change the size but exited with succes the output from the test would be failed, passed, failed, passed...
Other options are changing the tst_brkm to TBROK in this case, or opening new pipe for each iteration.
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH v2 3/3 fcntl/fcntl31.c: add I/O availability signals test for fcntl(2)
In reply to Xiaoguang Wangcreate a new case to test F_GETOWN, F_SETOWN, F_GETOWN_EX, F_SETOWN_EX, F_GETSIG, F_SETSIG for fcntl(2)
--- m4/ltp-fcntl.m4 | 46 ++++ runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl31.c | 426 ++++++++++++++++++++++++++++++ 6 files changed, 478 insertions(+) create mode 100644 m4/ltp-fcntl.m4 create mode 100644 testcases/kernel/syscalls/fcntl/fcntl31.c
m4/ltp-fcntl.m4 new file +46 -0
@@ -0,0 +1,46 @@ +dnl +dnl Copyright (c) 2014 Fujitsu Ltd. +dnl Author: Xiaoguang Wang <[email protected]> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +dnl + +dnl +dnl LTP_CHECK_SYSCALL_FCNTL +dnl ---------------------------- +dnl +AC_DEFUN([LTP_CHECK_SYSCALL_FCNTL],[dnl + AC_MSG_CHECKING([for fcntl f_owner_ex]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ +#define _GNU_SOURCE +#include <stdio.h> +#include <unistd.h> +#include <fcntl.h> +int main(void) { + struct f_owner_ex tst_own_ex; + FILE *fp; + + fp = tmpfile(); + fcntl(fileno(fp), F_GETOWN_EX, &tst_own_ex); + return 0; +}])],[has_f_owner_ex="yes"]) + +if test "x$has_f_owner_ex" = xyes; then + AC_DEFINE(HAVE_STRUCT_F_OWNER_EX,1,[Define to 1 if you have struct f_owner_ex]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +])
runtest/ltplite +1 -0
@@ -225,6 +225,7 @@ fcntl26 fcntl26 # fcntl28 fcntl28 fcntl29 fcntl29 fcntl30 fcntl30 +fcntl31 fcntl31 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/stress.part3 +1 -0
@@ -164,6 +164,7 @@ fcntl26 fcntl26 # fcntl28 fcntl28 fcntl29 fcntl29 fcntl30 fcntl30 +fcntl31 fcntl31 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/syscalls +2 -0
@@ -256,6 +256,8 @@ fcntl29 fcntl29 fcntl29_64 fcntl29_64 fcntl30 fcntl30 fcntl30_64 fcntl30_64 +fcntl31 fcntl31 +fcntl31_64 fcntl31_64 fdatasync01 fdatasync01 fdatasync02 fdatasync02
testcases/kernel/syscalls/.gitignore +2 -0
@@ -218,6 +218,8 @@ /fcntl/fcntl29_64 /fcntl/fcntl30 /fcntl/fcntl30_64 +/fcntl/fcntl31 +/fcntl/fcntl31_64 /fdatasync/fdatasync01 /fdatasync/fdatasync02 /flock/flock01
testcases/kernel/syscalls/fcntl/fcntl31.c new file +426 -0
426 lines not on this page · raw message
Signature · 13 lines
1.8.2.1 ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Re: [LTP] [PATCH v2 3/3] fcntl/fcntl31.c: add I/O availability signals test for fcntl(2)
Hi,please review this v2 patch and ignore the previous:)
create a new case to test F_GETOWN, F_SETOWN, F_GETOWN_EX, F_SETOWN_EX, F_GETSIG, F_SETSIG for fcntl(2)
--- configure.ac | 1 + m4/ltp-fcntl.m4 | 46 ++++ runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl31.c | 426 ++++++++++++++++++++++++++++++ 7 files changed, 479 insertions(+) create mode 100644 m4/ltp-fcntl.m4 create mode 100644 testcases/kernel/syscalls/fcntl/fcntl31.c
configure.ac +1 -0
@@ -173,5 +173,6 @@ LTP_CHECK_KERNEL_DEVEL LTP_CHECK_XFS_QUOTACTL LTP_CHECK_CLONE_SUPPORTS_7_ARGS LTP_CHECK_MKDIRAT +LTP_CHECK_SYSCALL_FCNTL AC_OUTPUT
m4/ltp-fcntl.m4 new file +46 -0
46 lines not on this page · raw message
runtest/ltplite +1 -0
@@ -225,6 +225,7 @@ fcntl26 fcntl26 # fcntl28 fcntl28 fcntl29 fcntl29 fcntl30 fcntl30 +fcntl31 fcntl31 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/stress.part3 +1 -0
@@ -164,6 +164,7 @@ fcntl26 fcntl26 # fcntl28 fcntl28 fcntl29 fcntl29 fcntl30 fcntl30 +fcntl31 fcntl31 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/syscalls +2 -0
@@ -256,6 +256,8 @@ fcntl29 fcntl29 fcntl29_64 fcntl29_64 fcntl30 fcntl30 fcntl30_64 fcntl30_64 +fcntl31 fcntl31 +fcntl31_64 fcntl31_64 fdatasync01 fdatasync01 fdatasync02 fdatasync02
testcases/kernel/syscalls/.gitignore +2 -0
@@ -218,6 +218,8 @@ /fcntl/fcntl29_64 /fcntl/fcntl30 /fcntl/fcntl30_64 +/fcntl/fcntl31 +/fcntl/fcntl31_64 /fdatasync/fdatasync01 /fdatasync/fdatasync02 /flock/flock01
testcases/kernel/syscalls/fcntl/fcntl31.c new file +426 -0
426 lines not on this page · raw message
Signature · 12 lines
1.8.2.1 ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Re: [LTP] [PATCH v2 3/3] fcntl/fcntl31.c: add I/O availability signals test for fcntl(2)
In reply to Xiaoguang WangHi!
Quoted 48 lines
create a new case to test
F_GETOWN,F_SETOWN,F_GETOWN_EX,F_SETOWN_EX,F_GETSIG,F_SETSIGfor fcntl(2)Signed-off-by Xiaoguang Wang <[email protected]>--- m4/ltp-fcntl.m4 | 46 ++++ runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl31.c | 426 ++++++++++++++++++++++++++++++ 6 files changed, 478 insertions(+) create mode 100644 m4/ltp-fcntl.m4 create mode 100644 testcases/kernel/syscalls/fcntl/fcntl31.cm4/ltp-fcntl.m4 new file +27
-0@@ -0,0 +1,46 @@ +dnl +dnl Copyright (c) 2014 Fujitsu Ltd. +dnl Author: Xiaoguang Wang <[email protected]> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +dnl + +dnl +dnl LTP_CHECK_SYSCALL_FCNTL +dnl ---------------------------- +dnl +AC_DEFUN([LTP_CHECK_SYSCALL_FCNTL],[dnl + AC_MSG_CHECKING([for fcntl f_owner_ex]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ +#define _GNU_SOURCE
m4/ltp-fcntl.m4 line 37
Quoted 10 lines
m4/ltp-fcntl.m4 new file +10
-0+#include <stdio.h> +#include <unistd.h> +#include <fcntl.h> +int main(void) { + struct f_owner_ex tst_own_ex; + FILE *fp; + + fp = tmpfile(); + fcntl(fileno(fp), F_GETOWN_EX, &tst_own_ex); + return 0;
I guess that simpler:
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
#define _GNU_SOURCE
#include <fcntl.h>
int main(void) {
struct f_owner_ex tst_own_ex;
return 0;
}])], ...
Should work as well.
m4/ltp-fcntl.m4 line 46
Quoted 9 lines
m4/ltp-fcntl.m4 new file +9
-0+}])],[has_f_owner_ex="yes"]) + +if test "x$has_f_owner_ex" = xyes; then + AC_DEFINE(HAVE_STRUCT_F_OWNER_EX,1,[Define to 1 if you have struct f_owner_ex]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi +])
Also shouldn't be this check added to configure.ac (similary to the rest of them)?
Quoted 125 lines
runtest/ltplite +1
-0@@ -225,6 +225,7 @@ fcntl26 fcntl26 # fcntl28 fcntl28 fcntl29 fcntl29 fcntl30 fcntl30 +fcntl31 fcntl31 fdatasync01 fdatasync01 fdatasync02 fdatasync02runtest/stress.part3 +1
-0@@ -164,6 +164,7 @@ fcntl26 fcntl26 # fcntl28 fcntl28 fcntl29 fcntl29 fcntl30 fcntl30 +fcntl31 fcntl31 fdatasync01 fdatasync01 fdatasync02 fdatasync02runtest/syscalls +2
-0@@ -256,6 +256,8 @@ fcntl29 fcntl29 fcntl29_64 fcntl29_64 fcntl30 fcntl30 fcntl30_64 fcntl30_64 +fcntl31 fcntl31 +fcntl31_64 fcntl31_64 fdatasync01 fdatasync01 fdatasync02 fdatasync02testcases/kernel/syscalls/.gitignore +2
-0@@ -218,6 +218,8 @@ /fcntl/fcntl29_64 /fcntl/fcntl30 /fcntl/fcntl30_64 +/fcntl/fcntl31 +/fcntl/fcntl31_64 /fdatasync/fdatasync01 /fdatasync/fdatasync02 /flock/flock01testcases/kernel/syscalls/fcntl/fcntl31.c new file +69
-0@@ -0,0 +1,426 @@ +/* +* Copyright (c) 2014 Fujitsu Ltd. +* Author: Xiaoguang Wang <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it would be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +/* +* Description: +* Verify that: +* Basic test for fcntl(2) using F_GETOWN, F_SETOWN, F_GETOWN_EX, +* F_SETOWN_EX, F_GETSIG, F_SETSIG argument. +*/ + +#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <string.h> +#include <signal.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <pwd.h> +#include <sched.h> + +#include "test.h" +#include "config.h" +#include "usctest.h" +#include "linux_syscall_numbers.h" +#include "safe_macros.h" + + +static void setup (void ); +static void cleanup (void ); + +static void setown_pid_test (void ); +static void setown_pgrp_test (void ); + +static void set_get_own_cleanup (void ); + +#if defined(HAVE_STRUCT_F_OWNER_EX ) +static int setownex_pid_setup (void ); +static int setownex_pgrp_setup (void ); +static int setownex_tid_setup (void ); + +static void setownex_test (void ); +static void setownex_cleanup (void ); + +static struct f_owner_ex tst_own_ex; +static struct f_owner_ex orig_own_ex; +#endif + +static void sig_func (int signo); + +static void signal_parent (void ); +static void wait_io_ready (void ); +static void test_set_and_get_sig (int sig); + +static pid_t pid;
testcases/kernel/syscalls/fcntl/fcntl31.c line 79
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +10
-0+static pid_t orig_pid; +static pid_t pgrp_pid; + +static int test_fd; +static int pipe_fds[2 ]; +static int ind; +static int ownex_enabled; + +/* record the io events signal */ +static int io_signal_received;
This should be volatile sig_atomic_t
Quoted 35 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +35
-0+ + +static struct test_case_t { +int cmd; +int (*setup)(void ); +void (*testfunc)(void ); +void (*cleanup)(void ); +char *des; +} test_cases[] = { + {F_SETOWN ,NULL , setown_pid_test, set_get_own_cleanup, +"F_SETOWN for process ID" }, + {F_SETOWN ,NULL , setown_pgrp_test, set_get_own_cleanup, +"F_SETOWN for process group ID" }, +#if defined(HAVE_STRUCT_F_OWNER_EX) + {F_SETOWN_EX , setownex_tid_setup, setownex_test, + setownex_cleanup,"F_SETOWN_EX for thread ID" }, + {F_SETOWN_EX , setownex_pid_setup, setownex_test, + setownex_cleanup,"F_SETOWN_EX for process ID" }, + {F_SETOWN_EX , setownex_pgrp_setup, setownex_test, + setownex_cleanup,"F_SETOWN_EX for process group ID" }, +#endif +}; + +char *TCID ="fcntl31" ; +int TST_TOTAL =ARRAY_SIZE (test_cases); + + +int main (int ac,char **av) +{ +int lc; +char *msg; +int i; + + msg =parse_opts (ac, av,NULL ,NULL ); +if (msg !=NULL )
testcases/kernel/syscalls/fcntl/fcntl31.c line 124
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +10
-0+tst_brkm (TBROK ,NULL ,"OPTION PARSING ERROR - %s" , msg); + +setup (); + +for (lc =0 ;TEST_LOOPING (lc); lc++) { + tst_count =0 ; + + ind =-1 ; +for (i =0 ; i <TST_TOTAL ; i++) { + ind++;
This is ugly, if the testcase needs to get something from it's test structure make the testfunc prototype to:
void (*testfunc)(struct test_case_t *self)
And pass the pointer to the structure to it.
testcases/kernel/syscalls/fcntl/fcntl31.c line 129
Quoted 5 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +5
-0+if (test_cases[i].setup && test_cases[i].setup () !=0 ) +continue ; + +if (test_cases[i].testfunc) + test_cases[i].testfunc ();
I would drop this if, a test without test function is nonsense.
testcases/kernel/syscalls/fcntl/fcntl31.c line 132
Quoted 2 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +2
-0+if (test_cases[i].cleanup) + test_cases[i].cleanup ();
Also I wonder if it makes sense to create a test_case_t structure and fill it with information when the main loop just calls a function. You can do the same just with an array of functions...
Quoted 82 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +82
-0+ } + } + +cleanup (); +tst_exit (); +} + +static void setup (void ) +{ +int ret; + +tst_sig (FORK ,DEF_HANDLER , cleanup); + +tst_tmpdir (); + +TEST_PAUSE ; + +/* we have the tests on pipe */ +SAFE_PIPE (cleanup, pipe_fds); + test_fd = pipe_fds[0 ]; +if (fcntl (test_fd,F_SETFL ,O_ASYNC ) <0 ) +tst_brkm (TBROK |TERRNO , cleanup,"fcntl set O_ASYNC failed" ); + + pid =getpid (); + + ret =setpgrp (); +if (ret <0 ) +tst_brkm (TBROK |TERRNO , cleanup,"setpgrp() failed" ); + pgrp_pid =getpgid (0 ); +if (pgrp_pid <0 ) +tst_brkm (TBROK |TERRNO , cleanup,"getpgid() failed" ); + +#if defined(HAVE_STRUCT_F_OWNER_EX ) +if ((tst_kvercmp (2 ,6 ,32 )) <0 ) { +tst_resm (TCONF ,"F_GETOWN_EX and F_GETOWN_EX only run on " +"kernels that are 2.6.32 and higher" ); + }else { + ownex_enabled =1 ; + +/* get original f_owner_ex info */ +TEST (fcntl (test_fd,F_GETOWN_EX , &orig_own_ex)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl get original f_owner_ex info failed" ); + } + } +#endif + +/* get original pid info */ +TEST (fcntl (test_fd,F_GETOWN )); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl get original pid info failed" ); + } + orig_pid =TEST_RETURN ; + +if (signal (SIGIO , sig_func) ==SIG_ERR ) { +tst_brkm (TBROK |TERRNO , cleanup, +"set signal handler for SIGIO failed" ); + } +if (signal (SIGUSR1 , sig_func) ==SIG_ERR ) { +tst_brkm (TBROK |TERRNO , cleanup, +"set signal handler for SIGUSR1 failed" ); + } +} + +static void sig_func (int signo) +{ +int ret; +pid_t signaled_pid; +char c; + + signaled_pid =getpid (); + +/* +* just check the signal received in parent process, in case +* signal is sent to a process group. +*/ +if (signaled_pid != pid) +return ; + +switch (signo) {
testcases/kernel/syscalls/fcntl/fcntl31.c line 224
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +10
-0+case SIGUSR1 : + io_signal_received =SIGUSR1 ; +break ; +case SIGIO : + io_signal_received =SIGIO ; + } + + ret =read (pipe_fds[0 ], &c,1 ); +if (ret <0 ) +tst_resm (TINFO ,"no data is read" );
You should not call anything that is not signal-async-safe from signal handler. The tst_resm() is not signal-async-safe.
Quoted 66 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +66
-0+} + +static void setown_pid_test (void ) +{ +TEST (fcntl (test_fd,F_SETOWN , pid)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl F_SETOWN set process id failed" ); + } +test_set_and_get_sig (SIGUSR1 ); +} + +static void setown_pgrp_test (void ) +{ +TEST (fcntl (test_fd,F_SETOWN , -pgrp_pid)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl F_SETOWN set process group id failed" ); + } +test_set_and_get_sig (SIGUSR1 ); +} + +static void set_get_own_cleanup (void ) +{ +TEST (fcntl (test_fd,F_SETOWN , orig_pid)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl F_SETOWN restore orig_pid failed" ); + } +} + +#if defined(HAVE_STRUCT_F_OWNER_EX ) +static int setownex_pid_setup (void ) +{ +if (ownex_enabled ==0 ) +return 1 ; + + tst_own_ex.type =F_OWNER_PID ; + tst_own_ex.pid = pid; +return 0 ; +} + +static void setownex_test (void ) +{ +TEST (fcntl (test_fd,F_SETOWN_EX , &tst_own_ex)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl F_SETOWN_EX failed" ); + } +test_set_and_get_sig (SIGUSR1 ); +} + +static void setownex_cleanup (void ) +{ +TEST (fcntl (test_fd,F_SETOWN_EX , &orig_own_ex)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl F_SETOWN_EX restore orig_own_ex failed" ); + } +} + +static int setownex_pgrp_setup (void ) +{ +if (ownex_enabled ==0 ) +return 1 ; +
testcases/kernel/syscalls/fcntl/fcntl31.c line 300
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +10
-0+ tst_own_ex.type =F_OWNER_PGRP ; + tst_own_ex.pid = pgrp_pid; +return 0 ; +} + +static int setownex_tid_setup (void ) +{ +pid_t tid; + +if (ownex_enabled ==0 )
Shouldn't we rather print the TCONF here than in the global setup?
something this in global setup:
if (kernel_too_old) {
ownex_enabled = 0;
ownex_tconf_msg = "F_GETOWN_EX and F_GETOWN_EX needs kernel 2.6.32+"
}
and something as this here:
tst_resm(TCONF, ownex_tconf_msg);
because otherwise the number of tests for the testcase and number of passes/fails/tconfs does not add up.
Quoted 51 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +51
-0+return 1 ; + + tid =syscall (__NR_gettid); + tst_own_ex.type =F_OWNER_TID ; + tst_own_ex.pid = tid; +return 0 ; +} +#endif + +static void test_set_and_get_sig (int sig) +{ +int orig_sig; + +TEST (fcntl (test_fd,F_GETSIG )); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl(fd, F_GETSIG) get orig_sig failed" ); + } + orig_sig =TEST_RETURN ; + +if (orig_sig ==0 || orig_sig ==SIGIO ) +tst_resm (TINFO ,"default io events signal is SIGIO" ); + +TEST (fcntl (test_fd,F_SETSIG , sig)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl(fd, F_SETSIG, SIG: %d) failed" , sig); + } + +TEST (fcntl (test_fd,F_GETSIG )); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl(fd, F_GETSIG) get the set signal failed" ); + } +if (TEST_RETURN != sig) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl F_SETSIG set SIG: %d failed" , sig); + } + +wait_io_ready (); + +/* restore the default signal*/ +TEST (fcntl (test_fd,F_SETSIG , orig_sig)); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup, +"fcntl restore default signal failed" ); + } +} + +static void signal_parent (void ) +{
testcases/kernel/syscalls/fcntl/fcntl31.c line 361
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +10
-0+int ret, fd; + + fd = pipe_fds[1 ]; +close (pipe_fds[0 ]); + + ret =write (fd,"c" ,1 ); + +switch (ret) { +case 0 : +fprintf (stderr,"No data written, something is wrong" );
Missing newline at the end of string
Quoted 6 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +6
-0+break ; +case -1 : +fprintf (stderr,"Failed to write to pipe: %s\n" , +strerror (errno)); + } +
testcases/kernel/syscalls/fcntl/fcntl31.c line 377
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +10
-0+close (fd); +return ; +} + +static void wait_io_ready (void ) +{ +pid_t child; +int i; + +fflush (stdout);
You should use tst_flush() or tst_fork() instead.
Note: I've just added the tst_fork() and updated the test writing
guidelines.
testcases/kernel/syscalls/fcntl/fcntl31.c line 378
Quoted 1 line
testcases/kernel/syscalls/fcntl/fcntl31.c new file +1
-0+ child =FORK_OR_VFORK ();
The rest of the testcase would not run on uClinux so there is no reason to use FORK_OR_VFORK() instead of fork().
Quoted 8 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +8
-0+if (child <0 ) +tst_brkm (TBROK |TERRNO , cleanup,"fork failed" ); + +if (child ==0 ) { +signal_parent (); +exit (0 ); + }else { +/*
testcases/kernel/syscalls/fcntl/fcntl31.c line 396
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +10
-0+* if io_signal_received is not changed by signal handler +* in 5 seconds, consider the test failed. +*/ +for (i =0 ; i <1000 ; i++) { +/* SIGUSR1 or SIGIO is received*/ +if (io_signal_received >0 ) +break ; +sched_yield (); +usleep (5000 ); + }
You can use sigtimedwait() instead :)
Quoted 29 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +29
-0+switch (io_signal_received) { +case SIGUSR1 : +tst_resm (TPASS ,"fcntl test %s success" , + test_cases[ind].des); +break ; +case SIGIO : +tst_resm (TFAIL ,"received default SIGIO, fcntl test " +"%s failed" , test_cases[ind].des); +break ; +default : +tst_brkm (TBROK , cleanup,"fcntl io events " +"signal mechanism work abnormally" ); + } + io_signal_received =0 ; +wait (NULL ); + } +} + +static void cleanup (void ) +{ +TEST_CLEANUP ; + +if (pipe_fds[0 ] >0 ) +SAFE_CLOSE (NULL , pipe_fds[0 ]); +if (pipe_fds[1 ] >0 ) +SAFE_CLOSE (NULL , pipe_fds[1 ]); + +tst_rmdir (); +}
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [LTP] [PATCH v2 3/3] fcntl/fcntl31.c: add I/O availability signals test for fcntl(2)
Hi!
Quoted 16 lines
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl31.c new file +8
-0+} + +static void wait_io_ready (void ) +{ +pid_t child; +int i; + +fflush (stdout);You should use
tst_flush()ortst_fork()instead.Quoted 6 lines
Note: I've just added the
tst_fork()and updated the test writing
guidelines.testcases/kernel/syscalls/fcntl/fcntl31.c line 378
Quoted 1 line
testcases/kernel/syscalls/fcntl/fcntl31.c new file +1
-0+ child =FORK_OR_VFORK ();The rest of the testcase would not run on uClinux so there is no reason to use
FORK_OR_VFORK()instead offork().
Quoted 6 lines
You said that the rest of the testcase would not run on uClinux, so we should use fork or
tst_fork()directly.Now I couldn't figure it out why the rest of the testcase would not run on uClinux,
Makefilein syscalls does not filter out the fcntl directory. Could you give me some hint about this :-)
There is no fork() on uClinux, you have to emulate it using vfork() which starts a new process but the memory of the two processes is still shared (because there is no MMU) and if you do anything else than exec() the result is undefined. To overcome this testcases ported to uClinux self exec itself with special parameter that tells the test to run the child function directly. Look at the lib/self_exec.c source.
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 99 lines
create a new case to test
F_DUPFD_CLOEXECfor fcntl(2)Signed-off-by Xiaoguang Wang <[email protected]>--- runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl29.c | 124 ++++++++++++++++++++++++++++++ 5 files changed, 130 insertions(+) create mode 100644 testcases/kernel/syscalls/fcntl/fcntl29.cruntest/ltplite +1
-0@@ -223,6 +223,7 @@ fcntl26 fcntl26 # The tests for these system calls fcntl27 and fcntl28 are temporarily being disabled # fcntl27 fcntl27 # fcntl28 fcntl28 +fcntl29 fcntl29 fdatasync01 fdatasync01 fdatasync02 fdatasync02runtest/stress.part3 +1
-0@@ -162,6 +162,7 @@ fcntl26 fcntl26 # The tests for these system calls fcntl27 and fcntl28 are temporarily being disabled # fcntl27 fcntl27 # fcntl28 fcntl28 +fcntl29 fcntl29 fdatasync01 fdatasync01 fdatasync02 fdatasync02runtest/syscalls +2
-0@@ -252,6 +252,8 @@ fcntl27 fcntl27 fcntl27_64 fcntl27_64 fcntl28 fcntl28 fcntl28_64 fcntl28_64 +fcntl29 fcntl29 +fcntl29_64 fcntl29_64 fdatasync01 fdatasync01 fdatasync02 fdatasync02testcases/kernel/syscalls/.gitignore +2
-0@@ -214,6 +214,8 @@ /fcntl/fcntl27_64 /fcntl/fcntl28 /fcntl/fcntl28_64 +/fcntl/fcntl29 +/fcntl/fcntl29_64 /fdatasync/fdatasync01 /fdatasync/fdatasync02 /flock/flock01testcases/kernel/syscalls/fcntl/fcntl29.c new file +31
-0@@ -0,0 +1,124 @@ +/* +* Copyright (c) 2014 Fujitsu Ltd. +* Author: Xiaoguang Wang <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of version 2 of the GNU General Public License as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it would be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* +* You should have received a copy of the GNU General Public License along +* with this program; if not, write the Free Software Foundation, Inc., +* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +/* +* Description: +* Verify that, +* Basic test for fcntl(2) using F_DUPFD_CLOEXEC argument. +*/ + +#include <stdio.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <string.h> +#include <signal.h> +#include <sys/types.h> +#include <sys/stat.h>
testcases/kernel/syscalls/fcntl/fcntl29.c line 41
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl29.c new file +10
-0+#include <pwd.h> + +#include "test.h" +#include "usctest.h" +#include "safe_macros.h" + +char *TCID ="fcntl29" ; +int TST_TOTAL =1 ; + +#if defined(F_DUPFD_CLOEXEC )
You added a runtime test but the ifdef and the message if not found is still wrong.
What I would do is to is to add F_DUPFD_CLOEXEC to the include/lapi/fcntl.h (in similar manner to the O_CLOEXEC) include it here and remove the ifdefs completly.
Quoted 12 lines
testcases/kernel/syscalls/fcntl/fcntl29.c new file +12
-0+static void setup (void ); +static void cleanup (void ); + +static int test_fd; +static int dup_fd; + + +int main (int ac,char **av) +{ +int lc; +char *msg; +
testcases/kernel/syscalls/fcntl/fcntl29.c line 63
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl29.c new file +10
-0+ msg =parse_opts (ac, av,NULL ,NULL ); +if (msg !=NULL ) +tst_brkm (TBROK ,NULL ,"OPTION PARSING ERROR - %s" , msg); + +setup (); + +for (lc =0 ;TEST_LOOPING (lc); lc++) { + tst_count =0 ; + +TEST (fcntl (test_fd,F_DUPFD_CLOEXEC , dup_fd));
It would be more clear to explicitly pass zero instead of the dup_fd here.
testcases/kernel/syscalls/fcntl/fcntl29.c line 73
Quoted 10 lines
testcases/kernel/syscalls/fcntl/fcntl29.c new file +10
-0+if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup,"fcntl " +"test F_DUPFD_CLOEXEC failed" ); + } + dup_fd =TEST_RETURN ; + +TEST (fcntl (dup_fd,F_GETFD )); +if (TEST_RETURN <0 ) { +tst_brkm (TFAIL |TTERRNO , cleanup,"fcntl " +"test F_GETFD failed" );
close dup_fd here?
Quoted 51 lines
testcases/kernel/syscalls/fcntl/fcntl29.c new file +51
-0+ } + +if (TEST_RETURN &FD_CLOEXEC ) { +tst_resm (TPASS ,"fcntl test " +"F_DUPFD_CLOEXEC success" ); + }else { +tst_resm (TFAIL ,"fcntl test " +"F_DUPFD_CLOEXEC fail" ); + } + +SAFE_CLOSE (cleanup, dup_fd); + dup_fd =0 ; + } + +cleanup (); +tst_exit (); +} + +static void setup (void ) +{ +if ((tst_kvercmp (2 ,6 ,24 )) <0 ) { +tst_brkm (TCONF ,NULL ,"This test can only run on kernels" +"that are 2.6.24 and higher" ); + } + +tst_sig (NOFORK ,DEF_HANDLER , cleanup); + +tst_tmpdir (); + +TEST_PAUSE ; + + test_fd =SAFE_CREAT (cleanup,"testfile" ,0644 ); +} + +static void cleanup (void ) +{ +TEST_CLEANUP ; + +if (test_fd >0 ) +SAFE_CLOSE (NULL , test_fd); + +tst_rmdir (); +} +#else + +int main (void ) +{ +tst_brkm (TCONF ,NULL ,"This test can only run on kernels" +"that are 2.6.24 and higher" ); +} +#endif
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
PATCH v3 1/1 fcntl/fcntl29.c: add F_DUPFD_CLOEXEC test for fcntl(2)
create a new case to test F_DUPFD_CLOEXEC for fcntl(2)
--- include/lapi/fcntl.h | 4 ++ runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl29.c | 114 ++++++++++++++++++++++++++++++ 6 files changed, 124 insertions(+) create mode 100644 testcases/kernel/syscalls/fcntl/fcntl29.c
include/lapi/fcntl.h +4 -0
@@ -23,4 +23,8 @@# define O_CLOEXEC 02000000#endif +#ifndef F_DUPFD_CLOEXEC +# define F_DUPFD_CLOEXEC 1030 +#endif +#endif /* __LAPI_FCNTL_H__ */
runtest/ltplite +1 -0
@@ -223,6 +223,7 @@ fcntl26 fcntl26 # The tests for these system calls fcntl27 and fcntl28 are temporarily being disabled # fcntl27 fcntl27 # fcntl28 fcntl28 +fcntl29 fcntl29 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/stress.part3 +1 -0
@@ -162,6 +162,7 @@ fcntl26 fcntl26 # The tests for these system calls fcntl27 and fcntl28 are temporarily being disabled # fcntl27 fcntl27 # fcntl28 fcntl28 +fcntl29 fcntl29 fdatasync01 fdatasync01 fdatasync02 fdatasync02
runtest/syscalls +2 -0
@@ -252,6 +252,8 @@ fcntl27 fcntl27 fcntl27_64 fcntl27_64 fcntl28 fcntl28 fcntl28_64 fcntl28_64 +fcntl29 fcntl29 +fcntl29_64 fcntl29_64 fdatasync01 fdatasync01 fdatasync02 fdatasync02
testcases/kernel/syscalls/.gitignore +2 -0
@@ -214,6 +214,8 @@ /fcntl/fcntl27_64 /fcntl/fcntl28 /fcntl/fcntl28_64 +/fcntl/fcntl29 +/fcntl/fcntl29_64 /fdatasync/fdatasync01 /fdatasync/fdatasync02 /flock/flock01
testcases/kernel/syscalls/fcntl/fcntl29.c new file +114 -0
114 lines not on this page · raw message
Signature · 13 lines
1.8.2.1 ------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Wanlong Gao
AppliedQuoted 12 lines · Xiaoguang Wang
create a new case to test
F_DUPFD_CLOEXECfor fcntl(2)Signed-off-by Xiaoguang Wang <[email protected]>--- include/lapi/fcntl.h | 4 ++ runtest/ltplite | 1 + runtest/stress.part3 | 1 + runtest/syscalls | 2 + testcases/kernel/syscalls/.gitignore | 2 + testcases/kernel/syscalls/fcntl/fcntl29.c | 114 ++++++++++++++++++++++++++++++ 6 files changed, 124 insertions(+) create mode 100644 testcases/kernel/syscalls/fcntl/fcntl29.c
Applied, thank you.
Wanlong Gao
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list