diff options
author | Michael Adam <obnox@samba.org> | 2014-08-18 15:10:15 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-08-18 17:42:00 +0200 |
commit | 335171ef075fd6b66bda807841a6e275e65dabea (patch) | |
tree | 936364a23b48225f75a1341746967c9eff32bd05 /source4/torture/basic | |
parent | 2afacf940f21759c08bcc4a6e906428595966a19 (diff) | |
download | samba-335171ef075fd6b66bda807841a6e275e65dabea.tar.gz samba-335171ef075fd6b66bda807841a6e275e65dabea.tar.xz samba-335171ef075fd6b66bda807841a6e275e65dabea.zip |
s4:torture: use torture_assert instead of torture_comment and return in defer_open test
The fix missed one instance, as autobuild has just told me...
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Aug 18 17:42:00 CEST 2014 on sn-devel-104
Diffstat (limited to 'source4/torture/basic')
-rw-r--r-- | source4/torture/basic/base.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 1d04b35839..3789081cb0 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -654,6 +654,7 @@ static bool run_deferopen(struct torture_context *tctx, struct smbcli_state *cli int nsec; int msec; double sec; + NTSTATUS status; nsec = torture_setting_int(tctx, "sharedelay", 1000000); msec = nsec / 1000; @@ -696,10 +697,15 @@ static bool run_deferopen(struct torture_context *tctx, struct smbcli_state *cli smb_msleep(10 * msec); i++; - if (NT_STATUS_IS_ERR(smbcli_close(cli->tree, fnum))) { - torture_comment(tctx,"Failed to close %s, error=%s\n", fname, smbcli_errstr(cli->tree)); - return false; - } + + status = smbcli_close(cli->tree, fnum); + torture_assert(tctx, !NT_STATUS_IS_ERR(status), + talloc_asprintf(tctx, + "pid %u: Failed to close %s, " + "error=%s\n", + (unsigned)getpid(), fname, + smbcli_errstr(cli->tree))); + smb_msleep(2 * msec); } @@ -707,7 +713,7 @@ static bool run_deferopen(struct torture_context *tctx, struct smbcli_state *cli /* 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); + 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_result(tctx, TORTURE_FAIL, "unlink of %s failed (%s)\n", fname, smbcli_errstr(cli->tree)); |