]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python/samba/tests/blackbox: Fix undetected deltree fail
authorNoel Power <noel.power@suse.com>
Tue, 28 Jul 2020 15:21:17 +0000 (16:21 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 31 Aug 2020 17:44:38 +0000 (17:44 +0000)
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 <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
python/samba/tests/blackbox/smbcacls.py

index b749124ccacf3b1592ebc14155dd6bcb68a7a3d8..86e71d81257824cb8cead8e3789ef294583ba78b 100644 (file)
@@ -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)