mirror of
https://github.com/samba-team/samba.git
synced 2025-12-17 04:23:50 +03:00
tests: Make clean_file() handle directories
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
b5392b552e
commit
9dd5e12cfa
@@ -59,7 +59,10 @@ class Smb2SymlinkTests(samba.tests.libsmb.LibsmbTests):
|
|||||||
try:
|
try:
|
||||||
conn.unlink(filename)
|
conn.unlink(filename)
|
||||||
except NTSTATUSError as e:
|
except NTSTATUSError as e:
|
||||||
if e.args[0] != ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND:
|
if e.args[0] == ntstatus.NT_STATUS_FILE_IS_A_DIRECTORY:
|
||||||
|
conn.rmdir(filename)
|
||||||
|
elif not (e.args[0] == ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND or
|
||||||
|
e.args[0] == ntstatus.NT_STATUS_OBJECT_PATH_NOT_FOUND):
|
||||||
raise
|
raise
|
||||||
|
|
||||||
def create_symlink(self, conn, target, symlink):
|
def create_symlink(self, conn, target, symlink):
|
||||||
|
|||||||
Reference in New Issue
Block a user