summaryrefslogtreecommitdiff
path: root/source4/torture/basic
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-10 10:12:51 +0200
committerMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2009-08-11 12:59:14 +0200
commit8fcf1b988ad5c2338a75631696c32a31116708f1 (patch)
tree53af920d00a560658ab9160308a0338916e59046 /source4/torture/basic
parentc73984a5c9966f9c90549e753764ae071670e15f (diff)
downloadsamba-8fcf1b988ad5c2338a75631696c32a31116708f1.tar.gz
samba-8fcf1b988ad5c2338a75631696c32a31116708f1.tar.bz2
samba-8fcf1b988ad5c2338a75631696c32a31116708f1.zip
torture/basic: in run_derefopen() the file could have been deleted before the last unlink
Through a suggestion pointed out in bug #6622 the test file sometimes doesn't exist on the last turn anymore. So we haven't to fail here since it could have been deleted by a concurrent process (e.g. when the same test runs multiple times). Therefore also NT_STATUS_OBJECT_NAME_NOT_FOUND is an acceptable result.
Diffstat (limited to 'source4/torture/basic')
-rw-r--r--source4/torture/basic/base.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c
index ea7b6c08fd..549db63b34 100644
--- a/source4/torture/basic/base.c
+++ b/source4/torture/basic/base.c
@@ -693,8 +693,12 @@ static bool run_deferopen(struct torture_context *tctx, struct smbcli_state *cli
}
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)) {
+ /* All until the last unlink will fail with sharing violation
+ but also the last request can fail since the file could have
+ been successfully deleted by another (test) process */
+ NTSTATUS status = smbcli_nt_error(cli->tree);
+ if ((!NT_STATUS_EQUAL(status, NT_STATUS_SHARING_VIOLATION))
+ && (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND))) {
torture_comment(tctx, "unlink of %s failed (%s)\n", fname, smbcli_errstr(cli->tree));
correct = false;
}