From 011307dd5fa608739456b98d259b013286320b91 Mon Sep 17 00:00:00 2001 From: Neel Chauhan Date: Thu, 11 Apr 2019 15:20:31 -0400 Subject: Make repeated/rate limited HSFETCH queries fail with QUERY_RATE_LIMITED --- src/test/test_hs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/test/test_hs.c') 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, -- cgit v1.2.3-54-g00ecf