s4:torture/smb2: fix smb2.multichannel.leases.test2 against windows
authorStefan Metzmacher <metze@samba.org>
Tue, 23 Jun 2020 10:38:49 +0000 (12:38 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 8 Jul 2020 15:54:39 +0000 (15:54 +0000)
We still receive the break on the blocked channel,
it's only the response ACKs, which we are blocking (or simulate to
block).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source4/torture/smb2/multichannel.c

index 3e29c7d02a9d81396c7ff7737fb8bd6bafaec967..aae63db2fe2364aafd2a0b93deea8f6359e8db95 100644 (file)
@@ -1149,6 +1149,9 @@ static bool test_multichannel_lease_break_test2(struct torture_context *tctx,
        block_ok = test_block_smb2_transport(tctx, transport2A);
        torture_assert(tctx, block_ok, "we could not block tcp transport");
 
+       torture_wait_for_lease_break(tctx);
+       CHECK_VAL(lease_break_info.count, 0);
+
        /* 1 opens file2 */
        torture_comment(tctx,
                        "Client opens fname2 with session1 with 2A blocked\n");
@@ -1171,7 +1174,14 @@ static bool test_multichannel_lease_break_test2(struct torture_context *tctx,
                                lease_break_info.count);
        }
 
-       CHECK_VAL(lease_break_info.count, 1);
+       /*
+        * We got breaks on both channels
+        * (one failed on the blocked connection)
+        */
+       CHECK_VAL(lease_break_info.count, 2);
+       lease_break_info.count -= 1;
+       CHECK_VAL(lease_break_info.failures, 1);
+       lease_break_info.failures -= 1;
        CHECK_BREAK_INFO("RHW", "RH", LEASE2F2);
        torture_reset_lease_break_info(tctx, &lease_break_info);