]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: fix test teardown/cleanup of test_create_reparse_directory()
authorRalph Boehme <slow@samba.org>
Tue, 26 Nov 2024 16:06:06 +0000 (17:06 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 27 Nov 2024 18:22:28 +0000 (18:22 +0000)
This kept failing in a local make test not being able to cleanup the test
directory in the *subsequent* test test_create_reparse_nonempty_directory().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
python/samba/tests/reparsepoints.py

index 42f301f4e24e34ecef4f6f31b618298002256c03..130fdca911c44bc4a42f355134eae4fc260a1eee 100644 (file)
@@ -237,10 +237,14 @@ class ReparsePoints(samba.tests.libsmb.LibsmbTests):
             err = e.args[0]
             if (err != ntstatus.NT_STATUS_ACCESS_DENIED):
                 raise
+        finally:
+            conn.close(dir_fd)
+            self.clean_file(conn, dirname)
 
         if (err == ntstatus.NT_STATUS_ACCESS_DENIED):
             self.fail("Could not set reparse point on directory")
-            conn.delete_on_close(fd, 1)
+            conn.close(dir_fd)
+            self.clean_file(conn, dirname)
             return
 
         with self.assertRaises(NTSTATUSError) as e: