test_hs_cache.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565
  1. /* Copyright (c) 2016-2019, The Tor Project, Inc. */
  2. /* See LICENSE for licensing information */
  3. /**
  4. * \file test_hs_cache.c
  5. * \brief Test hidden service caches.
  6. */
  7. #define CONNECTION_PRIVATE
  8. #define DIRCACHE_PRIVATE
  9. #define DIRCLIENT_PRIVATE
  10. #define HS_CACHE_PRIVATE
  11. #include "trunnel/ed25519_cert.h"
  12. #include "feature/hs/hs_cache.h"
  13. #include "feature/rend/rendcache.h"
  14. #include "feature/dircache/dircache.h"
  15. #include "feature/dirclient/dirclient.h"
  16. #include "feature/nodelist/networkstatus.h"
  17. #include "core/mainloop/connection.h"
  18. #include "core/proto/proto_http.h"
  19. #include "lib/crypt_ops/crypto_format.h"
  20. #include "feature/dircommon/dir_connection_st.h"
  21. #include "feature/nodelist/networkstatus_st.h"
  22. #include "test/hs_test_helpers.h"
  23. #include "test/test_helpers.h"
  24. #include "test/test.h"
  25. /* Static variable used to encoded the HSDir query. */
  26. static char query_b64[256];
  27. /* Build an HSDir query using a ed25519 public key. */
  28. static const char *
  29. helper_get_hsdir_query(const hs_descriptor_t *desc)
  30. {
  31. ed25519_public_to_base64(query_b64, &desc->plaintext_data.blinded_pubkey);
  32. return query_b64;
  33. }
  34. static void
  35. init_test(void)
  36. {
  37. /* Always needed. Initialize the subsystem. */
  38. hs_cache_init();
  39. /* We need the v2 cache since our OOM and cache cleanup does poke at it. */
  40. rend_cache_init();
  41. }
  42. static void
  43. test_directory(void *arg)
  44. {
  45. int ret;
  46. size_t oom_size;
  47. char *desc1_str = NULL;
  48. const char *desc_out;
  49. ed25519_keypair_t signing_kp1;
  50. hs_descriptor_t *desc1 = NULL;
  51. (void) arg;
  52. init_test();
  53. /* Generate a valid descriptor with normal values. */
  54. ret = ed25519_keypair_generate(&signing_kp1, 0);
  55. tt_int_op(ret, OP_EQ, 0);
  56. desc1 = hs_helper_build_hs_desc_with_ip(&signing_kp1);
  57. tt_assert(desc1);
  58. ret = hs_desc_encode_descriptor(desc1, &signing_kp1, NULL, &desc1_str);
  59. tt_int_op(ret, OP_EQ, 0);
  60. /* Very first basic test, should be able to be stored, survive a
  61. * clean, found with a lookup and then cleaned by our OOM. */
  62. {
  63. ret = hs_cache_store_as_dir(desc1_str);
  64. tt_int_op(ret, OP_EQ, 0);
  65. /* Re-add, it should fail since we already have it. */
  66. ret = hs_cache_store_as_dir(desc1_str);
  67. tt_int_op(ret, OP_EQ, -1);
  68. /* Try to clean now which should be fine, there is at worst few seconds
  69. * between the store and this call. */
  70. hs_cache_clean_as_dir(time(NULL));
  71. /* We should find it in our cache. */
  72. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  73. tt_int_op(ret, OP_EQ, 1);
  74. tt_str_op(desc_out, OP_EQ, desc1_str);
  75. /* Tell our OOM to run and to at least remove a byte which will result in
  76. * removing the descriptor from our cache. */
  77. oom_size = hs_cache_handle_oom(time(NULL), 1);
  78. tt_int_op(oom_size, OP_GE, 1);
  79. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  80. tt_int_op(ret, OP_EQ, 0);
  81. }
  82. /* Store two descriptors and remove the expiring one only. */
  83. {
  84. ed25519_keypair_t signing_kp_zero;
  85. ret = ed25519_keypair_generate(&signing_kp_zero, 0);
  86. tt_int_op(ret, OP_EQ, 0);
  87. hs_descriptor_t *desc_zero_lifetime;
  88. desc_zero_lifetime = hs_helper_build_hs_desc_with_ip(&signing_kp_zero);
  89. tt_assert(desc_zero_lifetime);
  90. desc_zero_lifetime->plaintext_data.revision_counter = 1;
  91. desc_zero_lifetime->plaintext_data.lifetime_sec = 0;
  92. char *desc_zero_lifetime_str;
  93. ret = hs_desc_encode_descriptor(desc_zero_lifetime, &signing_kp_zero,
  94. NULL, &desc_zero_lifetime_str);
  95. tt_int_op(ret, OP_EQ, 0);
  96. ret = hs_cache_store_as_dir(desc1_str);
  97. tt_int_op(ret, OP_EQ, 0);
  98. ret = hs_cache_store_as_dir(desc_zero_lifetime_str);
  99. tt_int_op(ret, OP_EQ, 0);
  100. /* This one should clear out our zero lifetime desc. */
  101. hs_cache_clean_as_dir(time(NULL));
  102. /* We should find desc1 in our cache. */
  103. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  104. tt_int_op(ret, OP_EQ, 1);
  105. tt_str_op(desc_out, OP_EQ, desc1_str);
  106. /* We should NOT find our zero lifetime desc in our cache. */
  107. ret = hs_cache_lookup_as_dir(3,
  108. helper_get_hsdir_query(desc_zero_lifetime),
  109. NULL);
  110. tt_int_op(ret, OP_EQ, 0);
  111. /* Cleanup our entire cache. */
  112. oom_size = hs_cache_handle_oom(time(NULL), 1);
  113. tt_int_op(oom_size, OP_GE, 1);
  114. hs_descriptor_free(desc_zero_lifetime);
  115. tor_free(desc_zero_lifetime_str);
  116. }
  117. /* Throw junk at it. */
  118. {
  119. ret = hs_cache_store_as_dir("blah");
  120. tt_int_op(ret, OP_EQ, -1);
  121. /* Poor attempt at tricking the decoding. */
  122. ret = hs_cache_store_as_dir("hs-descriptor 3\nJUNK");
  123. tt_int_op(ret, OP_EQ, -1);
  124. /* Undecodable base64 query. */
  125. ret = hs_cache_lookup_as_dir(3, "blah", NULL);
  126. tt_int_op(ret, OP_EQ, -1);
  127. /* Decodable base64 query but wrong ed25519 size. */
  128. ret = hs_cache_lookup_as_dir(3, "dW5pY29ybg==", NULL);
  129. tt_int_op(ret, OP_EQ, -1);
  130. }
  131. /* Test descriptor replacement with revision counter. */
  132. {
  133. char *new_desc_str;
  134. /* Add a descriptor. */
  135. ret = hs_cache_store_as_dir(desc1_str);
  136. tt_int_op(ret, OP_EQ, 0);
  137. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  138. tt_int_op(ret, OP_EQ, 1);
  139. /* Bump revision counter. */
  140. desc1->plaintext_data.revision_counter++;
  141. ret = hs_desc_encode_descriptor(desc1, &signing_kp1, NULL, &new_desc_str);
  142. tt_int_op(ret, OP_EQ, 0);
  143. ret = hs_cache_store_as_dir(new_desc_str);
  144. tt_int_op(ret, OP_EQ, 0);
  145. /* Look it up, it should have been replaced. */
  146. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), &desc_out);
  147. tt_int_op(ret, OP_EQ, 1);
  148. tt_str_op(desc_out, OP_EQ, new_desc_str);
  149. tor_free(new_desc_str);
  150. }
  151. done:
  152. hs_descriptor_free(desc1);
  153. tor_free(desc1_str);
  154. }
  155. static void
  156. test_clean_as_dir(void *arg)
  157. {
  158. size_t ret;
  159. char *desc1_str = NULL;
  160. time_t now = time(NULL);
  161. hs_descriptor_t *desc1 = NULL;
  162. ed25519_keypair_t signing_kp1;
  163. (void) arg;
  164. init_test();
  165. /* Generate a valid descriptor with values. */
  166. ret = ed25519_keypair_generate(&signing_kp1, 0);
  167. tt_int_op(ret, OP_EQ, 0);
  168. desc1 = hs_helper_build_hs_desc_with_ip(&signing_kp1);
  169. tt_assert(desc1);
  170. ret = hs_desc_encode_descriptor(desc1, &signing_kp1, NULL, &desc1_str);
  171. tt_int_op(ret, OP_EQ, 0);
  172. ret = hs_cache_store_as_dir(desc1_str);
  173. tt_int_op(ret, OP_EQ, 0);
  174. /* With the lifetime being 3 hours, a cleanup shouldn't remove it. */
  175. ret = cache_clean_v3_as_dir(now, 0);
  176. tt_int_op(ret, OP_EQ, 0);
  177. /* Should be present after clean up. */
  178. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  179. tt_int_op(ret, OP_EQ, 1);
  180. /* Set a cutoff 100 seconds in the past. It should not remove the entry
  181. * since the entry is still recent enough. */
  182. ret = cache_clean_v3_as_dir(now, now - 100);
  183. tt_int_op(ret, OP_EQ, 0);
  184. /* Should be present after clean up. */
  185. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  186. tt_int_op(ret, OP_EQ, 1);
  187. /* Set a cutoff of 100 seconds in the future. It should remove the entry
  188. * that we've just added since it's not too old for the cutoff. */
  189. ret = cache_clean_v3_as_dir(now, now + 100);
  190. tt_int_op(ret, OP_GT, 0);
  191. /* Shouldn't be present after clean up. */
  192. ret = hs_cache_lookup_as_dir(3, helper_get_hsdir_query(desc1), NULL);
  193. tt_int_op(ret, OP_EQ, 0);
  194. done:
  195. hs_descriptor_free(desc1);
  196. tor_free(desc1_str);
  197. }
  198. /* Test helper: Fetch an HS descriptor from an HSDir (for the hidden service
  199. with <b>blinded_key</b>. Return the received descriptor string. */
  200. static char *
  201. helper_fetch_desc_from_hsdir(const ed25519_public_key_t *blinded_key)
  202. {
  203. int retval;
  204. char *received_desc = NULL;
  205. char *hsdir_query_str = NULL;
  206. /* The dir conn we are going to simulate */
  207. dir_connection_t *conn = NULL;
  208. /* First extract the blinded public key that we are going to use in our
  209. query, and then build the actual query string. */
  210. {
  211. char hsdir_cache_key[ED25519_BASE64_LEN+1];
  212. ed25519_public_to_base64(hsdir_cache_key, blinded_key);
  213. tor_asprintf(&hsdir_query_str, GET("/tor/hs/3/%s"), hsdir_cache_key);
  214. }
  215. /* Simulate an HTTP GET request to the HSDir */
  216. conn = dir_connection_new(AF_INET);
  217. tt_assert(conn);
  218. tor_addr_from_ipv4h(&conn->base_.addr, 0x7f000001);
  219. TO_CONN(conn)->linked = 1;/* Pretend the conn is encrypted :) */
  220. retval = directory_handle_command_get(conn, hsdir_query_str,
  221. NULL, 0);
  222. tt_int_op(retval, OP_EQ, 0);
  223. /* Read the descriptor that the HSDir just served us */
  224. {
  225. char *headers = NULL;
  226. size_t body_used = 0;
  227. fetch_from_buf_http(TO_CONN(conn)->outbuf, &headers, MAX_HEADERS_SIZE,
  228. &received_desc, &body_used, HS_DESC_MAX_LEN, 0);
  229. tor_free(headers);
  230. }
  231. done:
  232. tor_free(hsdir_query_str);
  233. if (conn)
  234. connection_free_minimal(TO_CONN(conn));
  235. return received_desc;
  236. }
  237. /* Publish a descriptor to the HSDir, then fetch it. Check that the received
  238. descriptor matches the published one. */
  239. static void
  240. test_upload_and_download_hs_desc(void *arg)
  241. {
  242. int retval;
  243. hs_descriptor_t *published_desc = NULL;
  244. char *published_desc_str = NULL;
  245. char *received_desc_str = NULL;
  246. (void) arg;
  247. /* Initialize HSDir cache subsystem */
  248. init_test();
  249. /* Test a descriptor not found in the directory cache. */
  250. {
  251. ed25519_public_key_t blinded_key;
  252. memset(&blinded_key.pubkey, 'A', sizeof(blinded_key.pubkey));
  253. received_desc_str = helper_fetch_desc_from_hsdir(&blinded_key);
  254. tt_int_op(strlen(received_desc_str), OP_EQ, 0);
  255. tor_free(received_desc_str);
  256. }
  257. /* Generate a valid descriptor with normal values. */
  258. {
  259. ed25519_keypair_t signing_kp;
  260. retval = ed25519_keypair_generate(&signing_kp, 0);
  261. tt_int_op(retval, OP_EQ, 0);
  262. published_desc = hs_helper_build_hs_desc_with_ip(&signing_kp);
  263. tt_assert(published_desc);
  264. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  265. NULL, &published_desc_str);
  266. tt_int_op(retval, OP_EQ, 0);
  267. }
  268. /* Publish descriptor to the HSDir */
  269. {
  270. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  271. tt_int_op(retval, OP_EQ, 200);
  272. }
  273. /* Simulate a fetch of the previously published descriptor */
  274. {
  275. const ed25519_public_key_t *blinded_key;
  276. blinded_key = &published_desc->plaintext_data.blinded_pubkey;
  277. received_desc_str = helper_fetch_desc_from_hsdir(blinded_key);
  278. }
  279. /* Verify we received the exact same descriptor we published earlier */
  280. tt_str_op(received_desc_str, OP_EQ, published_desc_str);
  281. tor_free(received_desc_str);
  282. /* With a valid descriptor in the directory cache, try again an invalid. */
  283. {
  284. ed25519_public_key_t blinded_key;
  285. memset(&blinded_key.pubkey, 'A', sizeof(blinded_key.pubkey));
  286. received_desc_str = helper_fetch_desc_from_hsdir(&blinded_key);
  287. tt_int_op(strlen(received_desc_str), OP_EQ, 0);
  288. }
  289. done:
  290. tor_free(received_desc_str);
  291. tor_free(published_desc_str);
  292. hs_descriptor_free(published_desc);
  293. }
  294. /* Test that HSDirs reject outdated descriptors based on their revision
  295. * counter. Also test that HSDirs correctly replace old descriptors with newer
  296. * descriptors. */
  297. static void
  298. test_hsdir_revision_counter_check(void *arg)
  299. {
  300. int retval;
  301. ed25519_keypair_t signing_kp;
  302. hs_descriptor_t *published_desc = NULL;
  303. char *published_desc_str = NULL;
  304. uint8_t subcredential[DIGEST256_LEN];
  305. char *received_desc_str = NULL;
  306. hs_descriptor_t *received_desc = NULL;
  307. (void) arg;
  308. /* Initialize HSDir cache subsystem */
  309. init_test();
  310. /* Generate a valid descriptor with normal values. */
  311. {
  312. retval = ed25519_keypair_generate(&signing_kp, 0);
  313. tt_int_op(retval, OP_EQ, 0);
  314. published_desc = hs_helper_build_hs_desc_with_ip(&signing_kp);
  315. tt_assert(published_desc);
  316. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  317. NULL, &published_desc_str);
  318. tt_int_op(retval, OP_EQ, 0);
  319. }
  320. /* Publish descriptor to the HSDir */
  321. {
  322. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  323. tt_int_op(retval, OP_EQ, 200);
  324. }
  325. /* Try publishing again with the same revision counter: Should fail. */
  326. {
  327. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  328. tt_int_op(retval, OP_EQ, 400);
  329. }
  330. /* Fetch the published descriptor and validate the revision counter. */
  331. {
  332. const ed25519_public_key_t *blinded_key;
  333. blinded_key = &published_desc->plaintext_data.blinded_pubkey;
  334. hs_get_subcredential(&signing_kp.pubkey, blinded_key, subcredential);
  335. received_desc_str = helper_fetch_desc_from_hsdir(blinded_key);
  336. retval = hs_desc_decode_descriptor(received_desc_str,
  337. subcredential, NULL, &received_desc);
  338. tt_int_op(retval, OP_EQ, 0);
  339. tt_assert(received_desc);
  340. /* Check that the revision counter is correct */
  341. tt_u64_op(received_desc->plaintext_data.revision_counter, OP_EQ, 42);
  342. hs_descriptor_free(received_desc);
  343. received_desc = NULL;
  344. tor_free(received_desc_str);
  345. }
  346. /* Increment the revision counter and try again. Should work. */
  347. {
  348. published_desc->plaintext_data.revision_counter = 1313;
  349. tor_free(published_desc_str);
  350. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  351. NULL, &published_desc_str);
  352. tt_int_op(retval, OP_EQ, 0);
  353. retval = handle_post_hs_descriptor("/tor/hs/3/publish",published_desc_str);
  354. tt_int_op(retval, OP_EQ, 200);
  355. }
  356. /* Again, fetch the published descriptor and perform the revision counter
  357. validation. The revision counter must have changed. */
  358. {
  359. const ed25519_public_key_t *blinded_key;
  360. blinded_key = &published_desc->plaintext_data.blinded_pubkey;
  361. received_desc_str = helper_fetch_desc_from_hsdir(blinded_key);
  362. retval = hs_desc_decode_descriptor(received_desc_str,
  363. subcredential, NULL, &received_desc);
  364. tt_int_op(retval, OP_EQ, 0);
  365. tt_assert(received_desc);
  366. /* Check that the revision counter is the latest */
  367. tt_u64_op(received_desc->plaintext_data.revision_counter, OP_EQ, 1313);
  368. }
  369. done:
  370. hs_descriptor_free(published_desc);
  371. hs_descriptor_free(received_desc);
  372. tor_free(received_desc_str);
  373. tor_free(published_desc_str);
  374. }
  375. static networkstatus_t mock_ns;
  376. static networkstatus_t *
  377. mock_networkstatus_get_live_consensus(time_t now)
  378. {
  379. (void) now;
  380. return &mock_ns;
  381. }
  382. /** Test that we can store HS descriptors in the client HS cache. */
  383. static void
  384. test_client_cache(void *arg)
  385. {
  386. int retval;
  387. ed25519_keypair_t signing_kp;
  388. hs_descriptor_t *published_desc = NULL;
  389. char *published_desc_str = NULL;
  390. uint8_t wanted_subcredential[DIGEST256_LEN];
  391. response_handler_args_t *args = NULL;
  392. dir_connection_t *conn = NULL;
  393. (void) arg;
  394. /* Initialize HSDir cache subsystem */
  395. init_test();
  396. MOCK(networkstatus_get_live_consensus,
  397. mock_networkstatus_get_live_consensus);
  398. /* Set consensus time */
  399. parse_rfc1123_time("Sat, 26 Oct 1985 13:00:00 UTC",
  400. &mock_ns.valid_after);
  401. parse_rfc1123_time("Sat, 26 Oct 1985 14:00:00 UTC",
  402. &mock_ns.fresh_until);
  403. parse_rfc1123_time("Sat, 26 Oct 1985 16:00:00 UTC",
  404. &mock_ns.valid_until);
  405. /* Generate a valid descriptor with normal values. */
  406. {
  407. retval = ed25519_keypair_generate(&signing_kp, 0);
  408. tt_int_op(retval, OP_EQ, 0);
  409. published_desc = hs_helper_build_hs_desc_with_ip(&signing_kp);
  410. tt_assert(published_desc);
  411. retval = hs_desc_encode_descriptor(published_desc, &signing_kp,
  412. NULL, &published_desc_str);
  413. tt_int_op(retval, OP_EQ, 0);
  414. memcpy(wanted_subcredential, published_desc->subcredential, DIGEST256_LEN);
  415. tt_assert(!fast_mem_is_zero((char*)wanted_subcredential, DIGEST256_LEN));
  416. }
  417. /* Test handle_response_fetch_hsdesc_v3() */
  418. {
  419. args = tor_malloc_zero(sizeof(response_handler_args_t));
  420. args->status_code = 200;
  421. args->reason = NULL;
  422. args->body = published_desc_str;
  423. args->body_len = strlen(published_desc_str);
  424. conn = tor_malloc_zero(sizeof(dir_connection_t));
  425. conn->hs_ident = tor_malloc_zero(sizeof(hs_ident_dir_conn_t));
  426. ed25519_pubkey_copy(&conn->hs_ident->identity_pk, &signing_kp.pubkey);
  427. }
  428. /* store the descriptor! */
  429. retval = handle_response_fetch_hsdesc_v3(conn, args);
  430. tt_int_op(retval, == , 0);
  431. /* Progress time a bit and attempt to clean cache: our desc should not be
  432. * cleaned since we still in the same TP. */
  433. {
  434. parse_rfc1123_time("Sat, 27 Oct 1985 02:00:00 UTC",
  435. &mock_ns.valid_after);
  436. parse_rfc1123_time("Sat, 27 Oct 1985 03:00:00 UTC",
  437. &mock_ns.fresh_until);
  438. parse_rfc1123_time("Sat, 27 Oct 1985 05:00:00 UTC",
  439. &mock_ns.valid_until);
  440. /* fetch the descriptor and make sure it's there */
  441. const hs_descriptor_t *cached_desc = NULL;
  442. cached_desc = hs_cache_lookup_as_client(&signing_kp.pubkey);
  443. tt_assert(cached_desc);
  444. tt_mem_op(cached_desc->subcredential, OP_EQ, wanted_subcredential,
  445. DIGEST256_LEN);
  446. }
  447. /* Progress time to next TP and check that desc was cleaned */
  448. {
  449. parse_rfc1123_time("Sat, 27 Oct 1985 12:00:00 UTC",
  450. &mock_ns.valid_after);
  451. parse_rfc1123_time("Sat, 27 Oct 1985 13:00:00 UTC",
  452. &mock_ns.fresh_until);
  453. parse_rfc1123_time("Sat, 27 Oct 1985 15:00:00 UTC",
  454. &mock_ns.valid_until);
  455. const hs_descriptor_t *cached_desc = NULL;
  456. cached_desc = hs_cache_lookup_as_client(&signing_kp.pubkey);
  457. tt_assert(!cached_desc);
  458. }
  459. done:
  460. tor_free(args);
  461. hs_descriptor_free(published_desc);
  462. tor_free(published_desc_str);
  463. if (conn) {
  464. tor_free(conn->hs_ident);
  465. tor_free(conn);
  466. }
  467. }
  468. struct testcase_t hs_cache[] = {
  469. /* Encoding tests. */
  470. { "directory", test_directory, TT_FORK,
  471. NULL, NULL },
  472. { "clean_as_dir", test_clean_as_dir, TT_FORK,
  473. NULL, NULL },
  474. { "hsdir_revision_counter_check", test_hsdir_revision_counter_check, TT_FORK,
  475. NULL, NULL },
  476. { "upload_and_download_hs_desc", test_upload_and_download_hs_desc, TT_FORK,
  477. NULL, NULL },
  478. { "client_cache", test_client_cache, TT_FORK,
  479. NULL, NULL },
  480. END_OF_TESTCASES
  481. };