bash/ldap failures

Rowland Penny rpenny at
Fri Mar 16 13:27:47 UTC 2018

On Fri, 16 Mar 2018 11:21:03 +0100
Aurélien Aptel via samba-technical <samba-technical at>

> Hi,
> I still run into LDAP test failures from case mismatch since last
> december. Andrew mentionned it was due to some sort of bash-ism? I'd
> like to understand more if anyone is willing to explain what those
> test are supposed to do and have an idea what exactly fails.
> I also run this failure:
>   FAILED:  samba3.blackbox.smbclient_s3.NT1.plain
> (nt4_dc).volume(nt4_dc) 
>   Error Message:
>   null
>   Stack Trace:
>   Traceback (most recent call last):
>   testtools.testresult.real._StringException: Exception: Exception:
> CLI_FORCE_INTERACTIVE=yes /home/ci/workspace/samba-ci/bin/smbclient
> -Uci%localntdc2pass //LOCALNT4DC2/tmp -I
> --configfile=/home/ci/workspace/samba-ci/st/client/client.conf -mNT1
> Try "help" to get a list of possible commands. smb: \> Volume: |tmp|
> serial number 0xad80a8b3 smb: \> 
>   failed doing volume command
> The test script is source3/script/tests/
>     echo "$out" | grep '^Volume: |tmp| serial number'
>     ret=$?
>     if [ $ret != 0 ] ; then
> 	echo "$out"
> 	echo "failed doing volume command"
> 	return 1
>     fi
> For some reason the input command ("volume\n") is not copied on the
> output so the test works if you remove the ^ at the start of the grep
> pattern (without the input string the "Volume:.." line ends up in the
> middle of the previous line instead of a new line). Until we know we
> the input is not copied in the output I can send a patch that removes
> that ^ check.
> Cheers,

I read this and thought I cannot add to the discussion and closed the
email, but something niggled at me, so I came back to it and read it
I then realised what it was and it was this:

echo "$out" | grep '^Volume: |data| serial number'
if [ $ret != 0 ] ; then
    echo "$out"
    echo "failed doing volume command"
    exit 1

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'

What I am trying to say is, the test could fail for something that is
nothing to do with 'smbclient'.



More information about the samba-technical mailing list