From: Andrew Dinh Date: Wed, 1 Jul 2026 16:37:34 +0000 (+0700) Subject: Port script12 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4eab5e3bb2d17e44da2c9d22e56085b700841788;p=thirdparty%2Fopenssl.git Port script12 Assisted-by: Claude:claude-sonnet-4-6 Reviewed-by: Neil Horman Reviewed-by: Saša Nedvědický MergeDate: Fri Jul 17 08:02:03 2026 (Merged from https://github.com/openssl/openssl/pull/31821) --- diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c index a8dae2966a9..b9b263fe94d 100644 --- a/test/quic_multistream_test.c +++ b/test/quic_multistream_test.c @@ -2080,38 +2080,8 @@ static const struct script_op script_11[] = { }; /* 12. Many threads initiated on the same client connection */ -static const struct script_op script_12_child[] = { - OP_C_NEW_STREAM_BIDI(a, ANY_ID), - OP_C_WRITE(a, "foo", 3), - OP_C_CONCLUDE(a), - OP_C_FREE_STREAM(a), - - OP_END -}; - static const struct script_op script_12[] = { - OP_C_SET_ALPN("ossltest"), - OP_C_CONNECT_WAIT(), - OP_C_SET_DEFAULT_STREAM_MODE(SSL_DEFAULT_STREAM_MODE_NONE), - - OP_NEW_THREAD(5, script_12_child), - - OP_S_BIND_STREAM_ID(a, C_BIDI_ID(0)), - OP_S_READ_EXPECT(a, "foo", 3), - OP_S_EXPECT_FIN(a), - OP_S_BIND_STREAM_ID(b, C_BIDI_ID(1)), - OP_S_READ_EXPECT(b, "foo", 3), - OP_S_EXPECT_FIN(b), - OP_S_BIND_STREAM_ID(c, C_BIDI_ID(2)), - OP_S_READ_EXPECT(c, "foo", 3), - OP_S_EXPECT_FIN(c), - OP_S_BIND_STREAM_ID(d, C_BIDI_ID(3)), - OP_S_READ_EXPECT(d, "foo", 3), - OP_S_EXPECT_FIN(d), - OP_S_BIND_STREAM_ID(e, C_BIDI_ID(4)), - OP_S_READ_EXPECT(e, "foo", 3), - OP_S_EXPECT_FIN(e), - + /* test moved to test/radix/quic_tests.c */ OP_END }; diff --git a/test/radix/quic_tests.c b/test/radix/quic_tests.c index a101cad9246..d09c3385053 100644 --- a/test/radix/quic_tests.c +++ b/test/radix/quic_tests.c @@ -993,11 +993,74 @@ DEF_SCRIPT(script_11, "Many threads accepted on the same client connection") OP_SLEEP(10); } +/* 12. Many threads initiated on the same client connection */ +DEF_SCRIPT(script_12_child_0, + "child: create stream on C, write, conclude") { + OP_NEW_STREAM(C, C0, 0 /* bidirectional */); + OP_WRITE_B(C0, "foo"); + OP_CONCLUDE(C0); +} + +DEF_SCRIPT(script_12_child_1, + "child: create stream on C, write, conclude") +{ + OP_NEW_STREAM(C, C1, 0 /* bidirectional */); + OP_WRITE_B(C1, "foo"); + OP_CONCLUDE(C1); } -DEF_SCRIPT(script_12, "place holder for multistrem script_12") +DEF_SCRIPT(script_12_child_2, + "child: create stream on C, write, conclude") { + OP_NEW_STREAM(C, C2, 0 /* bidirectional */); + OP_WRITE_B(C2, "foo"); + OP_CONCLUDE(C2); +} + +DEF_SCRIPT(script_12_child_3, + "child: create stream on C, write, conclude") +{ + OP_NEW_STREAM(C, C3, 0 /* bidirectional */); + OP_WRITE_B(C3, "foo"); + OP_CONCLUDE(C3); +} + +DEF_SCRIPT(script_12_child_4, + "child: create stream on C, write, conclude") +{ + OP_NEW_STREAM(C, C4, 0 /* bidirectional */); + OP_WRITE_B(C4, "foo"); + OP_CONCLUDE(C4); +} + +DEF_SCRIPT(script_12, "Many threads initiated on the same client connection") +{ + OP_SIMPLE_PAIR_CONN_ND(); + OP_ACCEPT_CONN_WAIT_ND(L, S, 0); + + OP_SPAWN_THREAD(script_12_child_0); + OP_SPAWN_THREAD(script_12_child_1); + OP_SPAWN_THREAD(script_12_child_2); + OP_SPAWN_THREAD(script_12_child_3); + OP_SPAWN_THREAD(script_12_child_4); + + OP_ACCEPT_STREAM_WAIT(S, Sa, 0); + OP_READ_EXPECT_B(Sa, "foo"); + OP_EXPECT_FIN(Sa); + OP_ACCEPT_STREAM_WAIT(S, Sb, 0); + OP_READ_EXPECT_B(Sb, "foo"); + OP_EXPECT_FIN(Sb); + OP_ACCEPT_STREAM_WAIT(S, Sc, 0); + OP_READ_EXPECT_B(Sc, "foo"); + OP_EXPECT_FIN(Sc); + OP_ACCEPT_STREAM_WAIT(S, Sd, 0); + OP_READ_EXPECT_B(Sd, "foo"); + OP_EXPECT_FIN(Sd); + OP_ACCEPT_STREAM_WAIT(S, Se, 0); + OP_READ_EXPECT_B(Se, "foo"); + OP_EXPECT_FIN(Se); + OP_SLEEP(10); } DEF_SCRIPT(script_13, "place holder for multistrem script_13")