test_channel.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. /* Copyright (c) 2013, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. #define TOR_CHANNEL_INTERNAL_
  4. #include "or.h"
  5. #include "channel.h"
  6. /* For channel_note_destroy_not_pending */
  7. #include "circuitlist.h"
  8. /* For var_cell_free */
  9. #include "connection_or.h"
  10. /* For packed_cell stuff */
  11. #define RELAY_PRIVATE
  12. #include "relay.h"
  13. /* For init/free stuff */
  14. #include "scheduler.h"
  15. #include "test.h"
  16. static int test_chan_accept_cells = 0;
  17. static int test_cells_written = 0;
  18. static int test_destroy_not_pending_calls = 0;
  19. static int test_doesnt_want_writes_count = 0;
  20. static double test_overhead_estimate = 1.0f;
  21. static int test_releases_count = 0;
  22. static void channel_note_destroy_not_pending_mock(channel_t *ch,
  23. circid_t circid);
  24. static void chan_test_close(channel_t *ch);
  25. static size_t chan_test_num_bytes_queued(channel_t *ch);
  26. static int chan_test_num_cells_writeable(channel_t *ch);
  27. static int chan_test_write_cell(channel_t *ch, cell_t *cell);
  28. static int chan_test_write_packed_cell(channel_t *ch,
  29. packed_cell_t *packed_cell);
  30. static int chan_test_write_var_cell(channel_t *ch, var_cell_t *var_cell);
  31. static void make_fake_cell(cell_t *c);
  32. static void make_fake_var_cell(var_cell_t *c);
  33. static channel_t * new_fake_channel(void);
  34. static void scheduler_channel_doesnt_want_writes_mock(channel_t *ch);
  35. static void scheduler_release_channel_mock(channel_t *ch);
  36. static void test_channel_lifecycle(void *arg);
  37. static void test_channel_multi(void *arg);
  38. static void test_channel_queue_size(void *arg);
  39. static void test_channel_write(void *arg);
  40. static void
  41. channel_note_destroy_not_pending_mock(channel_t *ch,
  42. circid_t circid)
  43. {
  44. (void)ch;
  45. (void)circid;
  46. ++test_destroy_not_pending_calls;
  47. }
  48. static void
  49. chan_test_close(channel_t *ch)
  50. {
  51. test_assert(ch);
  52. done:
  53. return;
  54. }
  55. static double
  56. chan_test_get_overhead_estimate(channel_t *ch)
  57. {
  58. test_assert(ch);
  59. done:
  60. return test_overhead_estimate;
  61. }
  62. static size_t
  63. chan_test_num_bytes_queued(channel_t *ch)
  64. {
  65. test_assert(ch);
  66. done:
  67. return 0;
  68. }
  69. static int
  70. chan_test_num_cells_writeable(channel_t *ch)
  71. {
  72. test_assert(ch);
  73. done:
  74. return 32;
  75. }
  76. static int
  77. chan_test_write_cell(channel_t *ch, cell_t *cell)
  78. {
  79. int rv = 0;
  80. test_assert(ch);
  81. test_assert(cell);
  82. if (test_chan_accept_cells) {
  83. /* Free the cell and bump the counter */
  84. tor_free(cell);
  85. ++test_cells_written;
  86. rv = 1;
  87. }
  88. /* else return 0, we didn't accept it */
  89. done:
  90. return rv;
  91. }
  92. static int
  93. chan_test_write_packed_cell(channel_t *ch,
  94. packed_cell_t *packed_cell)
  95. {
  96. int rv = 0;
  97. test_assert(ch);
  98. test_assert(packed_cell);
  99. if (test_chan_accept_cells) {
  100. /* Free the cell and bump the counter */
  101. packed_cell_free(packed_cell);
  102. ++test_cells_written;
  103. rv = 1;
  104. }
  105. /* else return 0, we didn't accept it */
  106. done:
  107. return rv;
  108. }
  109. static int
  110. chan_test_write_var_cell(channel_t *ch, var_cell_t *var_cell)
  111. {
  112. int rv = 0;
  113. test_assert(ch);
  114. test_assert(var_cell);
  115. if (test_chan_accept_cells) {
  116. /* Free the cell and bump the counter */
  117. var_cell_free(var_cell);
  118. ++test_cells_written;
  119. rv = 1;
  120. }
  121. /* else return 0, we didn't accept it */
  122. done:
  123. return rv;
  124. }
  125. static void
  126. make_fake_cell(cell_t *c)
  127. {
  128. test_assert(c != NULL);
  129. c->circ_id = 1;
  130. c->command = CELL_RELAY;
  131. memset(c->payload, 0, CELL_PAYLOAD_SIZE);
  132. done:
  133. return;
  134. }
  135. static void
  136. make_fake_var_cell(var_cell_t *c)
  137. {
  138. test_assert(c != NULL);
  139. c->circ_id = 1;
  140. c->command = CELL_VERSIONS;
  141. c->payload_len = CELL_PAYLOAD_SIZE / 2;
  142. memset(c->payload, 0, c->payload_len);
  143. done:
  144. return;
  145. }
  146. static channel_t *
  147. new_fake_channel(void)
  148. {
  149. channel_t *chan = tor_malloc_zero(sizeof(channel_t));
  150. channel_init(chan);
  151. chan->close = chan_test_close;
  152. chan->get_overhead_estimate = chan_test_get_overhead_estimate;
  153. chan->num_bytes_queued = chan_test_num_bytes_queued;
  154. chan->num_cells_writeable = chan_test_num_cells_writeable;
  155. chan->write_cell = chan_test_write_cell;
  156. chan->write_packed_cell = chan_test_write_packed_cell;
  157. chan->write_var_cell = chan_test_write_var_cell;
  158. chan->state = CHANNEL_STATE_OPEN;
  159. return chan;
  160. }
  161. static void
  162. scheduler_channel_doesnt_want_writes_mock(channel_t *ch)
  163. {
  164. (void)ch;
  165. /* Increment counter */
  166. ++test_doesnt_want_writes_count;
  167. return;
  168. }
  169. static void
  170. scheduler_release_channel_mock(channel_t *ch)
  171. {
  172. (void)ch;
  173. /* Increment counter */
  174. ++test_releases_count;
  175. return;
  176. }
  177. static void
  178. test_channel_lifecycle(void *arg)
  179. {
  180. channel_t *ch1 = NULL, *ch2 = NULL;
  181. cell_t *cell = NULL;
  182. int old_count, init_doesnt_want_writes_count;
  183. int init_releases_count;
  184. (void)arg;
  185. /* Mock these for the whole lifecycle test */
  186. MOCK(scheduler_channel_doesnt_want_writes,
  187. scheduler_channel_doesnt_want_writes_mock);
  188. MOCK(scheduler_release_channel,
  189. scheduler_release_channel_mock);
  190. /* Cache some initial counter values */
  191. init_doesnt_want_writes_count = test_doesnt_want_writes_count;
  192. init_releases_count = test_releases_count;
  193. /* Accept cells to lower layer */
  194. test_chan_accept_cells = 1;
  195. /* Use default overhead factor */
  196. test_overhead_estimate = 1.0f;
  197. ch1 = new_fake_channel();
  198. test_assert(ch1);
  199. /* Start it off in OPENING */
  200. ch1->state = CHANNEL_STATE_OPENING;
  201. /* Try to register it */
  202. channel_register(ch1);
  203. test_assert(ch1->registered);
  204. /* Try to write a cell through (should queue) */
  205. cell = tor_malloc_zero(sizeof(cell_t));
  206. make_fake_cell(cell);
  207. old_count = test_cells_written;
  208. channel_write_cell(ch1, cell);
  209. test_eq(old_count, test_cells_written);
  210. /* Move it to OPEN and flush */
  211. channel_change_state(ch1, CHANNEL_STATE_OPEN);
  212. /* Queue should drain */
  213. test_eq(old_count + 1, test_cells_written);
  214. /* Get another one */
  215. ch2 = new_fake_channel();
  216. test_assert(ch2);
  217. ch2->state = CHANNEL_STATE_OPENING;
  218. /* Register */
  219. channel_register(ch2);
  220. test_assert(ch2->registered);
  221. /* Check counters */
  222. test_eq(test_doesnt_want_writes_count, init_doesnt_want_writes_count);
  223. test_eq(test_releases_count, init_releases_count);
  224. /* Move ch1 to MAINT */
  225. channel_change_state(ch1, CHANNEL_STATE_MAINT);
  226. test_eq(test_doesnt_want_writes_count, init_doesnt_want_writes_count + 1);
  227. test_eq(test_releases_count, init_releases_count);
  228. /* Move ch2 to OPEN */
  229. channel_change_state(ch2, CHANNEL_STATE_OPEN);
  230. test_eq(test_doesnt_want_writes_count, init_doesnt_want_writes_count + 1);
  231. test_eq(test_releases_count, init_releases_count);
  232. /* Move ch1 back to OPEN */
  233. channel_change_state(ch1, CHANNEL_STATE_OPEN);
  234. test_eq(test_doesnt_want_writes_count, init_doesnt_want_writes_count + 1);
  235. test_eq(test_releases_count, init_releases_count);
  236. /* Mark ch2 for close */
  237. channel_mark_for_close(ch2);
  238. test_eq(ch2->state, CHANNEL_STATE_CLOSING);
  239. test_eq(test_doesnt_want_writes_count, init_doesnt_want_writes_count + 1);
  240. test_eq(test_releases_count, init_releases_count + 1);
  241. /* Shut down channels */
  242. channel_free_all();
  243. ch1 = ch2 = NULL;
  244. test_eq(test_doesnt_want_writes_count, init_doesnt_want_writes_count + 1);
  245. /* channel_free() calls scheduler_release_channel() */
  246. test_eq(test_releases_count, init_releases_count + 4);
  247. done:
  248. tor_free(ch1);
  249. tor_free(ch2);
  250. UNMOCK(scheduler_channel_doesnt_want_writes);
  251. UNMOCK(scheduler_release_channel);
  252. return;
  253. }
  254. static void
  255. test_channel_multi(void *arg)
  256. {
  257. channel_t *ch1 = NULL, *ch2 = NULL;
  258. uint64_t global_queue_estimate;
  259. cell_t *cell = NULL;
  260. (void)arg;
  261. /* Accept cells to lower layer */
  262. test_chan_accept_cells = 1;
  263. /* Use default overhead factor */
  264. test_overhead_estimate = 1.0f;
  265. ch1 = new_fake_channel();
  266. test_assert(ch1);
  267. ch2 = new_fake_channel();
  268. test_assert(ch2);
  269. /* Initial queue size update */
  270. channel_update_xmit_queue_size(ch1);
  271. test_eq(ch1->bytes_queued_for_xmit, 0);
  272. channel_update_xmit_queue_size(ch2);
  273. test_eq(ch2->bytes_queued_for_xmit, 0);
  274. global_queue_estimate = channel_get_global_queue_estimate();
  275. test_eq(global_queue_estimate, 0);
  276. /* Queue some cells, check queue estimates */
  277. cell = tor_malloc_zero(sizeof(cell_t));
  278. make_fake_cell(cell);
  279. channel_write_cell(ch1, cell);
  280. cell = tor_malloc_zero(sizeof(cell_t));
  281. make_fake_cell(cell);
  282. channel_write_cell(ch2, cell);
  283. channel_update_xmit_queue_size(ch1);
  284. channel_update_xmit_queue_size(ch2);
  285. test_eq(ch1->bytes_queued_for_xmit, 0);
  286. test_eq(ch2->bytes_queued_for_xmit, 0);
  287. global_queue_estimate = channel_get_global_queue_estimate();
  288. test_eq(global_queue_estimate, 0);
  289. /* Stop accepting cells at lower layer */
  290. test_chan_accept_cells = 0;
  291. /* Queue some cells and check queue estimates */
  292. cell = tor_malloc_zero(sizeof(cell_t));
  293. make_fake_cell(cell);
  294. channel_write_cell(ch1, cell);
  295. channel_update_xmit_queue_size(ch1);
  296. test_eq(ch1->bytes_queued_for_xmit, 512);
  297. global_queue_estimate = channel_get_global_queue_estimate();
  298. test_eq(global_queue_estimate, 512);
  299. cell = tor_malloc_zero(sizeof(cell_t));
  300. make_fake_cell(cell);
  301. channel_write_cell(ch2, cell);
  302. channel_update_xmit_queue_size(ch2);
  303. test_eq(ch2->bytes_queued_for_xmit, 512);
  304. global_queue_estimate = channel_get_global_queue_estimate();
  305. test_eq(global_queue_estimate, 1024);
  306. /* Allow cells through again */
  307. test_chan_accept_cells = 1;
  308. /* Flush chan 2 */
  309. channel_flush_cells(ch2);
  310. /* Update and check queue sizes */
  311. channel_update_xmit_queue_size(ch1);
  312. channel_update_xmit_queue_size(ch2);
  313. test_eq(ch1->bytes_queued_for_xmit, 512);
  314. test_eq(ch2->bytes_queued_for_xmit, 0);
  315. global_queue_estimate = channel_get_global_queue_estimate();
  316. test_eq(global_queue_estimate, 512);
  317. /* Flush chan 1 */
  318. channel_flush_cells(ch1);
  319. /* Update and check queue sizes */
  320. channel_update_xmit_queue_size(ch1);
  321. channel_update_xmit_queue_size(ch2);
  322. test_eq(ch1->bytes_queued_for_xmit, 0);
  323. test_eq(ch2->bytes_queued_for_xmit, 0);
  324. global_queue_estimate = channel_get_global_queue_estimate();
  325. test_eq(global_queue_estimate, 0);
  326. /* Now block again */
  327. test_chan_accept_cells = 0;
  328. /* Queue some cells */
  329. cell = tor_malloc_zero(sizeof(cell_t));
  330. make_fake_cell(cell);
  331. channel_write_cell(ch1, cell);
  332. cell = tor_malloc_zero(sizeof(cell_t));
  333. make_fake_cell(cell);
  334. channel_write_cell(ch2, cell);
  335. /* Check the estimates */
  336. channel_update_xmit_queue_size(ch1);
  337. channel_update_xmit_queue_size(ch2);
  338. test_eq(ch1->bytes_queued_for_xmit, 512);
  339. test_eq(ch2->bytes_queued_for_xmit, 512);
  340. global_queue_estimate = channel_get_global_queue_estimate();
  341. test_eq(global_queue_estimate, 1024);
  342. /* Now close channel 2; it should be subtracted from the global queue */
  343. MOCK(scheduler_release_channel, scheduler_release_channel_mock);
  344. channel_mark_for_close(ch2);
  345. UNMOCK(scheduler_release_channel);
  346. global_queue_estimate = channel_get_global_queue_estimate();
  347. test_eq(global_queue_estimate, 512);
  348. /* Now free everything */
  349. MOCK(scheduler_release_channel, scheduler_release_channel_mock);
  350. channel_free_all();
  351. UNMOCK(scheduler_release_channel);
  352. done:
  353. tor_free(ch1);
  354. tor_free(ch2);
  355. return;
  356. }
  357. static void
  358. test_channel_queue_size(void *arg)
  359. {
  360. channel_t *ch = NULL;
  361. cell_t *cell = NULL;
  362. int n, old_count;
  363. uint64_t global_queue_estimate;
  364. (void)arg;
  365. ch = new_fake_channel();
  366. test_assert(ch);
  367. /* Initial queue size update */
  368. channel_update_xmit_queue_size(ch);
  369. test_eq(ch->bytes_queued_for_xmit, 0);
  370. global_queue_estimate = channel_get_global_queue_estimate();
  371. test_eq(global_queue_estimate, 0);
  372. /* Test the call-through to our fake lower layer */
  373. n = channel_num_cells_writeable(ch);
  374. /* chan_test_num_cells_writeable() always returns 32 */
  375. test_eq(n, 32);
  376. /*
  377. * Now we queue some cells and check that channel_num_cells_writeable()
  378. * adjusts properly
  379. */
  380. /* tell it not to accept cells */
  381. test_chan_accept_cells = 0;
  382. /* ...and keep it from trying to flush the queue */
  383. ch->state = CHANNEL_STATE_MAINT;
  384. /* Get a fresh cell */
  385. cell = tor_malloc_zero(sizeof(cell_t));
  386. make_fake_cell(cell);
  387. old_count = test_cells_written;
  388. channel_write_cell(ch, cell);
  389. /* Assert that it got queued, not written through, correctly */
  390. test_eq(test_cells_written, old_count);
  391. /* Now check chan_test_num_cells_writeable() again */
  392. n = channel_num_cells_writeable(ch);
  393. test_eq(n, 0); /* Should return 0 since we're in CHANNEL_STATE_MAINT */
  394. /* Update queue size estimates */
  395. channel_update_xmit_queue_size(ch);
  396. /* One cell, times an overhead factor of 1.0 */
  397. test_eq(ch->bytes_queued_for_xmit, 512);
  398. /* Try a different overhead factor */
  399. test_overhead_estimate = 0.5f;
  400. /* This one should be ignored since it's below 1.0 */
  401. channel_update_xmit_queue_size(ch);
  402. test_eq(ch->bytes_queued_for_xmit, 512);
  403. /* Now try a larger one */
  404. test_overhead_estimate = 2.0f;
  405. channel_update_xmit_queue_size(ch);
  406. test_eq(ch->bytes_queued_for_xmit, 1024);
  407. /* Go back to 1.0 */
  408. test_overhead_estimate = 1.0f;
  409. channel_update_xmit_queue_size(ch);
  410. test_eq(ch->bytes_queued_for_xmit, 512);
  411. /* Check the global estimate too */
  412. global_queue_estimate = channel_get_global_queue_estimate();
  413. test_eq(global_queue_estimate, 512);
  414. /* Go to open */
  415. old_count = test_cells_written;
  416. channel_change_state(ch, CHANNEL_STATE_OPEN);
  417. /*
  418. * It should try to write, but we aren't accepting cells right now, so
  419. * it'll requeue
  420. */
  421. test_eq(test_cells_written, old_count);
  422. /* Check the queue size again */
  423. channel_update_xmit_queue_size(ch);
  424. test_eq(ch->bytes_queued_for_xmit, 512);
  425. global_queue_estimate = channel_get_global_queue_estimate();
  426. test_eq(global_queue_estimate, 512);
  427. /*
  428. * Now the cell is in the queue, and we're open, so we should get 31
  429. * writeable cells.
  430. */
  431. n = channel_num_cells_writeable(ch);
  432. test_eq(n, 31);
  433. /* Accept cells again */
  434. test_chan_accept_cells = 1;
  435. /* ...and re-process the queue */
  436. old_count = test_cells_written;
  437. channel_flush_cells(ch);
  438. test_eq(test_cells_written, old_count + 1);
  439. /* Should have 32 writeable now */
  440. n = channel_num_cells_writeable(ch);
  441. test_eq(n, 32);
  442. /* Should have queue size estimate of zero */
  443. channel_update_xmit_queue_size(ch);
  444. test_eq(ch->bytes_queued_for_xmit, 0);
  445. global_queue_estimate = channel_get_global_queue_estimate();
  446. test_eq(global_queue_estimate, 0);
  447. /* Okay, now we're done with this one */
  448. MOCK(scheduler_release_channel, scheduler_release_channel_mock);
  449. channel_mark_for_close(ch);
  450. UNMOCK(scheduler_release_channel);
  451. done:
  452. tor_free(ch);
  453. return;
  454. }
  455. static void
  456. test_channel_write(void *arg)
  457. {
  458. channel_t *ch = NULL;
  459. cell_t *cell = tor_malloc_zero(sizeof(cell_t));
  460. packed_cell_t *packed_cell = NULL;
  461. var_cell_t *var_cell =
  462. tor_malloc_zero(sizeof(var_cell_t) + CELL_PAYLOAD_SIZE);
  463. int old_count;
  464. (void)arg;
  465. init_cell_pool();
  466. packed_cell = packed_cell_new();
  467. test_assert(packed_cell);
  468. ch = new_fake_channel();
  469. test_assert(ch);
  470. make_fake_cell(cell);
  471. make_fake_var_cell(var_cell);
  472. /* Tell it to accept cells */
  473. test_chan_accept_cells = 1;
  474. old_count = test_cells_written;
  475. channel_write_cell(ch, cell);
  476. test_assert(test_cells_written == old_count + 1);
  477. channel_write_var_cell(ch, var_cell);
  478. test_assert(test_cells_written == old_count + 2);
  479. channel_write_packed_cell(ch, packed_cell);
  480. test_assert(test_cells_written == old_count + 3);
  481. /* Now we test queueing; tell it not to accept cells */
  482. test_chan_accept_cells = 0;
  483. /* ...and keep it from trying to flush the queue */
  484. ch->state = CHANNEL_STATE_MAINT;
  485. /* Get a fresh cell */
  486. cell = tor_malloc_zero(sizeof(cell_t));
  487. make_fake_cell(cell);
  488. old_count = test_cells_written;
  489. channel_write_cell(ch, cell);
  490. test_assert(test_cells_written == old_count);
  491. /*
  492. * Now change back to open with channel_change_state() and assert that it
  493. * gets drained from the queue.
  494. */
  495. test_chan_accept_cells = 1;
  496. channel_change_state(ch, CHANNEL_STATE_OPEN);
  497. test_assert(test_cells_written == old_count + 1);
  498. /*
  499. * Check the note destroy case
  500. */
  501. cell = tor_malloc_zero(sizeof(cell_t));
  502. make_fake_cell(cell);
  503. cell->command = CELL_DESTROY;
  504. /* Set up the mock */
  505. MOCK(channel_note_destroy_not_pending,
  506. channel_note_destroy_not_pending_mock);
  507. old_count = test_destroy_not_pending_calls;
  508. channel_write_cell(ch, cell);
  509. test_assert(test_destroy_not_pending_calls == old_count + 1);
  510. /* Now send a non-destroy and check we don't call it */
  511. cell = tor_malloc_zero(sizeof(cell_t));
  512. make_fake_cell(cell);
  513. channel_write_cell(ch, cell);
  514. test_assert(test_destroy_not_pending_calls == old_count + 1);
  515. UNMOCK(channel_note_destroy_not_pending);
  516. /*
  517. * Now switch it to CLOSING so we can test the discard-cells case
  518. * in the channel_write_*() functions.
  519. */
  520. MOCK(scheduler_release_channel, scheduler_release_channel_mock);
  521. channel_mark_for_close(ch);
  522. UNMOCK(scheduler_release_channel);
  523. /* Send cells that will drop in the closing state */
  524. old_count = test_cells_written;
  525. cell = tor_malloc_zero(sizeof(cell_t));
  526. make_fake_cell(cell);
  527. channel_write_cell(ch, cell);
  528. test_assert(test_cells_written == old_count);
  529. var_cell = tor_malloc_zero(sizeof(var_cell_t) + CELL_PAYLOAD_SIZE);
  530. make_fake_var_cell(var_cell);
  531. channel_write_var_cell(ch, var_cell);
  532. test_assert(test_cells_written == old_count);
  533. packed_cell = packed_cell_new();
  534. channel_write_packed_cell(ch, packed_cell);
  535. test_assert(test_cells_written == old_count);
  536. free_cell_pool();
  537. done:
  538. tor_free(ch);
  539. return;
  540. }
  541. struct testcase_t channel_tests[] = {
  542. { "lifecycle", test_channel_lifecycle, TT_FORK, NULL, NULL },
  543. { "multi", test_channel_multi, TT_FORK, NULL, NULL },
  544. { "queue_size", test_channel_queue_size, TT_FORK, NULL, NULL },
  545. { "write", test_channel_write, TT_FORK, NULL, NULL },
  546. END_OF_TESTCASES
  547. };