Bug 161773 - IShellService.runCommand gives strange output with WindowsXP (dstore)
Summary: IShellService.runCommand gives strange output with WindowsXP (dstore)
Status: CLOSED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 1.0   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 158312
  Show dependency tree
 
Reported: 2006-10-20 15:06 EDT by Lothar Werzinger CLA
Modified: 2008-08-13 13:08 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lothar Werzinger CLA 2006-10-20 15:06:30 EDT
IShellService.runCommand gives strange output with WindowsXP (dstore)
I tested with RSE 1.0RC1.

The output looks like this:

DataElement 
{
        Type:   command
        Name:   dir
        Value:  dir
        ID:     826407830
        Source: 
        Depth:  2
        DataStore:      172.16.92.128
}

DataElement 
{
        Type:   stdout
        Name:   
        Value:  
        ID:     -1734739135
        Source: 
        Depth:  2
        DataStore:      172.16.92.128
}

DataElement 
{
        Type:   stdout
        Name:    Volume in drive C has no label.
        Value:   Volume in drive C has no label.
        ID:     1348701698
        Source: 
        Depth:  2
        DataStore:      172.16.92.128
}
...

(see also https://bugs.eclipse.org/bugs/show_bug.cgi?id=158786#c10)

I don't know if this problem affects different Platform/OS, so I picked "All".
Feel free to change that if necessary.
Comment 1 Martin Oberhuber CLA 2006-10-20 17:03:44 EDT
Dave can you look at this?

The problem manifests in the remote cdt launcher, see also bug 158312. It might be that Ewa interprets the output from a destore IHostShell wrongly, but I'm not deep enough into dstore. I hope it's easy for you to see what's going on since you've done the IBM internal launcher.

I'm setting P2 since we'd REALLY like the remotecdt launcher to work with dstore as well and this is apparently a prerequisite.
Comment 2 David McKnight CLA 2006-10-23 14:33:16 EDT
I'm not sure how's this is being used, but the DStoreShellService returns DataElements as it's output in the DStoreOutputReader rather than straight lines of text.  DStoreServerCommandShell normally takes care of wrappering the elements, however that's at the subsystem layer rather than at the service layer.  I suppose it would be better if the service layer took care of all that, since consumers of that should not really know about dstore-specifics but sorting that out will have to wait.
Comment 3 Martin Oberhuber CLA 2006-10-24 14:39:07 EDT
I'd be ok saying that Services may do whatever is simple to implement; and that users of a service are required to use it at the subsystem layer in order to get extra functionality.

But I have looked at the DStoreServiceCommandShell and I'm finding that it's merely wrappering the DataObjects that it gets from the service into RemoteError / RemoteOutput objects. I cannot see how a client could request a stream from the DStoreServiceCommandShell that can be used for simple I/O.

Do we need additional API here, like IServiceCommandShell.getOutputStream() / getInputStream() ? Or do it at the service layer, and have IHostShell.getPlainOutputStream() / getPlainInputStream() ?
Comment 4 David McKnight CLA 2006-10-24 15:51:57 EDT
The way the dstore shell stuff works is the interpretation of lines is done on the backend - there is no "stream" that comes back - just the interpretted objects.
Comment 5 David McKnight CLA 2006-10-25 11:06:16 EDT
This will need to be looked at after the release so I'm going to lower the priority.
Comment 6 David McKnight CLA 2006-10-25 11:14:07 EDT
bringing back to p2 so that a workaround for this can be provided
Comment 7 David McKnight CLA 2006-10-25 11:22:11 EDT
as per committed meeting, I will change the IShellService layer to provide an IHostOutput object and a new API for getting IHostOuput from readline calls rather than Object.  Each IHostOutput object will have a getString() method.
Comment 8 David McKnight CLA 2006-10-25 12:07:32 EDT
I've changed things so that the IHostShellOutputReader returns a list of IHostOutput objects instead of generic Objects.  IHostOutput has a getString() method that should always return the actual line of shell output.  Try this out and see if this fixes the problem for you.
Comment 9 David McKnight CLA 2006-10-26 11:02:56 EDT
Now that everything is in IHostOutput form, you should be able to use these services consistently (and therefore runCommand should not have this issue).
Comment 10 Kushal Munir CLA 2006-10-31 17:57:34 EST
I'm not sure how to test this, but using the shell (through dstore) on Linux, Unix and Windows does not seem to have any problems that would be associated with this. This looks like an API change, and there does not appear to be any regression as a result.

Dave/Martin, should we close the bug or wait for bug 158312 to be closed.
Comment 11 Lothar Werzinger CLA 2006-11-02 17:50:50 EST
verified with  I20061102-1200
Comment 12 Martin Oberhuber CLA 2006-11-03 04:27:40 EST
closing.
Comment 13 Martin Oberhuber CLA 2008-08-13 13:08:10 EDT
[target cleanup] 1.0 RC3 was the original target milestone for this bug