From: Noel Power Date: Tue, 28 Jul 2020 15:21:17 +0000 (+0100) Subject: python/samba/tests/blackbox: Fix undetected deltree fail X-Git-Tag: talloc-2.3.2~674 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=05de29a4d08da37fc73ac4a297e43304240a3eb5;p=thirdparty%2Fsamba.git python/samba/tests/blackbox: Fix undetected deltree fail With msdfs root share smbclient deltree command can fail without setting the errorcode (e.g. when do_list encounters an error it will log a warning message and continue rather than error out fatally) Signed-off-by: Noel Power Reviewed-by: Jeremy Allison --- diff --git a/python/samba/tests/blackbox/smbcacls.py b/python/samba/tests/blackbox/smbcacls.py index b749124ccac..86e71d81257 100644 --- a/python/samba/tests/blackbox/smbcacls.py +++ b/python/samba/tests/blackbox/smbcacls.py @@ -45,7 +45,9 @@ class SmbCaclsBlockboxTestBase(BlackboxTestCase): # so if we fail with remote remove perform local remove # (of remote files) instead smbclient_args = self.build_test_cmd("smbclient", ["//%s/%s" % (self.server, self.share), "-c", "deltree %s/*" % self.testdir]) - self.check_output(smbclient_args) + out = self.check_output(smbclient_args) + if "NT_STATUS_OBJECT_PATH_NOT_FOUND" in out.decode(): + raise Exception("deltree: failed without setting errcode") except Exception as e: print("remote remove failed: %s" % str(e)) dirpath = os.path.join(os.environ["LOCAL_PATH"],self.testdir)