Commit c82a466566 for openssl.org
commit c82a466566e54d539161202c6b2a4e303a9113a3
Author: Mounir IDRASSI <mounir.idrassi@idrix.fr>
Date: Sat Apr 18 14:21:49 2026 +0900
test: add Windows RIO notifier smoke test
Add a Windows-only RIO notifier test that exercises initialization,
signalling, unsignalling, and cleanup without test-only hooks.
The RIO WSA lifecycle fix itself landed via #31339. This keeps the
remaining PR focused on coverage and removes the stale ssl_init.c include
for the deleted WSA cleanup path.
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Milan Broz <mbroz@openssl.org>
MergeDate: Fri Jun 12 13:54:17 2026
(Merged from https://github.com/openssl/openssl/pull/30918)
diff --git a/ssl/ssl_init.c b/ssl/ssl_init.c
index 1e92658b7a..634fd39237 100644
--- a/ssl/ssl_init.c
+++ b/ssl/ssl_init.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2016-2025 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2026 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -15,7 +15,6 @@
#include <openssl/trace.h>
#include "ssl_local.h"
#include "internal/thread_once.h"
-#include "internal/rio_notifier.h" /* for ossl_wsa_cleanup() */
static int stopped;
diff --git a/test/build.info b/test/build.info
index 7e3bf669c7..43812e3989 100644
--- a/test/build.info
+++ b/test/build.info
@@ -88,6 +88,9 @@ IF[{- !$disabled{tests} -}]
IF[{- !$disabled{quic} -}]
PROGRAMS{noinst}=priority_queue_test quicfaultstest quicapitest \
quic_newcid_test quic_srt_gen_test
+ IF[{- $config{target} =~ /^(?:VC-|mingw|BC-)/ -}]
+ PROGRAMS{noinst}=rio_notifier_test
+ ENDIF
ENDIF
IF[{- !$disabled{quic} && !$disabled{qlog} -}]
@@ -389,6 +392,12 @@ IF[{- !$disabled{tests} -}]
DEPEND[packettest]=../libcrypto libtestutil.a
IF[{- !$disabled{'quic'} -}]
+ IF[{- $config{target} =~ /^(?:VC-|mingw|BC-)/ -}]
+ SOURCE[rio_notifier_test]=rio_notifier_test.c
+ INCLUDE[rio_notifier_test]=.. ../include ../apps/include
+ DEPEND[rio_notifier_test]=../libcrypto.a ../libssl.a libtestutil.a
+ ENDIF
+
SOURCE[quic_wire_test]=quic_wire_test.c
INCLUDE[quic_wire_test]=../include ../apps/include
DEPEND[quic_wire_test]=../libcrypto.a ../libssl.a libtestutil.a
diff --git a/test/recipes/70-test_rio_notifier.t b/test/recipes/70-test_rio_notifier.t
new file mode 100644
index 0000000000..a0224f8a88
--- /dev/null
+++ b/test/recipes/70-test_rio_notifier.t
@@ -0,0 +1,22 @@
+#! /usr/bin/env perl
+# Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the Apache License 2.0 (the "License"). You may not use
+# this file except in compliance with the License. You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
+use OpenSSL::Test;
+use OpenSSL::Test::Utils;
+
+setup("test_rio_notifier");
+
+plan skip_all => "RIO notifier tests require QUIC"
+ if disabled("quic");
+
+plan skip_all => "RIO notifier WSA tests are only available on Windows"
+ if config("target") !~ /^(?:VC-|mingw|BC-)/i;
+
+plan tests => 1;
+
+ok(run(test(["rio_notifier_test"])));
diff --git a/test/rio_notifier_test.c b/test/rio_notifier_test.c
new file mode 100644
index 0000000000..984ee51b9b
--- /dev/null
+++ b/test/rio_notifier_test.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2026 The OpenSSL Project Authors. All Rights Reserved.
+ *
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
+ * this file except in compliance with the License. You can obtain a copy
+ * in the file LICENSE in the source distribution or at
+ * https://www.openssl.org/source/license.html
+ */
+
+#include "internal/rio_notifier.h"
+#include "testutil.h"
+
+static int test_rio_notifier_smoke(void)
+{
+ RIO_NOTIFIER nfy = { -1, -1 };
+ int ret = 0;
+
+ if (!TEST_true(ossl_rio_notifier_init(&nfy)))
+ goto err;
+
+ if (!TEST_int_ne(ossl_rio_notifier_as_fd(&nfy), (int)INVALID_SOCKET)
+ || !TEST_true(ossl_rio_notifier_signal(&nfy))
+ || !TEST_true(ossl_rio_notifier_unsignal(&nfy)))
+ goto err;
+
+ ret = 1;
+
+err:
+ ossl_rio_notifier_cleanup(&nfy);
+ return ret;
+}
+
+int setup_tests(void)
+{
+ ADD_TEST(test_rio_notifier_smoke);
+ return 1;
+}