diff options
author | Neel Chauhan <neel@neelc.org> | 2019-04-11 15:20:31 -0400 |
---|---|---|
committer | Neel Chauhan <neel@neelc.org> | 2019-04-11 15:21:17 -0400 |
commit | 011307dd5fa608739456b98d259b013286320b91 (patch) | |
tree | 2562d6b959b2de6c460007f9e08fe2254a58bd07 /src/test/test_hs.c | |
parent | 3c64cfe649be78c738fa8175d94ad9a0db37ef87 (diff) | |
download | tor-011307dd5fa608739456b98d259b013286320b91.tar.gz tor-011307dd5fa608739456b98d259b013286320b91.zip |
Make repeated/rate limited HSFETCH queries fail with QUERY_RATE_LIMITED
Diffstat (limited to 'src/test/test_hs.c')
-rw-r--r-- | src/test/test_hs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/test_hs.c b/src/test/test_hs.c index aeb3387471..5d3327c777 100644 --- a/src/test/test_hs.c +++ b/src/test/test_hs.c @@ -323,6 +323,16 @@ test_hs_desc_event(void *arg) tt_str_op(received_msg,OP_EQ, expected_msg); tor_free(received_msg); + /* test HSDir rate limited */ + rend_query.auth_type = REND_NO_AUTH; + control_event_hsv2_descriptor_failed(&rend_query.base_, NULL, + "QUERY_RATE_LIMITED"); + expected_msg = "650 HS_DESC FAILED "STR_HS_ADDR" NO_AUTH " \ + "UNKNOWN REASON=QUERY_RATE_LIMITED\r\n"; + tt_assert(received_msg); + tt_str_op(received_msg,OP_EQ, expected_msg); + tor_free(received_msg); + /* Test invalid content with no HSDir fingerprint. */ char *exp_msg; control_event_hs_descriptor_content(rend_query.onion_address, |