* [LTP] [PATCH] fix "sigaction" tests
@ 2010-11-01 6:22 Mitani
2010-11-01 7:08 ` Garrett Cooper
0 siblings, 1 reply; 12+ messages in thread
From: Mitani @ 2010-11-01 6:22 UTC (permalink / raw)
To: ltp-list; +Cc: 當座 健市
[-- Attachment #1: Type: text/plain, Size: 9054 bytes --]
Hi,
POSIX "conformance/interfaces/sigaction/16-1" and other 25 tests failed
with following message:
------------
conformance/interfaces/sigaction/16-1: execution: FAILED: Output:
Caught signal 6
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-1.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-10: execution: FAILED: Output:
Caught signal 13
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-10.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-11: execution: FAILED: Output:
Caught signal 3
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-11.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-12: execution: FAILED: Output:
Caught signal 11
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-12.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-13: execution: FAILED: Output:
Caught signal 15
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-13.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-14: execution: FAILED: Output:
Caught signal 20
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-14.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-15: execution: FAILED: Output:
Caught signal 21
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-15.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-16: execution: FAILED: Output:
Caught signal 22
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-16.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-17: execution: FAILED: Output:
Caught signal 10
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-17.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-18: execution: FAILED: Output:
Caught signal 12
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-18.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-19: execution: FAILED: Output:
Caught signal 29
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-19.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-2: execution: FAILED: Output:
Caught signal 14
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-2.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-20: execution: FAILED: Output:
Caught signal 27
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-20.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-21: execution: FAILED: Output:
Caught signal 31
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-21.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-22: execution: FAILED: Output:
Caught signal 5
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-22.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-23: execution: FAILED: Output:
Caught signal 23
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-23.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-24: execution: FAILED: Output:
Caught signal 26
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-24.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-25: execution: FAILED: Output:
Caught signal 24
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-25.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-26: execution: FAILED: Output:
Caught signal 25
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-26.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-3: execution: FAILED: Output:
Caught signal 7
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-3.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-4: execution: FAILED: Output:
Caught signal 17
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-4.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-5: execution: FAILED: Output:
Caught signal 18
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-5.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-6: execution: FAILED: Output:
Caught signal 8
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-6.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-7: execution: FAILED: Output:
Caught signal 1
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-7.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-8: execution: FAILED: Output:
Caught signal 4
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-8.c FAILED: The
function returned EINTR while SA_RESTART is set
conformance/interfaces/sigaction/16-9: execution: FAILED: Output:
Caught signal 2
[16:42:34]Test ../../../conformance/interfaces/sigaction/16-9.c FAILED: The
function returned EINTR while SA_RESTART is set
------------
Environment is as follows:
- RHEL4.8 (kernel version 2.6.9-89) --- (x86, x86_64, ia64)
- RHEL5.5 (kernel version 2.6.18-194) --- (x86, x86_64, ia64)
The cause of above error is that sem_wait() of the testing kernel version
always returns with EINTR.
"man sem_wait" says:
------------
[...]
EINTR The call was interrupted by a signal handler.
[...]
NOTES
A signal handler always interrupts a blocked call to one of these
functions, regardless
of the use of the sigaction(2) SA_RESTART flag.
POSIX.1-2001.
------------
And "man 7 signal" of "RHEL6.0 Beta"(*) says:
------------
If a blocked call to one of the following interfaces is interrupted
by
a signal handler, then the call will be automatically restarted
after
the signal handler returns if the SA_RESTART flag was used;
otherwise
the call will fail with the error EINTR:
[...]
* POSIX semaphore interfaces: sem_wait(3) and
sem_timedwait(3)
(since Linux 2.6.22; beforehand, always failed with EINTR).
[...]
Interruption of System Calls and Library Functions by Stop Signals
On Linux, even in the absence of signal handlers, certain
blocking
interfaces can fail with the error EINTR after the process is
stopped
by one of the stop signals and then resumed via SIGCONT.
This
behavior is not sanctioned by POSIX.1, and doesn’t occur on other
sys-
tems.
[...]
* Linux 2.6.21 and earlier: futex(2) FUTEX_WAIT,
sem_timedwait(3),
sem_wait(3).
------------
(*) -- Above description didn't exist in "man" of RHEL4.8/5.5.
But "man" of RHEL6.0 Beta says that "sem_wait()" failed in the
version earlier than Linux 2.6.22.
Therefore, These 26 tests are useful after 2.6.22 version, I think.
I tried to revised "testcases/open_posix_testsuite/conformance/interfaces/
sigaction/templates/template_16-1.in"
============
---
a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/
template_16-1.in 2010-10-14 03:58:31.000000000 +0900
+++
b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/
template_16-1.new 2010-10-18 17:47:40.000000000 +0900
@@ -55,6 +55,8 @@
#include <signal.h>
#include <errno.h>
+#include <sys/utsname.h>
+
/***************************************************************************
***/
/*************************** Test framework
*******************************/
/***************************************************************************
***/
@@ -124,6 +126,23 @@
return NULL;
}
+/* Checking for Kernel Version function */
+int kernel_ver_cmp(int k1, int k2, int k3)
+{
+ struct utsname buf;
+ int r1, r2, r3;
+
+ uname(&buf);
+ sscanf(buf.release, "%d.%d.%d", &r1, &r2, &r3);
+ if (r1 > k1)
+ return 0;
+ if (r2 > k2)
+ return 0;
+ if (r3 > k3)
+ return 0;
+ return 1;
+}
+
/* main function */
int main()
{
@@ -133,6 +152,12 @@
struct sigaction sa;
+ /* Checking for Kernel Version */
+ if ( kernel_ver_cmp(2, 6, 21) != 0 )
+ {
+ UNTESTED( "sem_wait() returned EINTR on kernel versions
lower than 2.6.22" );
+ }
+
/* Initialize output */
output_init();
============
Above patch is revision only for templates.
The following procedure is necessary after applying patch:
------------
#cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
#./gentests.pl
------------
Similar revisions are necessary for other 25 "sigaction" tests.
Regards--
-Tomonori Mitani
[-- Attachment #2: template_16-1.patch --]
[-- Type: application/octet-stream, Size: 1285 bytes --]
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.in 2010-10-14 03:58:31.000000000 +0900
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/template_16-1.new 2010-10-18 17:47:40.000000000 +0900
@@ -55,6 +55,8 @@
#include <signal.h>
#include <errno.h>
+#include <sys/utsname.h>
+
/******************************************************************************/
/*************************** Test framework *******************************/
/******************************************************************************/
@@ -124,6 +126,23 @@
return NULL;
}
+/* Checking for Kernel Version function */
+int kernel_ver_cmp(int k1, int k2, int k3)
+{
+ struct utsname buf;
+ int r1, r2, r3;
+
+ uname(&buf);
+ sscanf(buf.release, "%d.%d.%d", &r1, &r2, &r3);
+ if (r1 > k1)
+ return 0;
+ if (r2 > k2)
+ return 0;
+ if (r3 > k3)
+ return 0;
+ return 1;
+}
+
/* main function */
int main()
{
@@ -133,6 +152,12 @@
struct sigaction sa;
+ /* Checking for Kernel Version */
+ if ( kernel_ver_cmp(2, 6, 21) != 0 )
+ {
+ UNTESTED( "sem_wait() returned EINTR on kernel versions lower than 2.6.22" );
+ }
+
/* Initialize output */
output_init();
[-- Attachment #3: Type: text/plain, Size: 415 bytes --]
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-01 6:22 [LTP] [PATCH] fix "sigaction" tests Mitani
@ 2010-11-01 7:08 ` Garrett Cooper
2010-11-01 8:00 ` Gui Jianfeng
0 siblings, 1 reply; 12+ messages in thread
From: Garrett Cooper @ 2010-11-01 7:08 UTC (permalink / raw)
To: Mitani; +Cc: ltp-list, 當座 健市
2010/10/31 Mitani <mitani@ryobi.co.jp>:
> Hi,
>
>
> POSIX "conformance/interfaces/sigaction/16-1" and other 25 tests failed
> with following message:
> ------------
> conformance/interfaces/sigaction/16-1: execution: FAILED: Output:
> Caught signal 6
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-1.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-10: execution: FAILED: Output:
> Caught signal 13
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-10.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-11: execution: FAILED: Output:
> Caught signal 3
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-11.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-12: execution: FAILED: Output:
> Caught signal 11
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-12.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-13: execution: FAILED: Output:
> Caught signal 15
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-13.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-14: execution: FAILED: Output:
> Caught signal 20
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-14.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-15: execution: FAILED: Output:
> Caught signal 21
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-15.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-16: execution: FAILED: Output:
> Caught signal 22
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-16.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-17: execution: FAILED: Output:
> Caught signal 10
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-17.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-18: execution: FAILED: Output:
> Caught signal 12
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-18.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-19: execution: FAILED: Output:
> Caught signal 29
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-19.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-2: execution: FAILED: Output:
> Caught signal 14
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-2.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-20: execution: FAILED: Output:
> Caught signal 27
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-20.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-21: execution: FAILED: Output:
> Caught signal 31
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-21.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-22: execution: FAILED: Output:
> Caught signal 5
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-22.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-23: execution: FAILED: Output:
> Caught signal 23
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-23.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-24: execution: FAILED: Output:
> Caught signal 26
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-24.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-25: execution: FAILED: Output:
> Caught signal 24
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-25.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-26: execution: FAILED: Output:
> Caught signal 25
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-26.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-3: execution: FAILED: Output:
> Caught signal 7
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-3.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-4: execution: FAILED: Output:
> Caught signal 17
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-4.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-5: execution: FAILED: Output:
> Caught signal 18
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-5.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-6: execution: FAILED: Output:
> Caught signal 8
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-6.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-7: execution: FAILED: Output:
> Caught signal 1
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-7.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-8: execution: FAILED: Output:
> Caught signal 4
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-8.c FAILED: The
> function returned EINTR while SA_RESTART is set
> conformance/interfaces/sigaction/16-9: execution: FAILED: Output:
> Caught signal 2
> [16:42:34]Test ../../../conformance/interfaces/sigaction/16-9.c FAILED: The
> function returned EINTR while SA_RESTART is set
> ------------
>
> Environment is as follows:
> - RHEL4.8 (kernel version 2.6.9-89) --- (x86, x86_64, ia64)
> - RHEL5.5 (kernel version 2.6.18-194) --- (x86, x86_64, ia64)
>
>
> The cause of above error is that sem_wait() of the testing kernel version
> always returns with EINTR.
>
> "man sem_wait" says:
> ------------
> [...]
>
> EINTR The call was interrupted by a signal handler.
>
> [...]
>
> NOTES
> A signal handler always interrupts a blocked call to one of these
> functions, regardless
> of the use of the sigaction(2) SA_RESTART flag.
>
> POSIX.1-2001.
> ------------
>
>
> And "man 7 signal" of "RHEL6.0 Beta"(*) says:
> ------------
> If a blocked call to one of the following interfaces is interrupted
> by
> a signal handler, then the call will be automatically restarted
> after
> the signal handler returns if the SA_RESTART flag was used;
> otherwise
> the call will fail with the error EINTR:
>
> [...]
>
> * POSIX semaphore interfaces: sem_wait(3) and
> sem_timedwait(3)
> (since Linux 2.6.22; beforehand, always failed with EINTR).
>
> [...]
>
> Interruption of System Calls and Library Functions by Stop Signals
> On Linux, even in the absence of signal handlers, certain
> blocking
> interfaces can fail with the error EINTR after the process is
> stopped
> by one of the stop signals and then resumed via SIGCONT.
> This
> behavior is not sanctioned by POSIX.1, and doesn’t occur on other
> sys-
> tems.
>
> [...]
>
> * Linux 2.6.21 and earlier: futex(2) FUTEX_WAIT,
> sem_timedwait(3),
> sem_wait(3).
>
> ------------
> (*) -- Above description didn't exist in "man" of RHEL4.8/5.5.
> But "man" of RHEL6.0 Beta says that "sem_wait()" failed in the
> version earlier than Linux 2.6.22.
>
>
> Therefore, These 26 tests are useful after 2.6.22 version, I think.
>
> I tried to revised "testcases/open_posix_testsuite/conformance/interfaces/
> sigaction/templates/template_16-1.in"
>
> ============
> ---
> a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/
> template_16-1.in 2010-10-14 03:58:31.000000000 +0900
> +++
> b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/templates/
> template_16-1.new 2010-10-18 17:47:40.000000000 +0900
> @@ -55,6 +55,8 @@
> #include <signal.h>
> #include <errno.h>
>
> +#include <sys/utsname.h>
> +
>
> /***************************************************************************
> ***/
> /*************************** Test framework
> *******************************/
>
> /***************************************************************************
> ***/
> @@ -124,6 +126,23 @@
> return NULL;
> }
>
> +/* Checking for Kernel Version function */
> +int kernel_ver_cmp(int k1, int k2, int k3)
> +{
> + struct utsname buf;
> + int r1, r2, r3;
> +
> + uname(&buf);
> + sscanf(buf.release, "%d.%d.%d", &r1, &r2, &r3);
> + if (r1 > k1)
> + return 0;
> + if (r2 > k2)
> + return 0;
> + if (r3 > k3)
> + return 0;
> + return 1;
> +}
> +
> /* main function */
> int main()
> {
> @@ -133,6 +152,12 @@
>
> struct sigaction sa;
>
> + /* Checking for Kernel Version */
> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
> + {
> + UNTESTED( "sem_wait() returned EINTR on kernel versions
> lower than 2.6.22" );
> + }
> +
> /* Initialize output */
> output_init();
>
> ============
>
> Above patch is revision only for templates.
> The following procedure is necessary after applying patch:
> ------------
> #cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
> #./gentests.pl
> ------------
>
> Similar revisions are necessary for other 25 "sigaction" tests.
Sorry, but Linux-isms can't leak into the open_posix_testsuite.
Same with BSDisms (at least they shouldn't... if they do, then slap me
or whoever did the commit).
Thanks!
-Garrett
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-01 7:08 ` Garrett Cooper
@ 2010-11-01 8:00 ` Gui Jianfeng
2010-11-01 9:43 ` Garrett Cooper
0 siblings, 1 reply; 12+ messages in thread
From: Gui Jianfeng @ 2010-11-01 8:00 UTC (permalink / raw)
To: Garrett Cooper; +Cc: ltp-list, 當座 健市, Mitani
Garrett Cooper wrote:
> 2010/10/31 Mitani <mitani@ryobi.co.jp>:
...
>> int main()
>> {
>> @@ -133,6 +152,12 @@
>>
>> struct sigaction sa;
>>
>> + /* Checking for Kernel Version */
>> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
>> + {
>> + UNTESTED( "sem_wait() returned EINTR on kernel versions
>> lower than 2.6.22" );
>> + }
>> +
>> /* Initialize output */
>> output_init();
>>
>> ============
>>
>> Above patch is revision only for templates.
>> The following procedure is necessary after applying patch:
>> ------------
>> #cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
>> #./gentests.pl
>> ------------
>>
>> Similar revisions are necessary for other 25 "sigaction" tests.
>
> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
> Same with BSDisms (at least they shouldn't... if they do, then slap me
> or whoever did the commit).
Do you mean the culprit is Linux-isms?
IMO, the test cases are good.
Gui
> Thanks!
> -Garrett
>
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-01 8:00 ` Gui Jianfeng
@ 2010-11-01 9:43 ` Garrett Cooper
2010-11-18 4:35 ` Bian Naimeng
0 siblings, 1 reply; 12+ messages in thread
From: Garrett Cooper @ 2010-11-01 9:43 UTC (permalink / raw)
To: Gui Jianfeng; +Cc: ltp-list, 當座 健市, Mitani
On Mon, Nov 1, 2010 at 1:00 AM, Gui Jianfeng <guijianfeng@cn.fujitsu.com> wrote:
> Garrett Cooper wrote:
>> 2010/10/31 Mitani <mitani@ryobi.co.jp>:
> ...
>>> int main()
>>> {
>>> @@ -133,6 +152,12 @@
>>>
>>> struct sigaction sa;
>>>
>>> + /* Checking for Kernel Version */
>>> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
>>> + {
>>> + UNTESTED( "sem_wait() returned EINTR on kernel versions
>>> lower than 2.6.22" );
>>> + }
>>> +
>>> /* Initialize output */
>>> output_init();
>>>
>>> ============
>>>
>>> Above patch is revision only for templates.
>>> The following procedure is necessary after applying patch:
>>> ------------
>>> #cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
>>> #./gentests.pl
>>> ------------
>>>
>>> Similar revisions are necessary for other 25 "sigaction" tests.
>>
>> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
>> Same with BSDisms (at least they shouldn't... if they do, then slap me
>> or whoever did the commit).
>
> Do you mean the culprit is Linux-isms?
Mitani-san is proposing that I `fix' the testcases to work on RHEL
4.8. These testcases should function with minimal change for all
versions of Unix.
...
Thanks,
-Garrett
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-01 9:43 ` Garrett Cooper
@ 2010-11-18 4:35 ` Bian Naimeng
2010-11-18 4:37 ` Garrett Cooper
0 siblings, 1 reply; 12+ messages in thread
From: Bian Naimeng @ 2010-11-18 4:35 UTC (permalink / raw)
To: Garrett Cooper; +Cc: Mitani, 當座 健市, ltp-list
Garrett Cooper wrote:
> On Mon, Nov 1, 2010 at 1:00 AM, Gui Jianfeng <guijianfeng@cn.fujitsu.com> wrote:
>> Garrett Cooper wrote:
>>> 2010/10/31 Mitani <mitani@ryobi.co.jp>:
>> ...
>>>> int main()
>>>> {
>>>> @@ -133,6 +152,12 @@
>>>>
>>>> struct sigaction sa;
>>>>
>>>> + /* Checking for Kernel Version */
>>>> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
>>>> + {
>>>> + UNTESTED( "sem_wait() returned EINTR on kernel versions
>>>> lower than 2.6.22" );
>>>> + }
>>>> +
>>>> /* Initialize output */
>>>> output_init();
>>>>
>>>> ============
>>>>
>>>> Above patch is revision only for templates.
>>>> The following procedure is necessary after applying patch:
>>>> ------------
>>>> #cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
>>>> #./gentests.pl
>>>> ------------
>>>>
>>>> Similar revisions are necessary for other 25 "sigaction" tests.
>>> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
>>> Same with BSDisms (at least they shouldn't... if they do, then slap me
>>> or whoever did the commit).
>> Do you mean the culprit is Linux-isms?
>
> Mitani-san is proposing that I `fix' the testcases to work on RHEL
> 4.8. These testcases should function with minimal change for all
> versions of Unix.
>
This open_posix_suite is the part of LTP(linux test project), must we
make sure it can work at all versions of unix?
What about this patch? If you think so, other similar patchs will be post.
-------------------------------------------------------------------------------
At older linux kernel(2.6.22 before), a signal handler always interrupts a
blocked call to one of these functions, regardless of the use of the sigaction
SA_RESTART flag, so we should not test these cases at this situation.
Althought uname is not exsit at 4.3 BSD, but this open_posix_suite just
the part of LTP(linux test project), so i think it's not a problem.
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
---
.../conformance/interfaces/sigaction/16-1.c | 27 ++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
index 706dbfc..3d6e1a1 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
@@ -50,6 +50,7 @@ Anyway, a false negative status cannot be returned.
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <sys/utsname.h>
#include <semaphore.h>
#include <signal.h>
@@ -95,6 +96,27 @@ Anyway, a false negative status cannot be returned.
volatile sig_atomic_t caught = 0;
sem_t sem;
+#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
+
+int check_linux()
+{
+ struct utsname tn;
+ int r1, r2, r3;
+
+ if (0 > uname(&tn)) {
+ UNRESOLVED( errno, "uname failed" );
+ }
+
+ if (strcmp(tn.sysname, "Linux") != 0)
+ return 0;
+
+ sscanf(tn.release, "%d.%d.%d", &r1, &r2, &r3);
+ if (KERNEL_VERSION(r1, r2, r3) >= KERNEL_VERSION(2, 6, 22))
+ return 1;
+
+ return 0;
+}
+
/* Handler function */
void handler( int signo )
{
@@ -133,6 +155,11 @@ int main()
struct sigaction sa;
+ if (!check_linux())
+ UNTESTED( "A signal handler always interrupts sem_wait "
+ "at linux release, regardless of the use of "
+ "the sigaction SA_RESTART flag" );
+
/* Initialize output */
output_init();
--
1.6.5.2
--
Regards
Bian Naimeng
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply related [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-18 4:35 ` Bian Naimeng
@ 2010-11-18 4:37 ` Garrett Cooper
2010-11-18 4:59 ` Bian Naimeng
0 siblings, 1 reply; 12+ messages in thread
From: Garrett Cooper @ 2010-11-18 4:37 UTC (permalink / raw)
To: Bian Naimeng; +Cc: Mitani, 當座 健市, ltp-list
2010/11/17 Bian Naimeng <biannm@cn.fujitsu.com>:
>
>
> Garrett Cooper wrote:
>> On Mon, Nov 1, 2010 at 1:00 AM, Gui Jianfeng <guijianfeng@cn.fujitsu.com> wrote:
>>> Garrett Cooper wrote:
>>>> 2010/10/31 Mitani <mitani@ryobi.co.jp>:
>>> ...
>>>>> int main()
>>>>> {
>>>>> @@ -133,6 +152,12 @@
>>>>>
>>>>> struct sigaction sa;
>>>>>
>>>>> + /* Checking for Kernel Version */
>>>>> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
>>>>> + {
>>>>> + UNTESTED( "sem_wait() returned EINTR on kernel versions
>>>>> lower than 2.6.22" );
>>>>> + }
>>>>> +
>>>>> /* Initialize output */
>>>>> output_init();
>>>>>
>>>>> ============
>>>>>
>>>>> Above patch is revision only for templates.
>>>>> The following procedure is necessary after applying patch:
>>>>> ------------
>>>>> #cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
>>>>> #./gentests.pl
>>>>> ------------
>>>>>
>>>>> Similar revisions are necessary for other 25 "sigaction" tests.
>>>> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
>>>> Same with BSDisms (at least they shouldn't... if they do, then slap me
>>>> or whoever did the commit).
>>> Do you mean the culprit is Linux-isms?
>>
>> Mitani-san is proposing that I `fix' the testcases to work on RHEL
>> 4.8. These testcases should function with minimal change for all
>> versions of Unix.
>>
>
> This open_posix_suite is the part of LTP(linux test project), must we
> make sure it can work at all versions of unix?
I use it in FreeBSD and others have used it in other versions of Unix
(in the past), based on the README. There's no reason why we need to
maintain something that philosophically diverges from the upstream
project's goal because it will make merging more painful and
unnecessary.
> What about this patch? If you think so, other similar patchs will be post.
>
> -------------------------------------------------------------------------------
>
> At older linux kernel(2.6.22 before), a signal handler always interrupts a
> blocked call to one of these functions, regardless of the use of the sigaction
> SA_RESTART flag, so we should not test these cases at this situation.
>
> Althought uname is not exsit at 4.3 BSD, but this open_posix_suite just
> the part of LTP(linux test project), so i think it's not a problem.
>
> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>
> ---
> .../conformance/interfaces/sigaction/16-1.c | 27 ++++++++++++++++++++
> 1 files changed, 27 insertions(+), 0 deletions(-)
>
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
> index 706dbfc..3d6e1a1 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
> @@ -50,6 +50,7 @@ Anyway, a false negative status cannot be returned.
> #include <stdlib.h>
> #include <string.h>
> #include <unistd.h>
> +#include <sys/utsname.h>
>
> #include <semaphore.h>
> #include <signal.h>
> @@ -95,6 +96,27 @@ Anyway, a false negative status cannot be returned.
> volatile sig_atomic_t caught = 0;
> sem_t sem;
>
> +#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
> +
> +int check_linux()
> +{
> + struct utsname tn;
> + int r1, r2, r3;
> +
> + if (0 > uname(&tn)) {
> + UNRESOLVED( errno, "uname failed" );
> + }
> +
> + if (strcmp(tn.sysname, "Linux") != 0)
> + return 0;
> +
> + sscanf(tn.release, "%d.%d.%d", &r1, &r2, &r3);
> + if (KERNEL_VERSION(r1, r2, r3) >= KERNEL_VERSION(2, 6, 22))
> + return 1;
> +
> + return 0;
> +}
> +
> /* Handler function */
> void handler( int signo )
> {
> @@ -133,6 +155,11 @@ int main()
>
> struct sigaction sa;
>
> + if (!check_linux())
> + UNTESTED( "A signal handler always interrupts sem_wait "
> + "at linux release, regardless of the use of "
> + "the sigaction SA_RESTART flag" );
> +
> /* Initialize output */
> output_init();
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-18 4:37 ` Garrett Cooper
@ 2010-11-18 4:59 ` Bian Naimeng
2010-11-18 6:57 ` Mitani
2010-11-19 13:16 ` Cyril Hrubis
0 siblings, 2 replies; 12+ messages in thread
From: Bian Naimeng @ 2010-11-18 4:59 UTC (permalink / raw)
To: Garrett Cooper; +Cc: Mitani, 當座 健市, ltp-list
Garrett Cooper wrote:
> 2010/11/17 Bian Naimeng <biannm@cn.fujitsu.com>:
>>
>> Garrett Cooper wrote:
>>> On Mon, Nov 1, 2010 at 1:00 AM, Gui Jianfeng <guijianfeng@cn.fujitsu.com> wrote:
>>>> Garrett Cooper wrote:
>>>>> 2010/10/31 Mitani <mitani@ryobi.co.jp>:
>>>> ...
>>>>>> int main()
>>>>>> {
>>>>>> @@ -133,6 +152,12 @@
>>>>>>
>>>>>> struct sigaction sa;
>>>>>>
>>>>>> + /* Checking for Kernel Version */
>>>>>> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
>>>>>> + {
>>>>>> + UNTESTED( "sem_wait() returned EINTR on kernel versions
>>>>>> lower than 2.6.22" );
>>>>>> + }
>>>>>> +
>>>>>> /* Initialize output */
>>>>>> output_init();
>>>>>>
>>>>>> ============
>>>>>>
>>>>>> Above patch is revision only for templates.
>>>>>> The following procedure is necessary after applying patch:
>>>>>> ------------
>>>>>> #cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
>>>>>> #./gentests.pl
>>>>>> ------------
>>>>>>
>>>>>> Similar revisions are necessary for other 25 "sigaction" tests.
>>>>> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
>>>>> Same with BSDisms (at least they shouldn't... if they do, then slap me
>>>>> or whoever did the commit).
>>>> Do you mean the culprit is Linux-isms?
>>> Mitani-san is proposing that I `fix' the testcases to work on RHEL
>>> 4.8. These testcases should function with minimal change for all
>>> versions of Unix.
>>>
>> This open_posix_suite is the part of LTP(linux test project), must we
>> make sure it can work at all versions of unix?
>
> I use it in FreeBSD and others have used it in other versions of Unix
> (in the past), based on the README. There's no reason why we need to
> maintain something that philosophically diverges from the upstream
> project's goal because it will make merging more painful and
> unnecessary.
>
OK, i get it. Thanks. ^_^
Then, whether should we remove the following case, because it invokes
the uname that it's not exsit at 4.3 BSD.
conformance/interfaces/pthread_mutex_init/speculative/5-2.c
Thanks
Bian
>> What about this patch? If you think so, other similar patchs will be post.
>>
>> -------------------------------------------------------------------------------
>>
>> At older linux kernel(2.6.22 before), a signal handler always interrupts a
>> blocked call to one of these functions, regardless of the use of the sigaction
>> SA_RESTART flag, so we should not test these cases at this situation.
>>
>> Althought uname is not exsit at 4.3 BSD, but this open_posix_suite just
>> the part of LTP(linux test project), so i think it's not a problem.
>>
>> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>>
>> ---
>> .../conformance/interfaces/sigaction/16-1.c | 27 ++++++++++++++++++++
>> 1 files changed, 27 insertions(+), 0 deletions(-)
>>
>> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
>> index 706dbfc..3d6e1a1 100644
>> --- a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
>> +++ b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16-1.c
>> @@ -50,6 +50,7 @@ Anyway, a false negative status cannot be returned.
>> #include <stdlib.h>
>> #include <string.h>
>> #include <unistd.h>
>> +#include <sys/utsname.h>
>>
>> #include <semaphore.h>
>> #include <signal.h>
>> @@ -95,6 +96,27 @@ Anyway, a false negative status cannot be returned.
>> volatile sig_atomic_t caught = 0;
>> sem_t sem;
>>
>> +#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
>> +
>> +int check_linux()
>> +{
>> + struct utsname tn;
>> + int r1, r2, r3;
>> +
>> + if (0 > uname(&tn)) {
>> + UNRESOLVED( errno, "uname failed" );
>> + }
>> +
>> + if (strcmp(tn.sysname, "Linux") != 0)
>> + return 0;
>> +
>> + sscanf(tn.release, "%d.%d.%d", &r1, &r2, &r3);
>> + if (KERNEL_VERSION(r1, r2, r3) >= KERNEL_VERSION(2, 6, 22))
>> + return 1;
>> +
>> + return 0;
>> +}
>> +
>> /* Handler function */
>> void handler( int signo )
>> {
>> @@ -133,6 +155,11 @@ int main()
>>
>> struct sigaction sa;
>>
>> + if (!check_linux())
>> + UNTESTED( "A signal handler always interrupts sem_wait "
>> + "at linux release, regardless of the use of "
>> + "the sigaction SA_RESTART flag" );
>> +
>> /* Initialize output */
>> output_init();
>
>
--
Regards
Bian Naimeng
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-18 4:59 ` Bian Naimeng
@ 2010-11-18 6:57 ` Mitani
2010-11-18 7:50 ` Bian Naimeng
2010-11-19 13:16 ` Cyril Hrubis
1 sibling, 1 reply; 12+ messages in thread
From: Mitani @ 2010-11-18 6:57 UTC (permalink / raw)
To: 'Bian Naimeng', Garrett Cooper; +Cc: ltp-list
> -----Original Message-----
> From: Bian Naimeng [mailto:biannm@cn.fujitsu.com]
> Sent: Thursday, November 18, 2010 2:00 PM
> To: Garrett Cooper
> Cc: Gui Jianfeng; ltp-list@lists.sourceforge.net; 當座 健市; Mitani
> Subject: Re: [LTP] [PATCH] fix "sigaction" tests
>
>
>
> Garrett Cooper wrote:
> > 2010/11/17 Bian Naimeng <biannm@cn.fujitsu.com>:
> >>
> >> Garrett Cooper wrote:
> >>> On Mon, Nov 1, 2010 at 1:00 AM, Gui Jianfeng
> <guijianfeng@cn.fujitsu.com> wrote:
> >>>> Garrett Cooper wrote:
> >>>>> 2010/10/31 Mitani <mitani@ryobi.co.jp>:
> >>>> ...
> >>>>>> int main()
> >>>>>> {
> >>>>>> @@ -133,6 +152,12 @@
> >>>>>>
> >>>>>> struct sigaction sa;
> >>>>>>
> >>>>>> + /* Checking for Kernel Version */
> >>>>>> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
> >>>>>> + {
> >>>>>> + UNTESTED( "sem_wait() returned EINTR on kernel
> versions
> >>>>>> lower than 2.6.22" );
> >>>>>> + }
> >>>>>> +
> >>>>>> /* Initialize output */
> >>>>>> output_init();
> >>>>>>
> >>>>>> ============
> >>>>>>
> >>>>>> Above patch is revision only for templates.
> >>>>>> The following procedure is necessary after applying patch:
> >>>>>> ------------
> >>>>>> #cd
> testcases/open_posix_testsuite/conformance/interfaces/sigaction/
> >>>>>> #./gentests.pl
> >>>>>> ------------
> >>>>>>
> >>>>>> Similar revisions are necessary for other 25 "sigaction" tests.
> >>>>> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
> >>>>> Same with BSDisms (at least they shouldn't... if they do, then slap
> me
> >>>>> or whoever did the commit).
> >>>> Do you mean the culprit is Linux-isms?
> >>> Mitani-san is proposing that I `fix' the testcases to work on RHEL
> >>> 4.8. These testcases should function with minimal change for all
> >>> versions of Unix.
> >>>
> >> This open_posix_suite is the part of LTP(linux test project), must
> we
> >> make sure it can work at all versions of unix?
> >
> > I use it in FreeBSD and others have used it in other versions of Unix
> > (in the past), based on the README. There's no reason why we need to
> > maintain something that philosophically diverges from the upstream
> > project's goal because it will make merging more painful and
> > unnecessary.
> >
>
> OK, i get it. Thanks. ^_^
>
> Then, whether should we remove the following case, because it invokes
> the uname that it's not exsit at 4.3 BSD.
> conformance/interfaces/pthread_mutex_init/speculative/5-2.c
>
> Thanks
> Bian
>
> >> What about this patch? If you think so, other similar patchs will
> be post.
> >>
> >>
> --------------------------------------------------------------------
> -----------
> >>
> >> At older linux kernel(2.6.22 before), a signal handler always
> interrupts a
> >> blocked call to one of these functions, regardless of the use of the
> sigaction
> >> SA_RESTART flag, so we should not test these cases at this situation.
> >>
> >> Althought uname is not exsit at 4.3 BSD, but this open_posix_suite
> just
> >> the part of LTP(linux test project), so i think it's not a problem.
> >>
> >> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
> >>
> >> ---
> >> .../conformance/interfaces/sigaction/16-1.c | 27
> ++++++++++++++++++++
> >> 1 files changed, 27 insertions(+), 0 deletions(-)
> >>
> >> diff --git
> a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
> -1.c
> b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
> -1.c
> >> index 706dbfc..3d6e1a1 100644
> >> ---
> a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
> -1.c
> >> +++
> b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
> -1.c
> >> @@ -50,6 +50,7 @@ Anyway, a false negative status cannot be returned.
> >> #include <stdlib.h>
> >> #include <string.h>
> >> #include <unistd.h>
> >> +#include <sys/utsname.h>
> >>
> >> #include <semaphore.h>
> >> #include <signal.h>
> >> @@ -95,6 +96,27 @@ Anyway, a false negative status cannot be returned.
> >> volatile sig_atomic_t caught = 0;
> >> sem_t sem;
> >>
> >> +#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) +
> (c))
> >> +
> >> +int check_linux()
> >> +{
> >> + struct utsname tn;
> >> + int r1, r2, r3;
> >> +
> >> + if (0 > uname(&tn)) {
> >> + UNRESOLVED( errno, "uname failed" );
> >> + }
> >> +
> >> + if (strcmp(tn.sysname, "Linux") != 0)
> >> + return 0;
> >> +
> >> + sscanf(tn.release, "%d.%d.%d", &r1, &r2, &r3);
> >> + if (KERNEL_VERSION(r1, r2, r3) >= KERNEL_VERSION(2, 6, 22))
> >> + return 1;
> >> +
> >> + return 0;
> >> +}
> >> +
> >> /* Handler function */
> >> void handler( int signo )
> >> {
> >> @@ -133,6 +155,11 @@ int main()
> >>
> >> struct sigaction sa;
> >>
> >> + if (!check_linux())
> >> + UNTESTED( "A signal handler always interrupts sem_wait
> "
> >> + "at linux release, regardless of the use
> of "
> >> + "the sigaction SA_RESTART flag" );
> >> +
> >> /* Initialize output */
> >> output_init();
> >
> >
>
> --
> Regards
> Bian Naimeng
I applied Bian's patch in my system, and build succeeded.
I'm OK with the Bian's patch.
Thank you--
-Tomonori Mitani
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-18 6:57 ` Mitani
@ 2010-11-18 7:50 ` Bian Naimeng
0 siblings, 0 replies; 12+ messages in thread
From: Bian Naimeng @ 2010-11-18 7:50 UTC (permalink / raw)
To: Mitani; +Cc: ltp-list
>> testcases/open_posix_testsuite/conformance/interfaces/sigaction/
>>>>>>>> #./gentests.pl
>>>>>>>> ------------
>>>>>>>>
>>>>>>>> Similar revisions are necessary for other 25 "sigaction" tests.
>>>>>>> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
>>>>>>> Same with BSDisms (at least they shouldn't... if they do, then slap
>> me
>>>>>>> or whoever did the commit).
>>>>>> Do you mean the culprit is Linux-isms?
>>>>> Mitani-san is proposing that I `fix' the testcases to work on RHEL
>>>>> 4.8. These testcases should function with minimal change for all
>>>>> versions of Unix.
>>>>>
>>>> This open_posix_suite is the part of LTP(linux test project), must
>> we
>>>> make sure it can work at all versions of unix?
>>> I use it in FreeBSD and others have used it in other versions of Unix
>>> (in the past), based on the README. There's no reason why we need to
>>> maintain something that philosophically diverges from the upstream
>>> project's goal because it will make merging more painful and
>>> unnecessary.
>>>
>> OK, i get it. Thanks. ^_^
>>
>> Then, whether should we remove the following case, because it invokes
>> the uname that it's not exsit at 4.3 BSD.
>> conformance/interfaces/pthread_mutex_init/speculative/5-2.c
>>
>> Thanks
>> Bian
>>
>>>> What about this patch? If you think so, other similar patchs will
>> be post.
>>>>
>> --------------------------------------------------------------------
>> -----------
>>>> At older linux kernel(2.6.22 before), a signal handler always
>> interrupts a
>>>> blocked call to one of these functions, regardless of the use of the
>> sigaction
>>>> SA_RESTART flag, so we should not test these cases at this situation.
>>>>
>>>> Althought uname is not exsit at 4.3 BSD, but this open_posix_suite
>> just
>>>> the part of LTP(linux test project), so i think it's not a problem.
>>>>
>>>> Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
>>>>
>>>> ---
>>>> .../conformance/interfaces/sigaction/16-1.c | 27
>> ++++++++++++++++++++
>>>> 1 files changed, 27 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git
>> a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
>> -1.c
>> b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
>> -1.c
>>>> index 706dbfc..3d6e1a1 100644
>>>> ---
>> a/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
>> -1.c
>>>> +++
>> b/testcases/open_posix_testsuite/conformance/interfaces/sigaction/16
>> -1.c
>>>> @@ -50,6 +50,7 @@ Anyway, a false negative status cannot be returned.
>>>> #include <stdlib.h>
>>>> #include <string.h>
>>>> #include <unistd.h>
>>>> +#include <sys/utsname.h>
>>>>
>>>> #include <semaphore.h>
>>>> #include <signal.h>
>>>> @@ -95,6 +96,27 @@ Anyway, a false negative status cannot be returned.
>>>> volatile sig_atomic_t caught = 0;
>>>> sem_t sem;
>>>>
>>>> +#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) +
>> (c))
>>>> +
>>>> +int check_linux()
>>>> +{
>>>> + struct utsname tn;
>>>> + int r1, r2, r3;
>>>> +
>>>> + if (0 > uname(&tn)) {
>>>> + UNRESOLVED( errno, "uname failed" );
>>>> + }
>>>> +
>>>> + if (strcmp(tn.sysname, "Linux") != 0)
>>>> + return 0;
>>>> +
Sorry for my mistake, here should return 1.
>>>> + sscanf(tn.release, "%d.%d.%d", &r1, &r2, &r3);
>>>> + if (KERNEL_VERSION(r1, r2, r3) >= KERNEL_VERSION(2, 6, 22))
>>>> + return 1;
>>>> +
>>>> + return 0;
>>>> +}
>>>> +
>>>> /* Handler function */
>>>> void handler( int signo )
>>>> {
>>>> @@ -133,6 +155,11 @@ int main()
>>>>
>>>> struct sigaction sa;
>>>>
>>>> + if (!check_linux())
>>>> + UNTESTED( "A signal handler always interrupts sem_wait
>> "
>>>> + "at linux release, regardless of the use
>> of "
>>>> + "the sigaction SA_RESTART flag" );
>>>> +
>>>> /* Initialize output */
>>>> output_init();
>>>
>> --
>> Regards
>> Bian Naimeng
>
>
> I applied Bian's patch in my system, and build succeeded.
>
> I'm OK with the Bian's patch.
>
Thanks for confirmation.
--
Regards
Bian Naimeng
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [LTP] [PATCH] fix "sigaction" tests
2010-11-18 4:59 ` Bian Naimeng
2010-11-18 6:57 ` Mitani
@ 2010-11-19 13:16 ` Cyril Hrubis
[not found] ` <4CE9CAE0.2070808@cn.fujitsu.com>
1 sibling, 1 reply; 12+ messages in thread
From: Cyril Hrubis @ 2010-11-19 13:16 UTC (permalink / raw)
To: Bian Naimeng; +Cc: ?c?? ???s, ltp-list, Mitani
Hi!
> >>>> ...
> >>>>>> int main()
> >>>>>> {
> >>>>>> @@ -133,6 +152,12 @@
> >>>>>>
> >>>>>> struct sigaction sa;
> >>>>>>
> >>>>>> + /* Checking for Kernel Version */
> >>>>>> + if ( kernel_ver_cmp(2, 6, 21) != 0 )
> >>>>>> + {
> >>>>>> + UNTESTED( "sem_wait() returned EINTR on kernel versions
> >>>>>> lower than 2.6.22" );
> >>>>>> + }
> >>>>>> +
> >>>>>> /* Initialize output */
> >>>>>> output_init();
> >>>>>>
> >>>>>> ============
> >>>>>>
> >>>>>> Above patch is revision only for templates.
> >>>>>> The following procedure is necessary after applying patch:
> >>>>>> ------------
> >>>>>> #cd testcases/open_posix_testsuite/conformance/interfaces/sigaction/
> >>>>>> #./gentests.pl
> >>>>>> ------------
> >>>>>>
> >>>>>> Similar revisions are necessary for other 25 "sigaction" tests.
> >>>>> Sorry, but Linux-isms can't leak into the open_posix_testsuite.
> >>>>> Same with BSDisms (at least they shouldn't... if they do, then slap me
> >>>>> or whoever did the commit).
> >>>> Do you mean the culprit is Linux-isms?
> >>> Mitani-san is proposing that I `fix' the testcases to work on RHEL
> >>> 4.8. These testcases should function with minimal change for all
> >>> versions of Unix.
> >>>
> >> This open_posix_suite is the part of LTP(linux test project), must we
> >> make sure it can work at all versions of unix?
> >
> > I use it in FreeBSD and others have used it in other versions of Unix
> > (in the past), based on the README. There's no reason why we need to
> > maintain something that philosophically diverges from the upstream
> > project's goal because it will make merging more painful and
> > unnecessary.
> >
>
> OK, i get it. Thanks. ^_^
>
> Then, whether should we remove the following case, because it invokes
> the uname that it's not exsit at 4.3 BSD.
> conformance/interfaces/pthread_mutex_init/speculative/5-2.c
>
The uname() is part of the POSIX, for sure it's available on BSD.
Thinking of it, the patch that checks for kernel version only when
sysname == Linux should compile and work. But the question here is if we
want to bloat the tests with workarounds for broken systems. I would
rather see this covered by a database of known issues, so you can easily
copare results and read why your system is broken.
--
Cyril Hrubis
chrubis@suse.cz
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-11-25 19:26 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-01 6:22 [LTP] [PATCH] fix "sigaction" tests Mitani
2010-11-01 7:08 ` Garrett Cooper
2010-11-01 8:00 ` Gui Jianfeng
2010-11-01 9:43 ` Garrett Cooper
2010-11-18 4:35 ` Bian Naimeng
2010-11-18 4:37 ` Garrett Cooper
2010-11-18 4:59 ` Bian Naimeng
2010-11-18 6:57 ` Mitani
2010-11-18 7:50 ` Bian Naimeng
2010-11-19 13:16 ` Cyril Hrubis
[not found] ` <4CE9CAE0.2070808@cn.fujitsu.com>
2010-11-25 18:44 ` Cyril Hrubis
[not found] ` <AANLkTim2rWksdiugWwFU_TRu44t5gqzHFwJPYLV-YdsY@mail.gmail.com>
2010-11-25 19:38 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox