foo
authorGregor Beck <gbeck@sernet.de>
Mon, 17 Jun 2013 11:06:23 +0000 (13:06 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 9 May 2014 10:58:17 +0000 (12:58 +0200)
source4/torture/smb2/durable_v2_open.c

index a0e41068aa4cfa281b60eed9d9745472a5541fd3..80eb927921e644c68d0996621f9f8d2c2dd069cc 100644 (file)
@@ -259,9 +259,6 @@ static bool test_one_durable_v2_open_oplock(struct torture_context *tctx,
        bool ret = true;
        struct smb2_create io;
 
-       torture_comment(tctx, "one_durable_v2_open_oplock: %s %spersistent level: %s shm: %s durable: %d persistent: %d\n",
-                       fname, request_persistent ? "" : "non", test.level, test.share_mode, test.durable, test.persistent);
-
        smb2_util_unlink(tree, fname);
 
        smb2_oplock_create_share(&io, fname,
@@ -281,7 +278,13 @@ static bool test_one_durable_v2_open_oplock(struct torture_context *tctx,
        CHECK_VAL(io.out.durable_open_v2, test.durable);
        CHECK_VAL(io.out.persistent_open, test.persistent);
        CHECK_VAL(io.out.oplock_level, smb2_util_oplock_level(test.level));
-
+       if (!ret) {
+               torture_result(tctx, TORTURE_FAIL,
+                              "durable_v2_open_oplock failed: persistent: %d "
+                              "level: %3s shm: %3s durable: %d persistent: %d",
+                              request_persistent, test.level, test.share_mode,
+                              test.durable, test.persistent);
+       }
 done:
        if (h != NULL) {
                smb2_util_close(tree, *h);
@@ -418,9 +421,6 @@ static bool test_one_durable_v2_open_lease(struct torture_context *tctx,
        struct smb2_lease ls;
        uint64_t lease;
 
-       torture_comment(tctx, "one_durable_v2_open_lease: %s %spersistent type: %s shm: %s durable: %d persistent: %d\n",
-                       fname, request_persistent ? "" : "non", test.type, test.share_mode, test.durable, test.persistent);
-
        smb2_util_unlink(tree, fname);
 
        lease = random();
@@ -447,6 +447,15 @@ static bool test_one_durable_v2_open_lease(struct torture_context *tctx,
        CHECK_VAL(io.out.lease_response.lease_key.data[1], ~lease);
        CHECK_VAL(io.out.lease_response.lease_state,
                  smb2_util_lease_state(test.type));
+
+       if (!ret) {
+               torture_result(tctx, TORTURE_FAIL,
+                              "durable_v2_open_lease failed: persistent: %d "
+                              "type: %3s shm: %3s durable: %d persistent: %d",
+                              request_persistent, test.type, test.share_mode,
+                              test.durable, test.persistent);
+       }
+
 done:
        if (h != NULL) {
                smb2_util_close(tree, *h);