bash/ldap failures

Martin Schwenke martin at meltin.net
Fri May 4 04:35:03 UTC 2018


On Fri, 16 Mar 2018 14:54:31 +0100, Aurélien Aptel via samba-technical
<samba-technical at lists.samba.org> wrote:

> Rowland Penny via samba-technical <samba-technical at lists.samba.org>
> writes:
> > The earlier output is echoed through grep and if the return code
> > isn't zero, a message is printed, 'failed doing volume command'.
> >
> > If there is an error here, it possibly isn't coming from smbclient. It
> > could be wrong data in $out, an 'echo' error or a 'grep'
> > error.
> >
> > What I am trying to say is, the test could fail for something that is
> > nothing to do with 'smbclient'.  
> 
> As I said in my previous email, the script expects the input to be
> copied to the output:
> 
> The script sends "volume\nquit\n" as input to smbclient and expects this
> back:
> 
>   Try "help" to get a list of possible commands.
>   smb: \> volume
>   Volume: |tmp| serial number 0xad80a8b3
>   smb: \> quit
> 
> But the input isnt copied to the output, so it actually gets this back:
> 
>   Try "help" to get a list of possible commands.
>   smb: \> Volume: |tmp| serial number 0xad80a8b3
>   smb: \> 
> 
> The pattern "^Volume" matches only the first thing, not the second but
> the test is just looking for this Volume chain. The failure is
> incorrect.
> 
> I have no idea why the input isnt copied on the output. I've tried
> running this on a different machine and it passes. It could be that the
> shell have different behaviours regarding eval/echo/backticks together.

I'm quite confident that it isn't the shell that is copying input to
output.  I think readline() is doing that.  Perhaps different
versions of readline are behaving differently?  Or perhaps it depends
whether the test is run interactively via a tty or run from a cron job?

My question would be: Why does the test set CLI_FORCE_INTERACTIVE=yes?
The test doesn't check that the prompt is in the output and the test
does not need readline functionality.  So, in some circumstances the
unwanted prompt gets in the way of the test passing.

From my perspective, the best thing would be to drop
CLI_FORCE_INTERACTIVE=yes in test cases that aren't testing whether a
prompt is shown.

peace & happiness,
martin



More information about the samba-technical mailing list