[PATCH] smbtorture3 small improvements

Jeremy Allison jra at samba.org
Fri Oct 19 15:47:08 UTC 2018

On Fri, Oct 19, 2018 at 03:35:24PM +0200, Andreas Schneider via samba-technical wrote:
> Hello,
> We have several issues with smbtorture3. You can't run them twice because the 
> don't clean up afterwards. Thus tests are failing because the files they want 
> to create already exists.
> Issues in particular have:
> Normally if you write a testing tool you have setup and teardown functions, 
> the setup function create e.g. a test directory and then the teardown function 
> makes sure it gets removed afterwards. The teardown function is called even if 
> the tests fail.
> We have a very bad style when it comes to cleaning up in tests in general. In 
> this regard a lot of tests are written badly.
> If you want to reproduce, do the following:
> rm -rf st
> make -j8 test TESTS="^samba3.smbtorture_s3.plain"
> make -j8 test TESTS="^samba3.smbtorture_s3.plain"
> The first test run works, the second fails.
> How should cleanup be done, that no files and directories are left around for 
> the tests mentioned above?

I've also come across this and wrestled with it.

The problem is if the tests fail you might want to
see what debris got left behind in order to investigate
what exactly is going wrong.

Maybe default to teardown but add an option that
allows files to be left when being run manually ?


More information about the samba-technical mailing list