Re: [Patch] Fix output pattern checking issue

Yvan Roux <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <CAD57uCd=nMEO=7Uv5ZURPKsivT14O9QzHXAt1EQ8EEFvN-BEZA@mail.gmail.com>
Hi Ben

On 4 March 2016 at 23:35, Ben Elliston <[email protected]> wrote:
> On Fri, Mar 04, 2016 at 10:20:57PM +0100, Yvan Roux wrote:
>
>> there is an issue when remote testing testcases which check an
>> output pattern with an explicit '\n' at the end.  rsh_exec
>> explicitly removes it to behave as 'exec', I don't know if something
>> changed in 'exec' behavior since these lines were checked in in 2001
>> or if it still removes a '\n' in some configs,
>
> Tcl's exec has always stripped the trailing newline. This is why the
> -keepnewline option exists.


Yes indeed, thanks I'm still in a Tcl learning process ! ;)

So, after digging more to understand why we have the issue while exec
removes the trailing newline, it occurs when doing native testing,
unix_load calls remote_spawn, which calls standard_wait and then
remote_expect, I still have difficulties to understand exactly what
appends in this part (spawn/expect) but what seems clear is that we
don't use Tcl exec here, thus the trailing newline of the testcase
output is not removed, and as when we're doing remote testing rsh_exec
is designed to behave as Tcl exec we have a mismatch between outputs
of the same testcase in native and remote context.

Cheers,
Yvan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.