Commit 1b87dc68e5 for openssl.org

commit 1b87dc68e56891e6d70ab64bfed609f7aaa498f1
Author: Andrew Dinh <andrewd@openssl.org>
Date:   Mon Aug 3 09:41:03 2026 +0700

    Port script_45

    Assisted-by: Claude:claude-sonnet-5
    Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
    Reviewed-by: Norbert Pocs <norbertp@openssl.org>
    Merge-date: Wed Sep  2 06:32:30 2026
    Merged-from: https://github.com/openssl/openssl/pull/32335

diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c
index 2fabc294f8..40715bf1c7 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -2567,51 +2567,8 @@ static const struct script_op script_44[] = {
 };

 /* 45. PING must generate ACK */
-static int force_ping(struct helper *h, struct helper_local *hl)
-{
-    QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(ACQUIRE_S());
-
-    h->scratch0 = ossl_quic_channel_get_diag_num_rx_ack(ch);
-
-    if (!TEST_true(ossl_quic_tserver_ping(ACQUIRE_S())))
-        return 0;
-
-    return 1;
-}
-
-static int wait_incoming_acks_increased(struct helper *h, struct helper_local *hl)
-{
-    QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(ACQUIRE_S());
-    uint16_t count;
-
-    count = ossl_quic_channel_get_diag_num_rx_ack(ch);
-
-    if (count == h->scratch0) {
-        h->check_spin_again = 1;
-        return 0;
-    }
-
-    return 1;
-}
-
 static const struct script_op script_45[] = {
-    OP_C_SET_ALPN("ossltest"),
-    OP_C_CONNECT_WAIT(),
-
-    OP_C_WRITE(DEFAULT, "apple", 5),
-    OP_S_BIND_STREAM_ID(a, C_BIDI_ID(0)),
-    OP_S_READ_EXPECT(a, "apple", 5),
-
-    OP_BEGIN_REPEAT(2),
-
-    OP_CHECK(force_ping, 0),
-    OP_CHECK(wait_incoming_acks_increased, 0),
-
-    OP_END_REPEAT(),
-
-    OP_S_WRITE(a, "Strawberry", 10),
-    OP_C_READ_EXPECT(DEFAULT, "Strawberry", 10),
-
+    /* 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 52ab5bff50..d444d53e1f 100644
--- a/test/radix/quic_tests.c
+++ b/test/radix/quic_tests.c
@@ -2847,8 +2847,72 @@ DEF_SCRIPT(script_44, "Fault injection - PADDING")
     OP_READ_EXPECT(C, "Strawberry", 10);
 }

-DEF_SCRIPT(script_45, "place holder for multistrem script_45")
+static uint16_t script_45_ack_count;
+
+/* 45. PING must generate ACK */
+DEF_FUNC(force_ping_45)
+{
+    int ok = 0;
+    SSL *ssl;
+    QUIC_CHANNEL *ch;
+
+    REQUIRE_SSL(ssl);
+    ch = ossl_quic_conn_get_channel(ssl);
+    if (!TEST_ptr(ch))
+        goto err;
+
+    script_45_ack_count = ossl_quic_channel_get_diag_num_rx_ack(ch);
+
+    if (!TEST_true(ossl_quic_channel_ping(ch)))
+        goto err;
+
+    ok = 1;
+err:
+    return ok;
+}
+
+DEF_FUNC(wait_incoming_acks_increased_45)
 {
+    int ok = 0;
+    SSL *ssl;
+    QUIC_CHANNEL *ch;
+    uint16_t count;
+
+    REQUIRE_SSL(ssl);
+    ch = ossl_quic_conn_get_channel(ssl);
+    if (!TEST_ptr(ch))
+        goto err;
+
+    count = ossl_quic_channel_get_diag_num_rx_ack(ch);
+
+    if (count == script_45_ack_count)
+        F_SPIN_AGAIN();
+
+    ok = 1;
+err:
+    return ok;
+}
+
+DEF_SCRIPT(script_45, "PING must generate ACK")
+{
+    size_t i;
+
+    OP_SIMPLE_PAIR_CONN();
+    OP_ACCEPT_CONN_WAIT(L, S, 0);
+
+    OP_WRITE(C, "apple", 5);
+    OP_ACCEPT_STREAM_WAIT(S, Sa, 0);
+    OP_READ_EXPECT(Sa, "apple", 5);
+
+    for (i = 0; i < 2; ++i) {
+        OP_SELECT_SSL(0, S);
+        OP_FUNC(force_ping_45);
+        OP_SELECT_SSL(0, S);
+        OP_FUNC(wait_incoming_acks_increased_45);
+    }
+
+    OP_WRITE(Sa, "Strawberry", 10);
+    OP_READ_EXPECT(C, "Strawberry", 10);
 }

 DEF_SCRIPT(script_46, "place holder for multistrem script_46")