Commit 263c435b0a for openssl.org
commit 263c435b0a759e2169d93eccdf2c619c154549fd
Author: Jakub Zelenka <jakub.zelenka@openssl.foundation>
Date: Thu Aug 27 17:38:51 2026 +0200
quic-radix: add thread-assisted connection close tests
Migrate the connection close part of the thread-assist coverage from the
QUIC_TSERVER-based test and extend it: one vignette has the
thread-assisted client initiate SSL_shutdown_ex() and both ends verify
the close info, the other has the server close with an application error
code and reason, checking the client sees a remote application close
with the matching code.
Assisted-by: Claude:claude-fable-5
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
Reviewed-by: Andrew Dinh <andrewd@openssl.org>
Merge-date: Mon Nov 16 17:41:42 2026
Merged-from: https://github.com/openssl/openssl/pull/32550
diff --git a/test/radix/quic_tests.c b/test/radix/quic_tests.c
index 3dbe37e26a..30fa50d391 100644
--- a/test/radix/quic_tests.c
+++ b/test/radix/quic_tests.c
@@ -1553,6 +1553,36 @@ err:
return ok;
}
+/* Local close: the thread-assisted client shuts the connection down. */
+DEF_SCRIPT(check_thread_assisted_close_local,
+ "thread-assisted client closes the connection")
+{
+ OP_SIMPLE_PAIR_CONN_TA();
+ OP_ACCEPT_CONN_WAIT(L, Sa, 0);
+
+ OP_WRITE_B(C, "raspberry");
+ OP_READ_EXPECT_B(Sa, "raspberry");
+
+ OP_SHUTDOWN_WAIT(C, 0, 0, NULL);
+ OP_EXPECT_CONN_CLOSE_INFO(C, 0, 1, 0);
+ OP_EXPECT_CONN_CLOSE_INFO(Sa, 0, 1, 1);
+}
+
+/* Remote close: the thread-assisted client handles the server's shutdown. */
+DEF_SCRIPT(check_thread_assisted_close_remote,
+ "thread-assisted client handles a remote close")
+{
+ OP_SIMPLE_PAIR_CONN_TA();
+ OP_ACCEPT_CONN_WAIT(L, Sa, 0);
+
+ OP_WRITE_B(C, "raspberry");
+ OP_READ_EXPECT_B(Sa, "raspberry");
+
+ OP_SHUTDOWN_WAIT(Sa, 0, 42, "changed my mind");
+ OP_EXPECT_CONN_CLOSE_INFO(Sa, 42, 1, 0);
+ OP_EXPECT_CONN_CLOSE_INFO(C, 42, 1, 1);
+}
+
/* 5. Test stream reset functionality */
DEF_SCRIPT(script_5, "Test stream reset functionality")
{
@@ -6169,6 +6199,8 @@ static SCRIPT_INFO *const scripts[] = {
USE(check_ctx_cbks),
USE(check_thread_assisted_idle),
USE(check_thread_assisted_transfer),
+ USE(check_thread_assisted_close_local),
+ USE(check_thread_assisted_close_remote),
USE(script_5),
USE(script_6),
USE(script_7),