Bug 6622 - DEFER_OPEN test case should expect that the file may have been deleted before the last smbcli_unlink request
DEFER_OPEN test case should expect that the file may have been deleted before...
Status: RESOLVED FIXED
Product: Samba 4.0
Classification: Unclassified
Component: File services
unspecified
All Windows 7
: P3 normal
: ---
Assigned To: Andrew Bartlett
Matthias Dieter Wallnöfer
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-08 17:49 UTC by Long Li
Modified: 2009-08-12 04:32 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Long Li 2009-08-08 17:49:43 UTC
From line 695 of torture/basic/base.c in run_deferopen(), the test case deletes the test file and checks for server response:

if (NT_STATUS_IS_ERR(smbcli_unlink(cli->tree, fname))) {
    /* All until the last unlink will fail with sharing violation. */
    if (!NT_STATUS_EQUAL(smbcli_nt_error(cli->tree),NT_STATUS_SHARING_VIOLATION)) {
        torture_comment(tctx, "unlink of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
        correct = false;
    }
}

But it's possible that a Windows server may also return NT_STATUS_OBJECT_NAME_NOT_FOUND for the smbcli_unlink request. This is because the file may have been successfully deleted by another test process (of this function) after this test process closes the file at the end of the last test loop.

The test case should also check for NT_STATUS_OBJECT_NAME_NOT_FOUND as a valid server response.
Comment 1 Matthias Dieter Wallnöfer 2009-08-12 04:32:19 UTC
Should be fixed through a patch from me.