reason why ipc_create fails on Solaris

View: New views
5 Messages — Rating Filter:   Alert me  

reason why ipc_create fails on Solaris

by Irene Huang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi, all

just found out that some of the ipc test  cases failed because the
ls/shell implementation on Solaris is different from that on linux.

if /tmp/testpipe does not exist
On Solaris sh, "ls /tmp/testpipe &> /dev/null" returns 0
While on linux, it returns a non-zero value as expected.  

If the test is all about deciding whether /tmp/testpipe exists or not,
I'd suggest using

        fail_unless(system("test -p /tmp/testpipe") == 0, NULL);
to make sure that the pipe /tmp/testpipe exists

        fail_unless(system("test -p /tmp/testpipe") != 0, NULL);
to make sure it doesn't exist.

Any comments?

--Irene



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: reason why ipc_create fails on Solaris

by Daniel Gollub :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 18 April 2008 20:36:18 Irene Huang wrote:

> just found out that some of the ipc test  cases failed because the
> ls/shell implementation on Solaris is different from that on linux.
>
> if /tmp/testpipe does not exist
> On Solaris sh, "ls /tmp/testpipe &> /dev/null" returns 0
> While on linux, it returns a non-zero value as expected.  
>
> If the test is all about deciding whether /tmp/testpipe exists or not,
> I'd suggest using
>
>         fail_unless(system("test -p /tmp/testpipe") == 0, NULL);
> to make sure that the pipe /tmp/testpipe exists
>
>         fail_unless(system("test -p /tmp/testpipe") != 0, NULL);
> to make sure it doesn't exist.
>
> Any comments?

I was never satisfied with all those system() calls in the testing code -
since this break the portability for sure in some places - like in this case.
We should try to get rid of all system(), if possible.

There are some tests which make use of system("diff ...."); which is very
likely not that trivial to get rid off.

I'll try to come up with some trivial patch to get rid of system calls which
check for existing directories/files. So this will also work in Windows -
hopefully ;)

Thanks for finding this!

best regards,
Daniel

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: reason why ipc_create fails on Solaris

by Daniel Gollub :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 19 April 2008 15:12:10 Daniel Gollub wrote:
> I'll try to come up with some trivial patch to get rid of system calls
> which check for existing directories/files. So this will also work in
> Windows - hopefully ;)

Here you go:

Introduces osync_testing_file_* helpers and makes those system(*file
operation*) obsolete:
http://opensync.org/changeset/3279

Make use of osync_testing_file_* handlers in ipc unittest instead of system()
calls:
http://opensync.org/changeset/3280

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: reason why ipc_create fails on Solaris

by Daniel Gollub :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Saturday 19 April 2008 16:14:29 Daniel Gollub wrote:

> On Saturday 19 April 2008 15:12:10 Daniel Gollub wrote:
> > I'll try to come up with some trivial patch to get rid of system calls
> > which check for existing directories/files. So this will also work in
> > Windows - hopefully ;)
>
> Here you go:
>
> Introduces osync_testing_file_* helpers and makes those system(*file
> operation*) obsolete:
> http://opensync.org/changeset/3279
>
> Make use of osync_testing_file_* handlers in ipc unittest instead of
> system() calls:
> http://opensync.org/changeset/3280
>


Build of r3280 on testhost "pingpong":
http://opensync.org/testing/testDetails.php?test=639&build=226

Running suite(s): IPC
45%: Checks: 20, Failures: 1, Errors: 10
-----
compared to older build with system calls:

Running suite(s): IPC
rm: /tmp/testpipe: No such file or directory
rm: /tmp/testpipe: No such file or directory
/tmp/testpipe: No such file or directory
/tmp/testpipe: No such file or directory
rm: /tmp/testpipe: No such file or directory
/tmp/testpipe
/tmp/testpipe: No such file or directory
rm: /tmp/testpipe: No such file or directory
rm: /tmp/testpipe: No such file or directory
/tmp/testpipe: No such file or directory
/tmp/testpipe: No such file or directory
rm: /tmp/testpipe: No such file or directory
/tmp/testpipe
/tmp/testpipe: No such file or directory
25%: Checks: 20, Failures: 5, Errors: 10

But there still lots of test where the test timeout expires ... i guess still
related to the missing HUP signal.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: reason why ipc_create fails on Solaris

by Irene Huang :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Daniel

Thanks for the patch :).
I am looking at the missing HUP issue right now. :).

--Irene
Daniel Gollub wrote:

> On Saturday 19 April 2008 16:14:29 Daniel Gollub wrote:
>  
>> On Saturday 19 April 2008 15:12:10 Daniel Gollub wrote:
>>    
>>> I'll try to come up with some trivial patch to get rid of system calls
>>> which check for existing directories/files. So this will also work in
>>> Windows - hopefully ;)
>>>      
>> Here you go:
>>
>> Introduces osync_testing_file_* helpers and makes those system(*file
>> operation*) obsolete:
>> http://opensync.org/changeset/3279
>>
>> Make use of osync_testing_file_* handlers in ipc unittest instead of
>> system() calls:
>> http://opensync.org/changeset/3280
>>
>>    
>
>
> Build of r3280 on testhost "pingpong":
> http://opensync.org/testing/testDetails.php?test=639&build=226
>
> Running suite(s): IPC
> 45%: Checks: 20, Failures: 1, Errors: 10
> -----
> compared to older build with system calls:
>
> Running suite(s): IPC
> rm: /tmp/testpipe: No such file or directory
> rm: /tmp/testpipe: No such file or directory
> /tmp/testpipe: No such file or directory
> /tmp/testpipe: No such file or directory
> rm: /tmp/testpipe: No such file or directory
> /tmp/testpipe
> /tmp/testpipe: No such file or directory
> rm: /tmp/testpipe: No such file or directory
> rm: /tmp/testpipe: No such file or directory
> /tmp/testpipe: No such file or directory
> /tmp/testpipe: No such file or directory
> rm: /tmp/testpipe: No such file or directory
> /tmp/testpipe
> /tmp/testpipe: No such file or directory
> 25%: Checks: 20, Failures: 5, Errors: 10
>
> But there still lots of test where the test timeout expires ... i guess still
> related to the missing HUP signal.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Opensync-devel mailing list
> Opensync-devel@...
> https://lists.sourceforge.net/lists/listinfo/opensync-devel
>  


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel