[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Patch] Fix output pattern checking issue
From: |
Yvan Roux |
Subject: |
Re: [Patch] Fix output pattern checking issue |
Date: |
Thu, 17 Mar 2016 09:00:28 +0100 |
Hi Ben,
On 15 March 2016 at 05:33, Ben Elliston <address@hidden> 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