/* For testing use. While enabled, ticking is not performed. */
void ossl_quic_channel_set_inhibit_tick(QUIC_CHANNEL *ch, int inhibit);
+/*
+ * These queries exist for diagnostic purposes only. They may roll over.
+ * Do not rely on them for non-testing purposes.
+ */
+uint16_t ossl_quic_channel_get_diag_num_rx_ack(QUIC_CHANNEL *ch);
+
# endif
#endif
*/
uint64_t txku_threshold_override;
- /* Valid if we are in the TERMINATING or TERMINATED states. */
+ /* Diagnostic counters for testing purposes only. May roll over. */
+ uint16_t diag_num_rx_ack; /* Number of ACK frames received */
+
+ /* Valid if we are in the TERMINATING or TERMINATED states. */
QUIC_TERMINATE_CAUSE terminate_cause;
/*
OP_END
};
+/* 45. PING must generate ACK */
+static int force_ping(struct helper *h, const struct script_op *op)
+{
+ QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(h->s);
+
+ h->scratch0 = ossl_quic_channel_get_diag_num_rx_ack(ch);
+
+ if (!TEST_true(ossl_quic_tserver_ping(h->s)))
+ return 0;
+
+ return 1;
+}
+
+static int wait_incoming_acks_increased(struct helper *h, const struct script_op *op)
+{
+ QUIC_CHANNEL *ch = ossl_quic_tserver_get_channel(h->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)
+
+ OP_END
+};
+
static const struct script_op *const scripts[] = {
script_1,
script_2,
script_42,
script_43,
script_44,
+ script_45,
};
static int test_script(int idx)