]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Test improvement: include microdesc lines in our synthetic microdesc consensuses.
authorNick Mathewson <nickm@torproject.org>
Tue, 2 Apr 2013 15:49:30 +0000 (11:49 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 18 Apr 2013 15:04:57 +0000 (11:04 -0400)
src/or/or.h
src/test/test_dir.c

index 45eb4673ce0df678d6c2fcc2ea0780354c92ba3e..b821caf310f8324678dff31f2b9937a6adc49455 100644 (file)
@@ -2321,7 +2321,8 @@ typedef struct networkstatus_v2_t {
 typedef struct vote_microdesc_hash_t {
   /** Next element in the list, or NULL. */
   struct vote_microdesc_hash_t *next;
-  /** The raw contents of the microdesc hash line, excluding the "m". */
+  /** The raw contents of the microdesc hash line, from the "m" through the
+   * newline. */
   char *microdesc_hash_line;
 } vote_microdesc_hash_t;
 
index ea0011a6d47fc66f007edf532ecb968aa7ebc09b..6652ee0b3edc2fb0efdf599125eab040bf54959d 100644 (file)
@@ -863,6 +863,13 @@ gen_routerstatus_for_v3ns(int idx, time_t now)
       /* Shouldn't happen */
       test_assert(0);
   }
+  if (vrs) {
+    vrs->microdesc = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
+    tor_asprintf(&vrs->microdesc->microdesc_hash_line,
+                 "m 9,10,11,12,13,14,15,16,17 "
+                 "sha256=xyzajkldsdsajdadlsdjaslsdksdjlsdjsdaskdaaa%d\n",
+                 idx);
+  }
 
  done:
   return vrs;
@@ -1832,6 +1839,13 @@ gen_routerstatus_for_umbw(int idx, time_t now)
       /* Shouldn't happen */
       test_assert(0);
   }
+  if (vrs) {
+    vrs->microdesc = tor_malloc_zero(sizeof(vote_microdesc_hash_t));
+    tor_asprintf(&vrs->microdesc->microdesc_hash_line,
+                 "m 9,10,11,12,13,14,15,16,17 "
+                 "sha256=xyzajkldsdsajdadlsdjaslsdksdjlsdjsdaskdaaa%d\n",
+                 idx);
+  }
 
  done:
   return vrs;