summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-05-17 13:15:01 +0100
committerHugo Landau <hlandau@openssl.org>2023-05-24 10:34:54 +0100
commit629b408c12c56b2c9e3279de8658718e8dd658a2 (patch)
tree13916b230422a8d1b27fcf9467ce8bbdcb45646f /test
parent1a0de4c1eea1f32a3e1113add26625d49b3854d8 (diff)
QUIC: Fix bugs where threading is disabled
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20856)
Diffstat (limited to 'test')
-rw-r--r--test/quic_multistream_test.c16
-rw-r--r--test/quic_tserver_test.c8
2 files changed, 22 insertions, 2 deletions
diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c
index 851f45278a..f846a412b5 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -581,7 +581,10 @@ static int run_script_worker(struct helper *h, const struct script_op *script,
size_t offset = 0;
size_t op_idx = 0;
const struct script_op *op = NULL;
- int no_advance = 0, first = 1, end_wait_warning = 0;
+ int no_advance = 0, first = 1;
+#if defined(OPENSSL_THREADS)
+ int end_wait_warning = 0;
+#endif
OSSL_TIME op_start_time = ossl_time_zero(), op_deadline = ossl_time_zero();
struct helper_local hl;
#define REPEAT_SLOTS 8
@@ -657,6 +660,7 @@ static int run_script_worker(struct helper *h, const struct script_op *script,
if (!TEST_size_t_eq(repeat_stack_len, 0))
goto out;
+#if defined(OPENSSL_THREADS)
if (thread_idx < 0) {
int done;
size_t i;
@@ -679,6 +683,7 @@ static int run_script_worker(struct helper *h, const struct script_op *script,
}
}
}
+#endif
TEST_info("script finished on thread %d", thread_idx);
testresult = 1;
@@ -1190,7 +1195,12 @@ static int run_script_worker(struct helper *h, const struct script_op *script,
case OPK_NEW_THREAD:
{
#if !defined(OPENSSL_THREADS)
- TEST_error("threading not supported");
+ /*
+ * If this test script requires threading and we do not have
+ * support for it, skip the rest of it.
+ */
+ TEST_skip("threading not supported, skipping");
+ testresult = 1;
goto out;
#else
size_t i;
@@ -1261,8 +1271,10 @@ static int run_script(const struct script_op *script, int free_order)
if (!TEST_true(run_script_worker(&h, script, -1)))
goto out;
+#if defined(OPENSSL_THREADS)
if (!TEST_true(join_threads(h.threads, h.num_threads)))
goto out;
+#endif
testresult = 1;
out:
diff --git a/test/quic_tserver_test.c b/test/quic_tserver_test.c
index cc412eafd0..ae25adc444 100644
--- a/test/quic_tserver_test.c
+++ b/test/quic_tserver_test.c
@@ -12,6 +12,7 @@
#include "internal/common.h"
#include "internal/sockets.h"
#include "internal/quic_tserver.h"
+#include "internal/quic_thread_assist.h"
#include "internal/quic_ssl.h"
#include "internal/time.h"
#include "testutil.h"
@@ -75,6 +76,13 @@ static int do_test(int use_thread_assist, int use_fake_time, int use_inject)
OSSL_TIME (*now_cb)(void *arg) = use_fake_time ? fake_now : real_now;
size_t limit_ms = 1000;
+#if defined(OPENSSL_NO_QUIC_THREAD_ASSIST)
+ if (use_thread_assist) {
+ TEST_skip("thread assisted mode not enabled");
+ return 1;
+ }
+#endif
+
ina.s_addr = htonl(0x7f000001UL);
/* Setup test server. */