[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/master] Add a test for the encoding of microdescriptor digests in votes



commit 47a69b342faae83fcd70909c3f03129f7b133364
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Sat Jun 17 21:18:11 2017 +0200

    Add a test for the encoding of microdescriptor digests in votes
---
 .../descriptor/impl/RelayNetworkStatusVoteImplTest.java           | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java b/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java
index 1152626..8a85145 100644
--- a/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java
+++ b/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImplTest.java
@@ -9,6 +9,7 @@ import static org.junit.Assert.assertTrue;
 
 import org.torproject.descriptor.DescriptorParseException;
 import org.torproject.descriptor.DirectorySignature;
+import org.torproject.descriptor.NetworkStatusEntry;
 import org.torproject.descriptor.RelayNetworkStatusVote;
 
 import org.junit.Rule;
@@ -717,9 +718,12 @@ public class RelayNetworkStatusVoteImplTest {
     assertTrue(vote.getKnownFlags().contains("Running"));
     assertEquals(30000, (int) vote.getConsensusParams().get(
         "CircuitPriorityHalflifeMsec"));
+    NetworkStatusEntry nse = vote.getStatusEntry(
+        "00343A8024F70E214728F0C5AF7ACE0C1508F073");
     assertEquals("Tor 0.2.1.29 (r8e9b25e6c7a2e70c)",
-        vote.getStatusEntry("00343A8024F70E214728F0C5AF7ACE0C1508F073")
-        .getVersion());
+        nse.getVersion());
+    assertTrue(nse.getMicrodescriptorDigestsSha256Base64().contains(
+        "9ciEx9t0McXk9A06I7qwN7pxuNOdpCP64RV/6cx2Zkc"));
     assertEquals(3, vote.getDirKeyCertificateVersion());
     assertEquals("80550987E1D626E3EBA5E5E75A458DE0626D088C",
         vote.getIdentity());



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits