]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture/smb2: let smb2.bench tests start the loop only when everything is ready
authorStefan Metzmacher <metze@samba.org>
Fri, 16 May 2025 11:41:21 +0000 (13:41 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 16 May 2025 13:41:56 +0000 (13:41 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri May 16 13:41:56 UTC 2025 on atb-devel-224

source4/torture/smb2/bench.c

index 2474028a7231ef4325a0501ef8bc218dcce53f69..e16409bae18c28a204b3d787dd58ae9bc9069c92 100644 (file)
@@ -442,6 +442,14 @@ static bool test_smb2_bench_echo(struct torture_context *tctx,
                        loop->conn = &state->conns[i];
                        loop->im = tevent_create_immediate(state->loops);
                        torture_assert(tctx, loop->im != NULL, __location__);
+               }
+       }
+
+       for (li = 0, i = 0; i <state->num_conns; i++) {
+               size_t pcli;
+
+               for (pcli = 0; pcli < torture_qdepth; pcli++) {
+                       struct test_smb2_bench_echo_loop *loop = &state->loops[li];
 
                        tevent_schedule_immediate(loop->im,
                                                  tctx->ev,
@@ -916,6 +924,14 @@ bool test_smb2_bench_path_contention_shared(struct torture_context *tctx,
                        torture_assert(tctx, loop->im != NULL, __location__);
                        loop->opens.io = open_io;
                        loop->closes.io = close_io;
+               }
+       }
+
+       for (li = 0, i = 0; i <state->num_conns; i++) {
+               size_t pcli;
+
+               for (pcli = 0; pcli < torture_qdepth; pcli++) {
+                       struct test_smb2_bench_path_contention_shared_loop *loop = &state->loops[li];
 
                        tevent_schedule_immediate(loop->im,
                                                  tctx->ev,
@@ -1328,6 +1344,14 @@ static bool test_smb2_bench_read(struct torture_context *tctx,
                        sfinfo.end_of_file_info.in.size = state->io_size;
                        status = smb2_setinfo_file(state->conns[i].tree, &sfinfo);
                        CHECK_STATUS(status, NT_STATUS_OK);
+               }
+       }
+
+       for (li = 0, i = 0; i <state->num_conns; i++) {
+               size_t pcli;
+
+               for (pcli = 0; pcli < torture_qdepth; pcli++) {
+                       struct test_smb2_bench_read_loop *loop = &state->loops[li];
 
                        tevent_schedule_immediate(loop->im,
                                                  tctx->ev,
@@ -1805,6 +1829,14 @@ static bool test_smb2_bench_session_setup(struct torture_context *tctx,
                        loop->conn = &state->conns[i];
                        loop->im = tevent_create_immediate(state->loops);
                        torture_assert(tctx, loop->im != NULL, __location__);
+               }
+       }
+
+       for (li = 0, i = 0; i <state->num_conns; i++) {
+               size_t pcli;
+
+               for (pcli = 0; pcli < torture_qdepth; pcli++) {
+                       struct test_smb2_bench_session_setup_shared_loop *loop = &state->loops[li];
 
                        tevent_schedule_immediate(loop->im,
                                                  tctx->ev,