quic_ackm_test.c 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. /*
  2. * Copyright 2022-2025 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #include "testutil.h"
  10. #include <openssl/ssl.h>
  11. #include "internal/quic_ackm.h"
  12. #include "internal/quic_cc.h"
  13. static OSSL_TIME fake_time = {0};
  14. #define TIME_BASE (ossl_ticks2time(123 * OSSL_TIME_SECOND))
  15. static OSSL_TIME fake_now(void *arg)
  16. {
  17. return fake_time;
  18. }
  19. struct pkt_info {
  20. OSSL_ACKM_TX_PKT *pkt;
  21. int lost, acked, discarded;
  22. };
  23. static void on_lost(void *arg)
  24. {
  25. struct pkt_info *info = arg;
  26. ++info->lost;
  27. }
  28. static void on_acked(void *arg)
  29. {
  30. struct pkt_info *info = arg;
  31. ++info->acked;
  32. }
  33. static void on_discarded(void *arg)
  34. {
  35. struct pkt_info *info = arg;
  36. ++info->discarded;
  37. }
  38. struct helper {
  39. OSSL_ACKM *ackm;
  40. struct pkt_info *pkts;
  41. size_t num_pkts;
  42. OSSL_CC_DATA *ccdata;
  43. OSSL_STATM statm;
  44. int have_statm;
  45. };
  46. static void helper_destroy(struct helper *h)
  47. {
  48. size_t i;
  49. if (h->ackm != NULL) {
  50. ossl_ackm_free(h->ackm);
  51. h->ackm = NULL;
  52. }
  53. if (h->ccdata != NULL) {
  54. ossl_cc_dummy_method.free(h->ccdata);
  55. h->ccdata = NULL;
  56. }
  57. if (h->have_statm) {
  58. ossl_statm_destroy(&h->statm);
  59. h->have_statm = 0;
  60. }
  61. if (h->pkts != NULL) {
  62. for (i = 0; i < h->num_pkts; ++i) {
  63. OPENSSL_free(h->pkts[i].pkt);
  64. h->pkts[i].pkt = NULL;
  65. }
  66. OPENSSL_free(h->pkts);
  67. h->pkts = NULL;
  68. }
  69. }
  70. static int helper_init(struct helper *h, size_t num_pkts)
  71. {
  72. int rc = 0;
  73. memset(h, 0, sizeof(*h));
  74. fake_time = TIME_BASE;
  75. /* Initialise statistics tracker. */
  76. if (!TEST_int_eq(ossl_statm_init(&h->statm), 1))
  77. goto err;
  78. h->have_statm = 1;
  79. /* Initialise congestion controller. */
  80. h->ccdata = ossl_cc_dummy_method.new(fake_now, NULL);
  81. if (!TEST_ptr(h->ccdata))
  82. goto err;
  83. /* Initialise ACK manager. */
  84. h->ackm = ossl_ackm_new(fake_now, NULL, &h->statm,
  85. &ossl_cc_dummy_method, h->ccdata,
  86. /* is_server */0);
  87. if (!TEST_ptr(h->ackm))
  88. goto err;
  89. /* Allocate our array of packet information. */
  90. h->num_pkts = num_pkts;
  91. if (num_pkts > 0) {
  92. h->pkts = OPENSSL_zalloc(sizeof(struct pkt_info) * num_pkts);
  93. if (!TEST_ptr(h->pkts))
  94. goto err;
  95. } else {
  96. h->pkts = NULL;
  97. }
  98. rc = 1;
  99. err:
  100. if (rc == 0)
  101. helper_destroy(h);
  102. return rc;
  103. }
  104. static const QUIC_PN linear_20[] = {
  105. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
  106. };
  107. static const QUIC_PN high_linear_20[] = {
  108. 1000, 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008,
  109. 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017,
  110. 1018, 1019
  111. };
  112. /*
  113. * TX ACK (Packet Threshold) Test Cases
  114. * ******************************************************************
  115. */
  116. struct tx_ack_test_case {
  117. const QUIC_PN *pn_table;
  118. size_t pn_table_len;
  119. const OSSL_QUIC_ACK_RANGE *ack_ranges;
  120. size_t num_ack_ranges;
  121. const char *expect_ack; /* 1=ack, 2=lost, 4=discarded */
  122. };
  123. #define DEFINE_TX_ACK_CASE(n, pntable) \
  124. static const struct tx_ack_test_case tx_ack_case_##n = { \
  125. (pntable), OSSL_NELEM(pntable), \
  126. tx_ack_range_##n, OSSL_NELEM(tx_ack_range_##n), \
  127. tx_ack_expect_##n \
  128. }
  129. /* One range, partial coverage of space */
  130. static const OSSL_QUIC_ACK_RANGE tx_ack_range_1[] = {
  131. { 0, 10 },
  132. };
  133. static const char tx_ack_expect_1[] = {
  134. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
  135. };
  136. DEFINE_TX_ACK_CASE(1, linear_20);
  137. /* Two ranges, partial coverage of space, overlapping by 1 */
  138. static const OSSL_QUIC_ACK_RANGE tx_ack_range_2[] = {
  139. { 5, 10 }, { 0, 5 }
  140. };
  141. static const char tx_ack_expect_2[] = {
  142. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
  143. };
  144. DEFINE_TX_ACK_CASE(2, linear_20);
  145. /* Two ranges, partial coverage of space, together contiguous */
  146. static const OSSL_QUIC_ACK_RANGE tx_ack_range_3[] = {
  147. { 6, 10 }, { 0, 5 }
  148. };
  149. static const char tx_ack_expect_3[] = {
  150. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
  151. };
  152. DEFINE_TX_ACK_CASE(3, linear_20);
  153. /*
  154. * Two ranges, partial coverage of space, non-contiguous by 1
  155. * Causes inferred loss due to packet threshold being exceeded.
  156. */
  157. static const OSSL_QUIC_ACK_RANGE tx_ack_range_4[] = {
  158. { 7, 10 }, { 0, 5 }
  159. };
  160. static const char tx_ack_expect_4[] = {
  161. 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
  162. };
  163. DEFINE_TX_ACK_CASE(4, linear_20);
  164. /*
  165. * Two ranges, partial coverage of space, non-contiguous by 2
  166. * Causes inferred loss due to packet threshold being exceeded.
  167. */
  168. static const OSSL_QUIC_ACK_RANGE tx_ack_range_5[] = {
  169. { 7, 10 }, { 0, 4 }
  170. };
  171. static const char tx_ack_expect_5[] = {
  172. 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0
  173. };
  174. DEFINE_TX_ACK_CASE(5, linear_20);
  175. /* One range, covering entire space */
  176. static const OSSL_QUIC_ACK_RANGE tx_ack_range_6[] = {
  177. { 0, 20 },
  178. };
  179. static const char tx_ack_expect_6[] = {
  180. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  181. };
  182. DEFINE_TX_ACK_CASE(6, linear_20);
  183. /* One range, covering more space than exists */
  184. static const OSSL_QUIC_ACK_RANGE tx_ack_range_7[] = {
  185. { 0, 30 },
  186. };
  187. static const char tx_ack_expect_7[] = {
  188. 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
  189. };
  190. DEFINE_TX_ACK_CASE(7, linear_20);
  191. /* One range, covering nothing (too high) */
  192. static const OSSL_QUIC_ACK_RANGE tx_ack_range_8[] = {
  193. { 21, 30 },
  194. };
  195. static const char tx_ack_expect_8[] = {
  196. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  197. };
  198. DEFINE_TX_ACK_CASE(8, linear_20);
  199. /* One range, covering nothing (too low) */
  200. static const OSSL_QUIC_ACK_RANGE tx_ack_range_9[] = {
  201. { 0, 999 },
  202. };
  203. static const char tx_ack_expect_9[] = {
  204. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  205. };
  206. DEFINE_TX_ACK_CASE(9, high_linear_20);
  207. /* One single packet at start of PN set */
  208. static const OSSL_QUIC_ACK_RANGE tx_ack_range_10[] = {
  209. { 0, 0 },
  210. };
  211. static const char tx_ack_expect_10[] = {
  212. 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  213. };
  214. DEFINE_TX_ACK_CASE(10, linear_20);
  215. /*
  216. * One single packet in middle of PN set
  217. * Causes inferred loss of one packet due to packet threshold being exceeded,
  218. * but several other previous packets survive as they are under the threshold.
  219. */
  220. static const OSSL_QUIC_ACK_RANGE tx_ack_range_11[] = {
  221. { 3, 3 },
  222. };
  223. static const char tx_ack_expect_11[] = {
  224. 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  225. };
  226. DEFINE_TX_ACK_CASE(11, linear_20);
  227. /*
  228. * One single packet at end of PN set
  229. * Causes inferred loss due to packet threshold being exceeded.
  230. */
  231. static const OSSL_QUIC_ACK_RANGE tx_ack_range_12[] = {
  232. { 19, 19 },
  233. };
  234. static const char tx_ack_expect_12[] = {
  235. 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1
  236. };
  237. DEFINE_TX_ACK_CASE(12, linear_20);
  238. /*
  239. * Mixed straddling
  240. * Causes inferred loss due to packet threshold being exceeded.
  241. */
  242. static const OSSL_QUIC_ACK_RANGE tx_ack_range_13[] = {
  243. { 1008, 1008 }, { 1004, 1005 }, { 1001, 1002 }
  244. };
  245. static const char tx_ack_expect_13[] = {
  246. 2, 1, 1, 2, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  247. };
  248. DEFINE_TX_ACK_CASE(13, high_linear_20);
  249. static const struct tx_ack_test_case *const tx_ack_cases[] = {
  250. &tx_ack_case_1,
  251. &tx_ack_case_2,
  252. &tx_ack_case_3,
  253. &tx_ack_case_4,
  254. &tx_ack_case_5,
  255. &tx_ack_case_6,
  256. &tx_ack_case_7,
  257. &tx_ack_case_8,
  258. &tx_ack_case_9,
  259. &tx_ack_case_10,
  260. &tx_ack_case_11,
  261. &tx_ack_case_12,
  262. &tx_ack_case_13,
  263. };
  264. enum {
  265. MODE_ACK, MODE_DISCARD, MODE_PTO, MODE_NUM
  266. };
  267. static int test_probe_counts(const OSSL_ACKM_PROBE_INFO *p,
  268. uint32_t anti_deadlock_handshake,
  269. uint32_t anti_deadlock_initial,
  270. uint32_t pto_initial,
  271. uint32_t pto_handshake,
  272. uint32_t pto_app)
  273. {
  274. if (!TEST_uint_eq(p->anti_deadlock_handshake, anti_deadlock_handshake))
  275. return 0;
  276. if (!TEST_uint_eq(p->anti_deadlock_initial, anti_deadlock_initial))
  277. return 0;
  278. if (!TEST_uint_eq(p->pto[QUIC_PN_SPACE_INITIAL], pto_initial))
  279. return 0;
  280. if (!TEST_uint_eq(p->pto[QUIC_PN_SPACE_HANDSHAKE], pto_handshake))
  281. return 0;
  282. if (!TEST_uint_eq(p->pto[QUIC_PN_SPACE_APP], pto_app))
  283. return 0;
  284. return 1;
  285. }
  286. static void on_loss_detection_deadline_callback(OSSL_TIME deadline, void *arg)
  287. {
  288. *(OSSL_TIME *)arg = deadline;
  289. }
  290. static int test_tx_ack_case_actual(int tidx, int space, int mode)
  291. {
  292. int testresult = 0;
  293. struct helper h;
  294. size_t i;
  295. OSSL_ACKM_TX_PKT *tx;
  296. const struct tx_ack_test_case *c = tx_ack_cases[tidx];
  297. OSSL_QUIC_FRAME_ACK ack = {0};
  298. OSSL_TIME loss_detection_deadline = ossl_time_zero();
  299. /* Cannot discard app space, so skip this */
  300. if (mode == MODE_DISCARD && space == QUIC_PN_SPACE_APP) {
  301. TEST_skip("skipping test for app space");
  302. return 1;
  303. }
  304. if (!TEST_int_eq(helper_init(&h, c->pn_table_len), 1))
  305. goto err;
  306. /* Arm callback. */
  307. ossl_ackm_set_loss_detection_deadline_callback(h.ackm,
  308. on_loss_detection_deadline_callback,
  309. &loss_detection_deadline);
  310. /* Allocate TX packet structures. */
  311. for (i = 0; i < c->pn_table_len; ++i) {
  312. h.pkts[i].pkt = tx = OPENSSL_zalloc(sizeof(*tx));
  313. if (!TEST_ptr(tx))
  314. goto err;
  315. tx->pkt_num = c->pn_table[i];
  316. tx->pkt_space = space;
  317. tx->is_inflight = 1;
  318. tx->is_ack_eliciting = 1;
  319. tx->num_bytes = 123;
  320. tx->largest_acked = QUIC_PN_INVALID;
  321. tx->on_lost = on_lost;
  322. tx->on_acked = on_acked;
  323. tx->on_discarded = on_discarded;
  324. tx->cb_arg = &h.pkts[i];
  325. tx->time = fake_time;
  326. if (!TEST_int_eq(ossl_ackm_on_tx_packet(h.ackm, tx), 1))
  327. goto err;
  328. }
  329. if (mode == MODE_DISCARD) {
  330. /* Try discarding. */
  331. if (!TEST_int_eq(ossl_ackm_on_pkt_space_discarded(h.ackm, space), 1))
  332. goto err;
  333. /* Check all discard callbacks were called. */
  334. for (i = 0; i < c->pn_table_len; ++i) {
  335. if (!TEST_int_eq(h.pkts[i].acked, 0))
  336. goto err;
  337. if (!TEST_int_eq(h.pkts[i].lost, 0))
  338. goto err;
  339. if (!TEST_int_eq(h.pkts[i].discarded, 1))
  340. goto err;
  341. }
  342. } else if (mode == MODE_ACK) {
  343. /* Try acknowledging. */
  344. ack.ack_ranges = (OSSL_QUIC_ACK_RANGE *)c->ack_ranges;
  345. ack.num_ack_ranges = c->num_ack_ranges;
  346. if (!TEST_int_eq(ossl_ackm_on_rx_ack_frame(h.ackm, &ack, space, fake_time), 1))
  347. goto err;
  348. /* Check correct ranges were acknowledged. */
  349. for (i = 0; i < c->pn_table_len; ++i) {
  350. if (!TEST_int_eq(h.pkts[i].acked,
  351. (c->expect_ack[i] & 1) != 0 ? 1 : 0))
  352. goto err;
  353. if (!TEST_int_eq(h.pkts[i].lost,
  354. (c->expect_ack[i] & 2) != 0 ? 1 : 0))
  355. goto err;
  356. if (!TEST_int_eq(h.pkts[i].discarded,
  357. (c->expect_ack[i] & 4) != 0 ? 1 : 0))
  358. goto err;
  359. }
  360. } else if (mode == MODE_PTO) {
  361. OSSL_TIME deadline = ossl_ackm_get_loss_detection_deadline(h.ackm);
  362. OSSL_ACKM_PROBE_INFO probe;
  363. if (!TEST_int_eq(ossl_time_compare(deadline, loss_detection_deadline), 0))
  364. goto err;
  365. /* We should have a PTO deadline. */
  366. if (!TEST_int_gt(ossl_time_compare(deadline, fake_time), 0))
  367. goto err;
  368. /* Should not have any probe requests yet. */
  369. probe = *ossl_ackm_get0_probe_request(h.ackm);
  370. if (!TEST_int_eq(test_probe_counts(&probe, 0, 0, 0, 0, 0), 1))
  371. goto err;
  372. /*
  373. * If in app space, confirm handshake, as this is necessary to enable
  374. * app space PTO probe requests.
  375. */
  376. if (space == QUIC_PN_SPACE_APP)
  377. if (!TEST_int_eq(ossl_ackm_on_handshake_confirmed(h.ackm), 1))
  378. goto err;
  379. /* Advance to the PTO deadline. */
  380. fake_time = ossl_time_add(deadline, ossl_ticks2time(1));
  381. if (!TEST_int_eq(ossl_ackm_on_timeout(h.ackm), 1))
  382. goto err;
  383. /* Should have a probe request. Not cleared by first call. */
  384. for (i = 0; i < 3; ++i) {
  385. probe = *ossl_ackm_get0_probe_request(h.ackm);
  386. if (i > 0)
  387. memset(ossl_ackm_get0_probe_request(h.ackm), 0, sizeof(probe));
  388. if (i == 2) {
  389. if (!TEST_int_eq(test_probe_counts(&probe, 0, 0, 0, 0, 0), 1))
  390. goto err;
  391. } else {
  392. if (!TEST_int_eq(test_probe_counts(&probe, 0, 0,
  393. space == QUIC_PN_SPACE_INITIAL,
  394. space == QUIC_PN_SPACE_HANDSHAKE,
  395. space == QUIC_PN_SPACE_APP), 1))
  396. goto err;
  397. }
  398. }
  399. } else
  400. goto err;
  401. testresult = 1;
  402. err:
  403. helper_destroy(&h);
  404. return testresult;
  405. }
  406. /*
  407. * TX ACK (Time Threshold) Test
  408. * ******************************************************************
  409. */
  410. enum {
  411. TX_ACK_TIME_OP_END,
  412. TX_ACK_TIME_OP_PKT, /* TX packets */
  413. TX_ACK_TIME_OP_ACK, /* Synthesise incoming ACK of single PN range */
  414. TX_ACK_TIME_OP_EXPECT /* Ack/loss assertion */
  415. };
  416. struct tx_ack_time_op {
  417. int kind;
  418. uint64_t time_advance; /* all ops */
  419. QUIC_PN pn; /* PKT, ACK */
  420. size_t num_pn; /* PKT, ACK */
  421. const char *expect; /* 1=ack, 2=lost, 4=discarded */
  422. };
  423. #define TX_OP_PKT(advance, pn, num_pn) \
  424. { TX_ACK_TIME_OP_PKT, (advance) * OSSL_TIME_MS, (pn), (num_pn), NULL },
  425. #define TX_OP_ACK(advance, pn, num_pn) \
  426. { TX_ACK_TIME_OP_ACK, (advance) * OSSL_TIME_MS, (pn), (num_pn), NULL },
  427. #define TX_OP_EXPECT(expect) \
  428. { TX_ACK_TIME_OP_EXPECT, 0, 0, 0, (expect) },
  429. #define TX_OP_END { TX_ACK_TIME_OP_END }
  430. static const char tx_ack_time_script_1_expect[] = {
  431. 2, 1
  432. };
  433. static const struct tx_ack_time_op tx_ack_time_script_1[] = {
  434. TX_OP_PKT ( 0, 0, 1)
  435. TX_OP_PKT (3600000, 1, 1)
  436. TX_OP_ACK ( 1000, 1, 1)
  437. TX_OP_EXPECT(tx_ack_time_script_1_expect)
  438. TX_OP_END
  439. };
  440. static const struct tx_ack_time_op *const tx_ack_time_scripts[] = {
  441. tx_ack_time_script_1,
  442. };
  443. static int test_tx_ack_time_script(int tidx)
  444. {
  445. int testresult = 0;
  446. struct helper h;
  447. OSSL_ACKM_TX_PKT *tx = NULL;
  448. OSSL_QUIC_FRAME_ACK ack = {0};
  449. OSSL_QUIC_ACK_RANGE ack_range = {0};
  450. size_t i, num_pkts = 0, pkt_idx = 0;
  451. const struct tx_ack_time_op *script = tx_ack_time_scripts[tidx], *s;
  452. /* Calculate number of packets. */
  453. for (s = script; s->kind != TX_ACK_TIME_OP_END; ++s)
  454. if (s->kind == TX_ACK_TIME_OP_PKT)
  455. num_pkts += s->num_pn;
  456. /* Initialise ACK manager and packet structures. */
  457. if (!TEST_int_eq(helper_init(&h, num_pkts), 1))
  458. goto err;
  459. for (i = 0; i < num_pkts; ++i) {
  460. h.pkts[i].pkt = tx = OPENSSL_zalloc(sizeof(*tx));
  461. if (!TEST_ptr(tx))
  462. goto err;
  463. }
  464. /* Run script. */
  465. for (s = script; s->kind != TX_ACK_TIME_OP_END; ++s)
  466. switch (s->kind) {
  467. case TX_ACK_TIME_OP_PKT:
  468. for (i = 0; i < s->num_pn; ++i) {
  469. tx = h.pkts[pkt_idx + i].pkt;
  470. tx->pkt_num = s->pn + i;
  471. tx->pkt_space = QUIC_PN_SPACE_INITIAL;
  472. tx->num_bytes = 123;
  473. tx->largest_acked = QUIC_PN_INVALID;
  474. tx->is_inflight = 1;
  475. tx->is_ack_eliciting = 1;
  476. tx->on_lost = on_lost;
  477. tx->on_acked = on_acked;
  478. tx->on_discarded = on_discarded;
  479. tx->cb_arg = &h.pkts[pkt_idx + i];
  480. fake_time = ossl_time_add(fake_time,
  481. ossl_ticks2time(s->time_advance));
  482. tx->time = fake_time;
  483. if (!TEST_int_eq(ossl_ackm_on_tx_packet(h.ackm, tx), 1))
  484. goto err;
  485. }
  486. pkt_idx += s->num_pn;
  487. break;
  488. case TX_ACK_TIME_OP_ACK:
  489. ack.ack_ranges = &ack_range;
  490. ack.num_ack_ranges = 1;
  491. ack_range.start = s->pn;
  492. ack_range.end = s->pn + s->num_pn;
  493. fake_time = ossl_time_add(fake_time,
  494. ossl_ticks2time(s->time_advance));
  495. if (!TEST_int_eq(ossl_ackm_on_rx_ack_frame(h.ackm, &ack,
  496. QUIC_PN_SPACE_INITIAL,
  497. fake_time), 1))
  498. goto err;
  499. break;
  500. case TX_ACK_TIME_OP_EXPECT:
  501. for (i = 0; i < num_pkts; ++i) {
  502. if (!TEST_int_eq(h.pkts[i].acked,
  503. (s->expect[i] & 1) != 0 ? 1 : 0))
  504. goto err;
  505. if (!TEST_int_eq(h.pkts[i].lost,
  506. (s->expect[i] & 2) != 0 ? 1 : 0))
  507. goto err;
  508. if (!TEST_int_eq(h.pkts[i].discarded,
  509. (s->expect[i] & 4) != 0 ? 1 : 0))
  510. goto err;
  511. }
  512. break;
  513. }
  514. testresult = 1;
  515. err:
  516. helper_destroy(&h);
  517. return testresult;
  518. }
  519. /*
  520. * RX ACK Test
  521. * ******************************************************************
  522. */
  523. enum {
  524. RX_OPK_END,
  525. RX_OPK_PKT, /* RX packet */
  526. RX_OPK_CHECK_UNPROC, /* check PNs unprocessable */
  527. RX_OPK_CHECK_PROC, /* check PNs processable */
  528. RX_OPK_CHECK_STATE, /* check is_desired/deadline */
  529. RX_OPK_CHECK_ACKS, /* check ACK ranges */
  530. RX_OPK_TX, /* TX packet */
  531. RX_OPK_RX_ACK, /* RX ACK frame */
  532. RX_OPK_SKIP_IF_PN_SPACE /* skip for a given PN space */
  533. };
  534. struct rx_test_op {
  535. int kind;
  536. uint64_t time_advance;
  537. QUIC_PN pn; /* PKT, CHECK_(UN)PROC, TX, RX_ACK */
  538. size_t num_pn; /* PKT, CHECK_(UN)PROC, TX, RX_ACK */
  539. char expect_desired; /* CHECK_STATE */
  540. char expect_deadline; /* CHECK_STATE */
  541. const OSSL_QUIC_ACK_RANGE *ack_ranges; /* CHECK_ACKS */
  542. size_t num_ack_ranges; /* CHECK_ACKS */
  543. QUIC_PN largest_acked; /* TX */
  544. };
  545. #define RX_OP_PKT(advance, pn, num_pn) \
  546. { \
  547. RX_OPK_PKT, (advance) * OSSL_TIME_MS, (pn), (num_pn), \
  548. 0, 0, NULL, 0, 0 \
  549. },
  550. #define RX_OP_CHECK_UNPROC(advance, pn, num_pn) \
  551. { \
  552. RX_OPK_CHECK_UNPROC, (advance) * OSSL_TIME_MS, (pn), (num_pn),\
  553. 0, 0, NULL, 0, 0 \
  554. },
  555. #define RX_OP_CHECK_PROC(advance, pn, num_pn) \
  556. { \
  557. RX_OPK_CHECK_PROC, (advance) * OSSL_TIME_MS, (pn), (num_pn), \
  558. 0, 0, NULL, 0, 0 \
  559. },
  560. #define RX_OP_CHECK_STATE(advance, expect_desired, expect_deadline) \
  561. { \
  562. RX_OPK_CHECK_STATE, (advance) * OSSL_TIME_MS, 0, 0, \
  563. (expect_desired), (expect_deadline), NULL, 0, 0 \
  564. },
  565. #define RX_OP_CHECK_ACKS(advance, ack_ranges) \
  566. { \
  567. RX_OPK_CHECK_ACKS, (advance) * OSSL_TIME_MS, 0, 0, \
  568. 0, 0, (ack_ranges), OSSL_NELEM(ack_ranges), 0 \
  569. },
  570. #define RX_OP_CHECK_NO_ACKS(advance) \
  571. { \
  572. RX_OPK_CHECK_ACKS, (advance) * OSSL_TIME_MS, 0, 0, \
  573. 0, 0, NULL, 0, 0 \
  574. },
  575. #define RX_OP_TX(advance, pn, largest_acked) \
  576. { \
  577. RX_OPK_TX, (advance) * OSSL_TIME_MS, (pn), 1, \
  578. 0, 0, NULL, 0, (largest_acked) \
  579. },
  580. #define RX_OP_RX_ACK(advance, pn, num_pn) \
  581. { \
  582. RX_OPK_RX_ACK, (advance) * OSSL_TIME_MS, (pn), (num_pn), \
  583. 0, 0, NULL, 0, 0 \
  584. },
  585. #define RX_OP_SKIP_IF_PN_SPACE(pn_space) \
  586. { \
  587. RX_OPK_SKIP_IF_PN_SPACE, 0, (pn_space), 0, \
  588. 0, 0, NULL, 0, 0 \
  589. },
  590. #define RX_OP_END \
  591. { RX_OPK_END }
  592. /* RX 1. Simple Test with ACK Desired (Packet Threshold, Exactly) */
  593. static const OSSL_QUIC_ACK_RANGE rx_ack_ranges_1a[] = {
  594. { 0, 1 }
  595. };
  596. static const struct rx_test_op rx_script_1[] = {
  597. RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
  598. RX_OP_CHECK_PROC (0, 0, 3)
  599. RX_OP_PKT (0, 0, 2) /* two packets, threshold */
  600. RX_OP_CHECK_UNPROC (0, 0, 2)
  601. RX_OP_CHECK_PROC (0, 2, 1)
  602. RX_OP_CHECK_STATE (0, 1, 0) /* threshold met, immediate */
  603. RX_OP_CHECK_ACKS (0, rx_ack_ranges_1a)
  604. /* At this point we would generate e.g. a packet with an ACK. */
  605. RX_OP_TX (0, 0, 1) /* ACKs both */
  606. RX_OP_CHECK_ACKS (0, rx_ack_ranges_1a) /* not provably ACKed yet */
  607. RX_OP_RX_ACK (0, 0, 1) /* TX'd packet is ACK'd */
  608. RX_OP_CHECK_NO_ACKS (0) /* nothing more to ACK */
  609. RX_OP_CHECK_UNPROC (0, 0, 2) /* still unprocessable */
  610. RX_OP_CHECK_PROC (0, 2, 1) /* still processable */
  611. RX_OP_END
  612. };
  613. /* RX 2. Simple Test with ACK Not Yet Desired (Packet Threshold) (1-RTT) */
  614. static const OSSL_QUIC_ACK_RANGE rx_ack_ranges_2a[] = {
  615. { 0, 0 }
  616. };
  617. static const OSSL_QUIC_ACK_RANGE rx_ack_ranges_2b[] = {
  618. { 0, 2 }
  619. };
  620. static const struct rx_test_op rx_script_2[] = {
  621. /*
  622. * We skip this for INITIAL/HANDSHAKE and use a separate version
  623. * (rx_script_4) for those spaces as those spaces should not delay ACK
  624. * generation, so a different RX_OP_CHECK_STATE test is needed.
  625. */
  626. RX_OP_SKIP_IF_PN_SPACE(QUIC_PN_SPACE_INITIAL)
  627. RX_OP_SKIP_IF_PN_SPACE(QUIC_PN_SPACE_HANDSHAKE)
  628. RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
  629. RX_OP_CHECK_PROC (0, 0, 3)
  630. /* First packet always generates an ACK so get it out of the way. */
  631. RX_OP_PKT (0, 0, 1)
  632. RX_OP_CHECK_UNPROC (0, 0, 1)
  633. RX_OP_CHECK_PROC (0, 1, 1)
  634. RX_OP_CHECK_STATE (0, 1, 0) /* first packet always causes ACK */
  635. RX_OP_CHECK_ACKS (0, rx_ack_ranges_2a) /* clears packet counter */
  636. RX_OP_CHECK_STATE (0, 0, 0) /* desired state should have been cleared */
  637. /* Second packet should not cause ACK-desired state */
  638. RX_OP_PKT (0, 1, 1) /* just one packet, threshold is 2 */
  639. RX_OP_CHECK_UNPROC (0, 0, 2)
  640. RX_OP_CHECK_PROC (0, 2, 1)
  641. RX_OP_CHECK_STATE (0, 0, 1) /* threshold not yet met, so deadline */
  642. /* Don't check ACKs here, as it would reset our threshold counter. */
  643. /* Now receive a second packet, triggering the threshold */
  644. RX_OP_PKT (0, 2, 1) /* second packet meets threshold */
  645. RX_OP_CHECK_UNPROC (0, 0, 3)
  646. RX_OP_CHECK_PROC (0, 3, 1)
  647. RX_OP_CHECK_STATE (0, 1, 0) /* desired immediately */
  648. RX_OP_CHECK_ACKS (0, rx_ack_ranges_2b)
  649. /* At this point we would generate e.g. a packet with an ACK. */
  650. RX_OP_TX (0, 0, 2) /* ACKs all */
  651. RX_OP_CHECK_ACKS (0, rx_ack_ranges_2b) /* not provably ACKed yet */
  652. RX_OP_RX_ACK (0, 0, 1) /* TX'd packet is ACK'd */
  653. RX_OP_CHECK_NO_ACKS (0) /* nothing more to ACK */
  654. RX_OP_CHECK_UNPROC (0, 0, 3) /* still unprocessable */
  655. RX_OP_CHECK_PROC (0, 3, 1) /* still processable */
  656. RX_OP_END
  657. };
  658. /* RX 3. Simple Test with ACK Desired (Packet Threshold, Multiple Watermarks) */
  659. static const OSSL_QUIC_ACK_RANGE rx_ack_ranges_3a[] = {
  660. { 0, 0 }
  661. };
  662. static const OSSL_QUIC_ACK_RANGE rx_ack_ranges_3b[] = {
  663. { 0, 10 }
  664. };
  665. static const OSSL_QUIC_ACK_RANGE rx_ack_ranges_3c[] = {
  666. { 6, 10 }
  667. };
  668. static const struct rx_test_op rx_script_3[] = {
  669. RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
  670. RX_OP_CHECK_PROC (0, 0, 11)
  671. /* First packet always generates an ACK so get it out of the way. */
  672. RX_OP_PKT (0, 0, 1)
  673. RX_OP_CHECK_UNPROC (0, 0, 1)
  674. RX_OP_CHECK_PROC (0, 1, 1)
  675. RX_OP_CHECK_STATE (0, 1, 0) /* first packet always causes ACK */
  676. RX_OP_CHECK_ACKS (0, rx_ack_ranges_3a) /* clears packet counter */
  677. RX_OP_CHECK_STATE (0, 0, 0) /* desired state should have been cleared */
  678. /* Generate ten packets, exceeding the threshold. */
  679. RX_OP_PKT (0, 1, 10) /* ten packets, threshold is 2 */
  680. RX_OP_CHECK_UNPROC (0, 0, 11)
  681. RX_OP_CHECK_PROC (0, 11, 1)
  682. RX_OP_CHECK_STATE (0, 1, 0) /* threshold met, immediate */
  683. RX_OP_CHECK_ACKS (0, rx_ack_ranges_3b)
  684. /*
  685. * Test TX'ing a packet which doesn't ACK anything.
  686. */
  687. RX_OP_TX (0, 0, QUIC_PN_INVALID)
  688. RX_OP_RX_ACK (0, 0, 1)
  689. /*
  690. * At this point we would generate a packet with an ACK immediately.
  691. * TX a packet which when ACKed makes [0,5] provably ACKed.
  692. */
  693. RX_OP_TX (0, 1, 5)
  694. RX_OP_CHECK_ACKS (0, rx_ack_ranges_3b) /* not provably ACKed yet */
  695. RX_OP_RX_ACK (0, 1, 1)
  696. RX_OP_CHECK_ACKS (0, rx_ack_ranges_3c) /* provably ACKed now gone */
  697. RX_OP_CHECK_UNPROC (0, 0, 11) /* still unprocessable */
  698. RX_OP_CHECK_PROC (0, 11, 1) /* still processable */
  699. /*
  700. * Now TX another packet which provably ACKs the rest when ACKed.
  701. */
  702. RX_OP_TX (0, 2, 10)
  703. RX_OP_CHECK_ACKS (0, rx_ack_ranges_3c) /* not provably ACKed yet */
  704. RX_OP_RX_ACK (0, 2, 1)
  705. RX_OP_CHECK_NO_ACKS (0) /* provably ACKed now gone */
  706. RX_OP_CHECK_UNPROC (0, 0, 11) /* still unprocessable */
  707. RX_OP_CHECK_PROC (0, 11, 1) /* still processable */
  708. RX_OP_END
  709. };
  710. /*
  711. * RX 4. Simple Test with ACK Not Yet Desired (Packet Threshold)
  712. * (Initial/Handshake)
  713. */
  714. static const OSSL_QUIC_ACK_RANGE rx_ack_ranges_4a[] = {
  715. { 0, 1 }
  716. };
  717. static const struct rx_test_op rx_script_4[] = {
  718. /* The application PN space is tested in rx_script_2. */
  719. RX_OP_SKIP_IF_PN_SPACE(QUIC_PN_SPACE_APP)
  720. RX_OP_CHECK_STATE (0, 0, 0) /* no threshold yet */
  721. RX_OP_CHECK_PROC (0, 0, 3)
  722. /* First packet always generates an ACK so get it out of the way. */
  723. RX_OP_PKT (0, 0, 1)
  724. RX_OP_CHECK_UNPROC (0, 0, 1)
  725. RX_OP_CHECK_PROC (0, 1, 1)
  726. RX_OP_CHECK_STATE (0, 1, 0) /* first packet always causes ACK */
  727. RX_OP_CHECK_ACKS (0, rx_ack_ranges_2a) /* clears packet counter */
  728. RX_OP_CHECK_STATE (0, 0, 0) /* desired state should have been cleared */
  729. /*
  730. * Second packet should cause ACK-desired state because we are
  731. * INITIAL/HANDSHAKE (RFC 9000 s. 13.2.1)
  732. */
  733. RX_OP_PKT (0, 1, 1) /* just one packet, threshold is 2 */
  734. RX_OP_CHECK_UNPROC (0, 0, 2)
  735. RX_OP_CHECK_PROC (0, 2, 1)
  736. RX_OP_CHECK_STATE (0, 1, 1)
  737. RX_OP_CHECK_ACKS (0, rx_ack_ranges_4a)
  738. RX_OP_CHECK_STATE (0, 0, 0) /* desired state should have been cleared */
  739. /* At this point we would generate e.g. a packet with an ACK. */
  740. RX_OP_TX (0, 0, 1) /* ACKs all */
  741. RX_OP_CHECK_ACKS (0, rx_ack_ranges_4a) /* not provably ACKed yet */
  742. RX_OP_RX_ACK (0, 0, 1) /* TX'd packet is ACK'd */
  743. RX_OP_CHECK_NO_ACKS (0) /* nothing more to ACK */
  744. RX_OP_CHECK_UNPROC (0, 0, 2) /* still unprocessable */
  745. RX_OP_CHECK_PROC (0, 2, 1) /* still processable */
  746. RX_OP_END
  747. };
  748. static const struct rx_test_op *const rx_test_scripts[] = {
  749. rx_script_1,
  750. rx_script_2,
  751. rx_script_3,
  752. rx_script_4
  753. };
  754. static void on_ack_deadline_callback(OSSL_TIME deadline,
  755. int pkt_space, void *arg)
  756. {
  757. ((OSSL_TIME *)arg)[pkt_space] = deadline;
  758. }
  759. static int test_rx_ack_actual(int tidx, int space)
  760. {
  761. int testresult = 0;
  762. struct helper h;
  763. const struct rx_test_op *script = rx_test_scripts[tidx], *s;
  764. size_t i, num_tx = 0, txi = 0;
  765. const OSSL_QUIC_FRAME_ACK *ack;
  766. OSSL_QUIC_FRAME_ACK rx_ack = {0};
  767. OSSL_QUIC_ACK_RANGE rx_ack_range = {0};
  768. struct pkt_info *pkts = NULL;
  769. OSSL_ACKM_TX_PKT *txs = NULL, *tx;
  770. OSSL_TIME ack_deadline[QUIC_PN_SPACE_NUM];
  771. size_t opn = 0;
  772. for (i = 0; i < QUIC_PN_SPACE_NUM; ++i)
  773. ack_deadline[i] = ossl_time_infinite();
  774. /* Initialise ACK manager. */
  775. if (!TEST_int_eq(helper_init(&h, 0), 1))
  776. goto err;
  777. /* Arm callback for testing. */
  778. ossl_ackm_set_ack_deadline_callback(h.ackm, on_ack_deadline_callback,
  779. ack_deadline);
  780. /*
  781. * Determine how many packets we are TXing, and therefore how many packet
  782. * structures we need.
  783. */
  784. for (s = script; s->kind != RX_OPK_END; ++s)
  785. if (s->kind == RX_OPK_TX)
  786. num_tx += s->num_pn;
  787. /* Allocate packet information structures. */
  788. txs = OPENSSL_zalloc(sizeof(*txs) * num_tx);
  789. if (!TEST_ptr(txs))
  790. goto err;
  791. pkts = OPENSSL_zalloc(sizeof(*pkts) * num_tx);
  792. if (!TEST_ptr(pkts))
  793. goto err;
  794. /* Run script. */
  795. for (s = script; s->kind != RX_OPK_END; ++s, ++opn) {
  796. fake_time = ossl_time_add(fake_time,
  797. ossl_ticks2time(s->time_advance));
  798. switch (s->kind) {
  799. case RX_OPK_PKT:
  800. for (i = 0; i < s->num_pn; ++i) {
  801. OSSL_ACKM_RX_PKT pkt = {0};
  802. pkt.pkt_num = s->pn + i;
  803. pkt.time = fake_time;
  804. pkt.pkt_space = space;
  805. pkt.is_ack_eliciting = 1;
  806. /* The packet should be processable before we feed it. */
  807. if (!TEST_int_eq(ossl_ackm_is_rx_pn_processable(h.ackm,
  808. pkt.pkt_num,
  809. pkt.pkt_space), 1))
  810. goto err;
  811. if (!TEST_int_eq(ossl_ackm_on_rx_packet(h.ackm, &pkt), 1))
  812. goto err;
  813. }
  814. break;
  815. case RX_OPK_CHECK_UNPROC:
  816. case RX_OPK_CHECK_PROC:
  817. for (i = 0; i < s->num_pn; ++i)
  818. if (!TEST_int_eq(ossl_ackm_is_rx_pn_processable(h.ackm,
  819. s->pn + i, space),
  820. (s->kind == RX_OPK_CHECK_PROC)))
  821. goto err;
  822. break;
  823. case RX_OPK_CHECK_STATE:
  824. if (!TEST_int_eq(ossl_ackm_is_ack_desired(h.ackm, space),
  825. s->expect_desired))
  826. goto err;
  827. if (!TEST_int_eq(!ossl_time_is_infinite(ossl_ackm_get_ack_deadline(h.ackm, space))
  828. && !ossl_time_is_zero(ossl_ackm_get_ack_deadline(h.ackm, space)),
  829. s->expect_deadline))
  830. goto err;
  831. for (i = 0; i < QUIC_PN_SPACE_NUM; ++i) {
  832. if (i != (size_t)space
  833. && !TEST_true(ossl_time_is_infinite(ossl_ackm_get_ack_deadline(h.ackm, i))))
  834. goto err;
  835. if (!TEST_int_eq(ossl_time_compare(ossl_ackm_get_ack_deadline(h.ackm, i),
  836. ack_deadline[i]), 0))
  837. goto err;
  838. }
  839. break;
  840. case RX_OPK_CHECK_ACKS:
  841. ack = ossl_ackm_get_ack_frame(h.ackm, space);
  842. /* Should always be able to get an ACK frame. */
  843. if (!TEST_ptr(ack))
  844. goto err;
  845. if (!TEST_size_t_eq(ack->num_ack_ranges, s->num_ack_ranges))
  846. goto err;
  847. for (i = 0; i < ack->num_ack_ranges; ++i) {
  848. if (!TEST_uint64_t_eq(ack->ack_ranges[i].start,
  849. s->ack_ranges[i].start))
  850. goto err;
  851. if (!TEST_uint64_t_eq(ack->ack_ranges[i].end,
  852. s->ack_ranges[i].end))
  853. goto err;
  854. }
  855. break;
  856. case RX_OPK_TX:
  857. pkts[txi].pkt = tx = &txs[txi];
  858. tx->pkt_num = s->pn;
  859. tx->pkt_space = space;
  860. tx->num_bytes = 123;
  861. tx->largest_acked = s->largest_acked;
  862. tx->is_inflight = 1;
  863. tx->is_ack_eliciting = 1;
  864. tx->on_lost = on_lost;
  865. tx->on_acked = on_acked;
  866. tx->on_discarded = on_discarded;
  867. tx->cb_arg = &pkts[txi];
  868. tx->time = fake_time;
  869. if (!TEST_int_eq(ossl_ackm_on_tx_packet(h.ackm, tx), 1))
  870. goto err;
  871. ++txi;
  872. break;
  873. case RX_OPK_RX_ACK:
  874. rx_ack.ack_ranges = &rx_ack_range;
  875. rx_ack.num_ack_ranges = 1;
  876. rx_ack_range.start = s->pn;
  877. rx_ack_range.end = s->pn + s->num_pn - 1;
  878. if (!TEST_int_eq(ossl_ackm_on_rx_ack_frame(h.ackm, &rx_ack,
  879. space, fake_time), 1))
  880. goto err;
  881. break;
  882. case RX_OPK_SKIP_IF_PN_SPACE:
  883. if (space == (int)s->pn) {
  884. testresult = 1;
  885. goto err;
  886. }
  887. break;
  888. default:
  889. goto err;
  890. }
  891. }
  892. testresult = 1;
  893. err:
  894. if (!testresult)
  895. TEST_error("error in ACKM RX script %d, op %zu", tidx + 1, opn + 1);
  896. helper_destroy(&h);
  897. OPENSSL_free(pkts);
  898. OPENSSL_free(txs);
  899. return testresult;
  900. }
  901. /*
  902. * Driver
  903. * ******************************************************************
  904. */
  905. static int test_tx_ack_case(int idx)
  906. {
  907. int tidx, space;
  908. tidx = idx % OSSL_NELEM(tx_ack_cases);
  909. idx /= OSSL_NELEM(tx_ack_cases);
  910. space = idx % QUIC_PN_SPACE_NUM;
  911. idx /= QUIC_PN_SPACE_NUM;
  912. return test_tx_ack_case_actual(tidx, space, idx);
  913. }
  914. static int test_rx_ack(int idx)
  915. {
  916. int tidx;
  917. tidx = idx % OSSL_NELEM(rx_test_scripts);
  918. idx /= OSSL_NELEM(rx_test_scripts);
  919. return test_rx_ack_actual(tidx, idx);
  920. }
  921. int setup_tests(void)
  922. {
  923. ADD_ALL_TESTS(test_tx_ack_case,
  924. OSSL_NELEM(tx_ack_cases) * MODE_NUM * QUIC_PN_SPACE_NUM);
  925. ADD_ALL_TESTS(test_tx_ack_time_script, OSSL_NELEM(tx_ack_time_scripts));
  926. ADD_ALL_TESTS(test_rx_ack, OSSL_NELEM(rx_test_scripts) * QUIC_PN_SPACE_NUM);
  927. return 1;
  928. }