Re: [Patch] Fix output pattern checking issue

Yvan Roux <[email protected]>
Newsgroups gmane.comp.sysutils.dejagnu.general
Message-ID <CAD57uCf29+0pZtgQd1fjADyDsVdBA=uAFhT6_+GqrAcBSh50gw@mail.gmail.com>
Hi Ben,

On 15 March 2016 at 05:33, 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, but there is a
>> mismatch between native, where these kind of tests are ok, and
>> remote, where they fail.
>
> Natively, exec strips the newline (and there are no occurrences of
> "keenewline" in the source tree; I grepped).  Here's a simple test
> script (foo.exp):
>
>   set x [exec uptime]
>   set x2 [rsh_exec remotebox uptime "" "" ""]
>
>   note "local: >${x}<"
>   note "remote:>[lindex $x2 1]<"
>
> No newline in either case, which is what I would have expected.

Yes, I agree, but when we do native testing Tcl exec is not used to
execute the testcase, it is done by the spawn command, and with this
test script we do have a newline:

set x3 [remote_exec unix uptime ""]
note "unix native:>[lindex $x3 1]<"

So, I understand that rsh_exec has to be consistent with Tcl exec, but
ot have consistency between native and remote testing, maybe the right
fix is to add the "keepnewline" flag handling to rsh_exec nad use that
flag when calling this routine in remote_exec.

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.