Remove (some) bashisms from the test scripts

Uri Simchoni uri at samba.org
Fri Dec 22 08:35:02 UTC 2017


On 12/22/2017 03:58 AM, Timur I. Bakeyev via samba-technical wrote:
> Yet another fixes to make self-test work out of the box on FreeBSD.
> 
> Despite having '#!/bin/sh' in the test shell scripts there are some
> bashisms present,
> that make FreeBSD sh croak.
> 
> I've run Debian's 'checkbashisms' script against test scripts and tried to
> address most of it's (reasonable) warnings.
> 
> Also, one failing test spotted the place where direct call to the
> 'ldbsearch' wasn't replaced with the configurable path.
> 
> With best regards,
> Timur Bakeyev.
> 

We have another possible path - mark scripts which use bash syntax as
#!/bin/bash (or even "standardize" on bash).

There are tests which are truly bash-specific - I might have introduced
the first one and the bash dependency was discussed on the list (using
bash arrays - the shadow_copy2 test). I also (hours before this patch
submitted :)) updated the Samba wiki about the need to have bash to run
tests.

I personally find the bash syntax less error prone ([[ vs [ mostly) and
would prefer to keep the "bashisms" as bash scripts instead of shell
scripts, but I can see how there can be strong opinions to the other
side, so we should first solicit input on that and decide on the general
direction.

Thanks,
Uri.



More information about the samba-technical mailing list