Commit 87585ebd authored by David Goulet's avatar David Goulet 🐼 Committed by George Kadianakis
Browse files

test: Add an HS v3 reachability unit test



This is a large and important unit test for the hidden service version
3! It tests the service reachability for a client using different
consensus timings and makes sure that the computed hashring is the same
on both side so it is actually reachable.

Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
parent 4d38731e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ for my $fn (@ARGV) {
                    $1 ne "switch" and $1 ne "return" and $1 ne "int" and
                    $1 ne "elsif" and $1 ne "WINAPI" and $2 ne "WINAPI" and
                    $1 ne "void" and $1 ne "__attribute__" and $1 ne "op" and
                    $1 ne "size_t" and $1 ne "double" and
                    $1 ne "size_t" and $1 ne "double" and $1 ne "uint64_t" and
                    $1 ne "workqueue_reply_t") {
                    msg "     fn ():$fn:$.\n";
                }
+3 −1
Original line number Diff line number Diff line
@@ -38,6 +38,8 @@
 * used for authorities and fallback directories.)
 */

#define NODELIST_PRIVATE

#include "or.h"
#include "address.h"
#include "config.h"
@@ -176,7 +178,7 @@ node_get_or_create(const char *identity_digest)
/* For a given <b>node</b> for the consensus <b>ns</b>, set the hsdir index
 * for the node, both current and next if possible. This can only fails if the
 * node_t ed25519 identity key can't be found which would be a bug. */
static void
STATIC void
node_set_hsdir_index(node_t *node, const networkstatus_t *ns)
{
  time_t now = approx_time();
+11 −0
Original line number Diff line number Diff line
@@ -136,5 +136,16 @@ void router_dir_info_changed(void);
const char *get_dir_info_status_string(void);
int count_loading_descriptors_progress(void);

#ifdef NODELIST_PRIVATE

#ifdef TOR_UNIT_TESTS

STATIC void
node_set_hsdir_index(node_t *node, const networkstatus_t *ns);

#endif /* TOR_UNIT_TESTS */

#endif /* NODELIST_PRIVATE */

#endif
+635 −7

File changed.

Preview size limit exceeded, changes collapsed.