summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-04-28 16:56:34 +0100
committerHugo Landau <hlandau@openssl.org>2023-05-24 10:34:47 +0100
commit0554f723c1b13f66e56d892b332ccd36aee498ad (patch)
tree4f547f1dab0b6a333721a2c3237e4affb10b3680 /test
parentdea57ecf3d0729abb964bfc1ff687b2cbb9845de (diff)
QUIC MSMT TESTS: Add tests to exercise MAX_STREAMS
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.c87
1 files changed, 87 insertions, 0 deletions
diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c
index a00ec4399f..d09db38cc1 100644
--- a/test/quic_multistream_test.c
+++ b/test/quic_multistream_test.c
@@ -1679,6 +1679,91 @@ static const struct script_op script_14[] = {
OP_END
};
+/* 15. Client sending large number of streams, MAX_STREAMS test */
+static const struct script_op script_15[] = {
+ OP_C_SET_ALPN ("ossltest")
+ OP_C_CONNECT_WAIT ()
+ OP_C_SET_DEFAULT_STREAM_MODE(SSL_DEFAULT_STREAM_MODE_NONE)
+
+ /*
+ * This will cause a protocol violation to be raised by the server if we are
+ * not handling the stream limit correctly on the TX side.
+ */
+ OP_BEGIN_REPEAT (200)
+
+ 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_REPEAT ()
+
+ /* Prove the connection is still good. */
+ OP_S_NEW_STREAM_BIDI (a, S_BIDI_ID(0))
+ OP_S_WRITE (a, "bar", 3)
+ OP_S_CONCLUDE (a)
+
+ OP_C_ACCEPT_STREAM_WAIT (a)
+ OP_C_READ_EXPECT (a, "bar", 3)
+ OP_C_EXPECT_FIN (a)
+
+ /*
+ * Drain the queue of incoming streams. We should be able to get all 200
+ * even though only 100 can be initiated at a time.
+ */
+ OP_BEGIN_REPEAT (200)
+
+ OP_S_ACCEPT_STREAM_WAIT (b)
+ OP_S_READ_EXPECT (b, "foo", 3)
+ OP_S_EXPECT_FIN (b)
+ OP_S_UNBIND_STREAM_ID (b)
+
+ OP_END_REPEAT ()
+
+ OP_END
+};
+
+/* 16. Server sending large number of streams, MAX_STREAMS test */
+static const struct script_op script_16[] = {
+ OP_C_SET_ALPN ("ossltest")
+ OP_C_CONNECT_WAIT ()
+ OP_C_SET_DEFAULT_STREAM_MODE(SSL_DEFAULT_STREAM_MODE_NONE)
+
+ /*
+ * This will cause a protocol violation to be raised by the client if we are
+ * not handling the stream limit correctly on the TX side.
+ */
+ OP_BEGIN_REPEAT (200)
+
+ OP_S_NEW_STREAM_BIDI (a, ANY_ID)
+ OP_S_WRITE (a, "foo", 3)
+ OP_S_CONCLUDE (a)
+ OP_S_UNBIND_STREAM_ID (a)
+
+ OP_END_REPEAT ()
+
+ /* Prove that the connection is still good. */
+ OP_C_NEW_STREAM_BIDI (a, ANY_ID)
+ OP_C_WRITE (a, "bar", 3)
+ OP_C_CONCLUDE (a)
+
+ OP_S_ACCEPT_STREAM_WAIT (b)
+ OP_S_READ_EXPECT (b, "bar", 3)
+ OP_S_EXPECT_FIN (b)
+
+ /* Drain the queue of incoming streams. */
+ OP_BEGIN_REPEAT (200)
+
+ OP_C_ACCEPT_STREAM_WAIT (b)
+ OP_C_READ_EXPECT (b, "foo", 3)
+ OP_C_EXPECT_FIN (b)
+ OP_C_FREE_STREAM (b)
+
+ OP_END_REPEAT ()
+
+ OP_END
+};
+
static const struct script_op *const scripts[] = {
script_1,
script_2,
@@ -1694,6 +1779,8 @@ static const struct script_op *const scripts[] = {
script_12,
script_13,
script_14,
+ script_15,
+ script_16,
};
static int test_script(int idx)