Remove (some) bashisms from the test scripts

Uri Simchoni uri at samba.org
Wed Dec 27 05:36:53 UTC 2017


On 12/27/2017 07:28 AM, Timur I. Bakeyev wrote:
> Thanks, Uri!
> 
> But what is wrong with the ldbsearch one? It's obviously a bug in the
> script and that exposes clearly, if you compile with external t* libs.
> 
> With regards,
> Timur Bakeyev.
> 

Nothing is wrong IMHO but it requires two reviewers. Please bear with us :)

Thanks,
Uri.

> 
> On Wed, Dec 27, 2017 at 6:03 AM, Uri Simchoni <uri at samba.org
> <mailto:uri at samba.org>> wrote:
> 
>     On 12/26/2017 10:21 PM, Christof Schmitt wrote:
>     > On Mon, Dec 25, 2017 at 06:55:51AM +0200, Uri Simchoni wrote:
>     >> On 12/25/2017 05:07 AM, Christof Schmitt wrote:
>     >>> On Sat, Dec 23, 2017 at 09:38:06PM +0200, Uri Simchoni via
>     samba-technical wrote:
>     >>>
>     >>>> Other than that:
>     >>>> Just to make things clear - the Samba test suite policy has
>     always been
>     >>>> not to assume that /bin/sh is bash. On the build server, /bin/sh is
>     >>>> dash. It appears the "bashisms" you pointed out never execute
>     during
>     >>>> selftest (which means we don't have tests for
>     adding/removing/modifying
>     >>>> shares via RPC...).
>     >>>
>     >>> We do have tests for share management through RPC calls, see
>     >>> the test in source3/script/tests/test_rpcclientsrvsvc.sh. If
>     there are
>     >>> bashisms, then it looks like they are no problem with Debian's
>     dash, but
>     >>> mainly with FreeBSD.
>     >>>
>     >>> Christof
>     >>>
>     >>
>     >> Ok, missed that one. Sorry. But dash doesn't support '[['. When I run
>     >> that (unfixed) test using dash, the server log shows:
>     >>
>     >>
>     >> smbd version 4.8.0pre1-DEVELOPERBUILD started.
>     >> Copyright Andrew Tridgell and the Samba Team 1992-2017
>     >> Test dummy executed!
>     >> daemon_ready: STATUS=daemon 'smbd' finished starting up and ready to
>     >> serve connections
>     >> /home/uri/s2/bin/smbchangeshare: 23: /home/uri/s2/bin/smbchangeshare:
>     >> [[: not found
>     >> /home/uri/s2/bin/smbchangeshare: 30: /home/uri/s2/bin/smbchangeshare:
>     >> [[: not found
>     >> /home/uri/s2/bin/smbchangeshare: 37: /home/uri/s2/bin/smbchangeshare:
>     >> [[: not found
>     >> /home/uri/s2/bin/smbchangeshare: 44: /home/uri/s2/bin/smbchangeshare:
>     >> [[: not found
>     >> delete_share_security: Failed to delete entry for share srvsvctest:
>     >> NT_STATUS_NOT_FOUND
>     >>
>     >> ... and the test as a whole passes.
>     >
>     > Yes, i did also some testing and saw the same. It looks like the
>     effect
>     > of the wrong operator in dash is that the error message "[[: not
>     found"
>     > is issued and the check is ignored. As a result, the overall test
>     > succeeds, but it would fail to detect any errors from commands called
>     > form the smb*share scripts.
>     >
>     > We should simply fix them. +1 from me for the patch to use the
>     correct [
>     > operator.
>     >
>     > Christof
>     >
> 
>     Pushed that one (not the ldbsearch one).
> 
>     Thanks,
>     Uri
> 
> 




More information about the samba-technical mailing list