From 05de29a4d08da37fc73ac4a297e43304240a3eb5 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 28 Jul 2020 16:21:17 +0100 Subject: [PATCH] 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 --- python/samba/tests/blackbox/smbcacls.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)