From 04b9446b2a06362a85fde456fbb2fdc0ef3fd69e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 2 Jan 2007 13:48:42 +0000 Subject: r20474: Skip the delete-on-close test on a non-empty directory in raw-unlink for Samba3. This is a known deficiency also taken care of in the base-delete test. Volker (This used to be commit 6b91bb93fad84e054c19f8c9bc4145234f171a3c) --- source4/torture/raw/unlink.c | 49 +++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c index d73b7abacf..c4f08beb7f 100644 --- a/source4/torture/raw/unlink.c +++ b/source4/torture/raw/unlink.c @@ -252,34 +252,41 @@ static BOOL test_delete_on_close(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); - printf("Testing with non-empty directory delete_on_close\n"); - status = create_directory_handle(cli->tree, dname, &fnum); - CHECK_STATUS(status, NT_STATUS_OK); - - fnum2 = create_complex_file(cli, mem_ctx, inside); + if (!lp_parm_bool(-1, "torture", "samba3", False)) { - sfinfo.disposition_info.in.file.fnum = fnum; - sfinfo.disposition_info.in.delete_on_close = 1; - status = smb_raw_setfileinfo(cli->tree, &sfinfo); - CHECK_STATUS(status, NT_STATUS_DIRECTORY_NOT_EMPTY); + /* + * Known deficiency, also skipped in base-delete. + */ - sfinfo.disposition_info.in.file.fnum = fnum2; - status = smb_raw_setfileinfo(cli->tree, &sfinfo); - CHECK_STATUS(status, NT_STATUS_OK); + printf("Testing with non-empty directory delete_on_close\n"); + status = create_directory_handle(cli->tree, dname, &fnum); + CHECK_STATUS(status, NT_STATUS_OK); - sfinfo.disposition_info.in.file.fnum = fnum; - status = smb_raw_setfileinfo(cli->tree, &sfinfo); - CHECK_STATUS(status, NT_STATUS_DIRECTORY_NOT_EMPTY); + fnum2 = create_complex_file(cli, mem_ctx, inside); - smbcli_close(cli->tree, fnum2); + sfinfo.disposition_info.in.file.fnum = fnum; + sfinfo.disposition_info.in.delete_on_close = 1; + status = smb_raw_setfileinfo(cli->tree, &sfinfo); + CHECK_STATUS(status, NT_STATUS_DIRECTORY_NOT_EMPTY); - status = smb_raw_setfileinfo(cli->tree, &sfinfo); - CHECK_STATUS(status, NT_STATUS_OK); + sfinfo.disposition_info.in.file.fnum = fnum2; + status = smb_raw_setfileinfo(cli->tree, &sfinfo); + CHECK_STATUS(status, NT_STATUS_OK); - smbcli_close(cli->tree, fnum); + sfinfo.disposition_info.in.file.fnum = fnum; + status = smb_raw_setfileinfo(cli->tree, &sfinfo); + CHECK_STATUS(status, NT_STATUS_DIRECTORY_NOT_EMPTY); - status = smb_raw_rmdir(cli->tree, &dio); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); + smbcli_close(cli->tree, fnum2); + + status = smb_raw_setfileinfo(cli->tree, &sfinfo); + CHECK_STATUS(status, NT_STATUS_OK); + + smbcli_close(cli->tree, fnum); + + status = smb_raw_rmdir(cli->tree, &dio); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); + } printf("Testing open dir with delete_on_close\n"); status = create_directory_handle(cli->tree, dname, &fnum); -- cgit