summaryrefslogtreecommitdiff
path: root/src/test/test_entrynodes.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2017-10-02 20:43:22 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2017-10-03 14:39:34 +0300
commitc9729853a5ccfc15d206c43be8e15aea93ae19ee (patch)
tree4e05bb01221e9a4cb54712f722ccd0abaf9f43cd /src/test/test_entrynodes.c
parentdddae36f5e0e9e088cd9aa98c6e4a6c904e1efa4 (diff)
downloadtor-c9729853a5ccfc15d206c43be8e15aea93ae19ee.tar.gz
tor-c9729853a5ccfc15d206c43be8e15aea93ae19ee.zip
entrynodes: Be specific about how many primary descriptors we miss.
Diffstat (limited to 'src/test/test_entrynodes.c')
-rw-r--r--src/test/test_entrynodes.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/test_entrynodes.c b/src/test/test_entrynodes.c
index 1e008c3a2f..36e457bdf1 100644
--- a/src/test/test_entrynodes.c
+++ b/src/test/test_entrynodes.c
@@ -1639,6 +1639,25 @@ test_entry_guard_manage_primary(void *arg)
tt_ptr_op(g, OP_EQ, smartlist_get(prev_guards, g_sl_idx));
});
+ /* Do some dirinfo checks */
+ {
+ /* Check that we have all required dirinfo for the primaries (that's done in
+ * big_fake_network_setup()) */
+ char *dir_info_str = guard_selection_get_dir_info_status_str(gs);
+ tt_assert(!dir_info_str);
+
+ /* Now artificially remove the first primary's descriptor and re-check */
+ entry_guard_t *first_primary;
+ first_primary = smartlist_get(gs->primary_entry_guards, 0);
+ /* Change the first primary's identity digest so that the mocked functions
+ * can't find its descriptor */
+ memset(first_primary->identity, 9, sizeof(first_primary->identity));
+ dir_info_str = guard_selection_get_dir_info_status_str(gs);
+ tt_str_op(dir_info_str, OP_EQ,
+ "We're missing descriptors for 1/2 of our primary entry guards");
+ tor_free(dir_info_str);
+ }
+
done:
guard_selection_free(gs);
smartlist_free(prev_guards);