abort01 testcase cleanup
Hi,
The attached patch do some cleanup in the abort01 testcase ...
1) The attempt to remove the generated core is wrong. The hard-coded `core' name is bad and the test temporary directory removal already take care of this.
2) Make the test fail gracefully if the running environment does not allow generating core files.
njoly@lanfeust [syscalls/abort]> ./abort01
abort01 1 TPASS : Test passed
njoly@lanfeust [syscalls/abort]> (ulimit -c 0 && ./abort01)
abort01 1 TCONF : core file size limit must be greater than 0.
Signature · 4 lines
Nicolas Joly Biological Software and Databanks. Institut Pasteur, Paris.
testcases/kernel/syscalls/abort/abort01.c +13 -1
@@ -43,6 +43,7 @@#include <stdlib.h> #include <unistd.h> #include <errno.h> +#include <sys/resource.h> #include <sys/types.h> #include <sys/wait.h>
@@ -157,7 +158,6 @@ int main(int argc, char *argv[])/*--------------------------------------------------------------*/ /* Clean up any files created by test before call to anyfail. */ -unlink ("core" );anyfail ();/* THIS CALL DOES NOT RETURN - EXITS!! */ return 0 ; }
@@ -183,6 +183,18 @@ int anyfail()void setup () { +struct rlimit lim; + +/* Ensure that core file size limit is greater than 0. */ +if (getrlimit (RLIMIT_CORE , &lim) ==-1 ) { +tst_resm (TFAIL |TERRNO ,"getrlimit RLIMIT_CORE failed" ); +tst_exit (); + } +if (lim.rlim_cur ==0 ) { +tst_resm (TCONF ,"core file size limit must be greater than 0." ); +tst_exit (); + } + temp = stderr;tst_tmpdir (); }
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 12 lines · Nicolas Joly
Hi,
The attached patch do some cleanup in the abort01 testcase ...
1) The attempt to remove the generated core is wrong. The hard-coded `core' name is bad and the test temporary directory removal already take care of this.
2) Make the test fail gracefully if the running environment does not allow generating core files.
Quoted 6 lines
njoly@lanfeust [syscalls/abort]> ./abort01
abort01 1 TPASS : Test passed
njoly@lanfeust [syscalls/abort]> (ulimit -c 0 && ./abort01) abort01 1 TCONF : core file size limit must be greater than 0.Signed-off-by Nicolas Joly <[email protected]>
Looks ok, but is there any particular reason why you removed the unlink(2) call? Thanks,
-Garrett
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 13 lines · Garrett Cooper
Quoted 12 lines · Nicolas Joly
Hi,
The attached patch do some cleanup in the abort01 testcase ...
1) The attempt to remove the generated core is wrong. The hard-coded `core' name is bad and the test temporary directory removal already take care of this.
2) Make the test fail gracefully if the running environment does not allow generating core files.
Quoted 8 lines
Quoted 6 lines
njoly@lanfeust [syscalls/abort]> ./abort01
abort01 1 TPASS : Test passed
njoly@lanfeust [syscalls/abort]> (ulimit -c 0 && ./abort01) abort01 1 TCONF : core file size limit must be greater than 0.Signed-off-by Nicolas Joly <[email protected]>Looks ok, but is there any particular reason why you removed the unlink(2) call?
The `unlink("core")' one ?
Well, at least RHEL do use `proc.<pid>' when generating core file names ... Not speaking about admins that might have configured it to use another scheme.
IMO, relying on a specific name, for a configurable system, is a bad idea; and can only lead to problems.
By example, this test from mkdir09.c cannot succeed on most RHEL systems:
/* Check for core file in test directory. */
if (access("core", 0) == 0) {
tst_resm(TWARN, "\tCore file found in test directory.");
tst_exit();
}Signature · 13 lines
Nicolas Joly Biological Software and Databanks. Institut Pasteur, Paris. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 32 lines · Nicolas Joly
Quoted 13 lines · Garrett Cooper
Quoted 12 lines · Nicolas Joly
Hi,
The attached patch do some cleanup in the abort01 testcase ...
1) The attempt to remove the generated core is wrong. The hard-coded `core' name is bad and the test temporary directory removal already take care of this.
2) Make the test fail gracefully if the running environment does not allow generating core files.
Quoted 8 lines
Quoted 6 lines
njoly@lanfeust [syscalls/abort]> ./abort01
abort01 1 TPASS : Test passed
njoly@lanfeust [syscalls/abort]> (ulimit -c 0 && ./abort01)
abort01 1 TCONF : core file size limit must be greater than 0.Signed-off-by Nicolas Joly <[email protected]>Looks ok, but is there any particular reason why you removed the unlink(2) call?
The `unlink("core")' one ?
Well, at least RHEL do use `proc.<pid>' when generating core file names ... Not speaking about admins that might have configured it to use another scheme.
IMO, relying on a specific name, for a configurable system, is a bad idea; and can only lead to problems.
Quoted 8 lines
By example, this test from
mkdir09.ccannot succeed on most RHEL systems:/* Check for core file in test directory. */ if (access("core", 0) == 0) { tst_resm(TWARN, "\tCore file found in test directory."); tst_exit(); }
Yeah. Perhaps it might be a good idea to integrate a tool into LTP which detects corefile names, like what's described here: http://aplawrence.com/Linux/limit_core_files.html . Cheers,
-Garrett
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 37 lines · Garrett Cooper
Quoted 35 lines · Nicolas Joly
Quoted 13 lines · Garrett Cooper
Quoted 12 lines · Nicolas Joly
Hi,
The attached patch do some cleanup in the abort01 testcase ...
1) The attempt to remove the generated core is wrong. The hard-coded `core' name is bad and the test temporary directory removal already take care of this.
2) Make the test fail gracefully if the running environment does not allow generating core files.
Quoted 8 lines
Quoted 6 lines
njoly@lanfeust [syscalls/abort]> ./abort01
abort01 1 TPASS : Test passed
njoly@lanfeust [syscalls/abort]> (ulimit -c 0 && ./abort01)
abort01 1 TCONF : core file size limit must be greater than 0.Signed-off-by Nicolas Joly <[email protected]>Looks ok, but is there any particular reason why you removed the unlink(2) call?
The `unlink("core")' one ?
Well, at least RHEL do use `proc.<pid>' when generating core file names ... Not speaking about admins that might have configured it to use another scheme.
IMO, relying on a specific name, for a configurable system, is a bad idea; and can only lead to problems.
By example, this test from
mkdir09.ccannot succeed on most RHEL systems:
Quoted 7 lines
Quoted 5 lines
/* Check for core file in test directory. */ if (access("core", 0) == 0) { tst_resm(TWARN, "\tCore file found in test directory."); tst_exit(); }Yeah. Perhaps it might be a good idea to integrate a tool into LTP which detects corefile names, like what's described here: http://aplawrence.com/Linux/limit_core_files.html .
If there is a real need, why not; but for the current use in syscall testcases, it seems a little overkill.
testcases/kernel/syscalls/abort/abort01.c testcases/kernel/syscalls/kill/kill11.c testcases/kernel/syscalls/mallopt/mallopt01.c testcases/kernel/syscalls/waitpid/waitpid02.c testcases/kernel/syscalls/waitpid/waitpid05.c
Remove core files that may have been created during the test ... The temp test directory removal can/do already remove them.
testcases/kernel/syscalls/mkdir/mkdir09.c testcases/kernel/syscalls/setrlimit/setrlimit01.c
Check that a childs does not have created a core file ... Could be tested from child process status instead.
Signature · 13 lines
Nicolas Joly Biological Software and Databanks. Institut Pasteur, Paris. ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Quoted 57 lines · Nicolas Joly
Quoted 37 lines · Garrett Cooper
Quoted 35 lines · Nicolas Joly
Quoted 13 lines · Garrett Cooper
Quoted 12 lines · Nicolas Joly
Hi,
The attached patch do some cleanup in the abort01 testcase ...
1) The attempt to remove the generated core is wrong. The hard-coded `core' name is bad and the test temporary directory removal already take care of this.
2) Make the test fail gracefully if the running environment does not allow generating core files.
Quoted 8 lines
Quoted 6 lines
njoly@lanfeust [syscalls/abort]> ./abort01
abort01 1 TPASS : Test passed
njoly@lanfeust [syscalls/abort]> (ulimit -c 0 && ./abort01) abort01 1 TCONF : core file size limit must be greater than 0.Signed-off-by Nicolas Joly <[email protected]>Looks ok, but is there any particular reason why you removed the unlink(2) call?
The `unlink("core")' one ?
Well, at least RHEL do use `proc.<pid>' when generating core file names ... Not speaking about admins that might have configured it to use another scheme.
IMO, relying on a specific name, for a configurable system, is a bad idea; and can only lead to problems.
By example, this test from
mkdir09.ccannot succeed on most RHEL systems:Quoted 7 lines
Quoted 5 lines
/* Check for core file in test directory. */
if (access("core", 0)== 0) {
tst_resm(TWARN, "\tCore file found in test directory.");tst_exit();
}Yeah. Perhaps it might be a good idea to integrate a tool into LTP which detects corefile names, like what's described here: http://aplawrence.com/Linux/limit_core_files.html .
If there is a real need, why not; but for the current use in syscall testcases, it seems a little overkill.
testcases/kernel/syscalls/abort/abort01.ctestcases/kernel/syscalls/kill/kill11.ctestcases/kernel/syscalls/mallopt/mallopt01.ctestcases/kernel/syscalls/waitpid/waitpid02.ctestcases/kernel/syscalls/waitpid/waitpid05.c
Remove core files that may have been created during the test ... The temp test directory removal can/do already remove them.
Quoted 4 lines
testcases/kernel/syscalls/mkdir/mkdir09.ctestcases/kernel/syscalls/setrlimit/setrlimit01.cCheck that a childs does not have created a core file ... Could be tested from child process status instead.
It's not required to fix this testcase (and I'll commit this once
I get back home), but it really should be added.
Thanks!
-Garrett
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list