[PATCH] Add libsmbclient list shares test

Rowland Penny rpenny at samba.org
Wed Aug 29 07:28:20 UTC 2018


On Tue, 28 Aug 2018 16:42:13 -0700
Jeremy Allison via samba-technical <samba-technical at lists.samba.org>
wrote:

> On Tue, Aug 28, 2018 at 04:40:27PM -0700, Jeremy Allison via
> samba-technical wrote:
> > On Wed, Aug 29, 2018 at 01:34:02AM +0200, Stefan Metzmacher wrote:
> > > Am 29.08.2018 um 01:02 schrieb Jeremy Allison via samba-technical:
> > > > On Wed, Aug 29, 2018 at 12:58:12AM +0200, Stefan Metzmacher
> > > > wrote:
> > > >> Hi Jeremy,
> > > >>
> > > >>>> libsmbclient = smbtorture4_testsuites("libsmbclient.")
> > > >>>> for t in libsmbclient:
> > > >>>>     url = "smb://$USERNAME:$PASSWORD@$SERVER/tmp"
> > > >>>>     if "list_shares" in t:
> > > >>>>         url = "smb://$USERNAME:$PASSWORD@$SERVER"
> > > >>>>
> > > >>>> so for the 'list_shares' test it should have
> > > >>>> removed the /tmp from the end, and didn't.
> > > >>
> > > >> The name is "libsmbclient.list_shares", not just "list_shares".
> > > > 
> > > > Yes I already found and fixed that. It still fails
> > > > due to the libsmbclient tests being invoked from
> > > > inside source3/selftest/tests.py, whereas Andreas's
> > > > change only fixed the smburl in source4/selftest/tests.py
> > > > 
> > > > Whoever thought (a) writing this stuff in python was a good
> > > > idea and (b) naming things identially inside source3 and
> > > > source4 is responsible for a *LOT* of wasted engineering
> > > > time and effort..
> > > 
> > > That also applies to a lot of our C code...
> > 
> > Yes, but I understand and can fix that easily :-).
> > 
> > Same isn't true of python :-). Having said that I
> > figured it out (eventually) and sent a patch to
> > make it all work back to Andreas.
> 
> And of course who knows if I used idiomatic Paython2
> or the completely different language Python3, so will
> make Noel's porting to the new language problems harder.
> 
> Python really is a *terrible* choice.
> 

I have often thought this, I thought that to test something, you need
to do it in the environment it will be used in and in the way it will
be used. Testing things in any other way (e.g. testing samba-tool with
more python code) isn't really a good idea (to me anyway), you may get
a positive result, but can you be sure you are getting the correct
result ?

Rowland



More information about the samba-technical mailing list