s4:torture: use torture_assert instead of torture_comment and return in defer_open...
authorMichael Adam <obnox@samba.org>
Mon, 18 Aug 2014 13:10:15 +0000 (15:10 +0200)
committerMichael Adam <obnox@samba.org>
Mon, 18 Aug 2014 15:42:00 +0000 (17:42 +0200)
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

source4/torture/basic/base.c

index 1d04b358396c268d9b1a40367e0dcbbc5cad296e..3789081cb0dca8f6da9424937eaa3c7a25983a7d 100644 (file)
@@ -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));