[tor-commits] [collector/master] Add test for new "proto" line.

karsten at torproject.org karsten at torproject.org
Fri Sep 30 13:48:49 UTC 2016


commit 21fdc146947e85638fe98152a4aab64f64dd32e1
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Wed Sep 28 20:09:36 2016 +0200

    Add test for new "proto" line.
---
 .../collector/bridgedescs/SanitizedBridgesWriterTest.java      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java b/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java
index c158d1a..4191904 100644
--- a/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java
+++ b/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java
@@ -262,6 +262,16 @@ public class SanitizedBridgesWriterTest {
   }
 
   @Test
+  public void testServerDescriptorProtoLine() throws Exception {
+    this.defaultServerDescriptorBuilder.replaceLineStartingWith("protocols ",
+        Arrays.asList("proto Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 "
+        + "HSRend=1-2 Link=1-4 LinkAuth=1 Microdesc=1-2 Relay=1-2"));
+    this.runTest();
+    assertFalse("Sanitized server descriptor with valid proto line.",
+        this.parsedServerDescriptors.isEmpty());
+  }
+
+  @Test
   public void testServerDescriptorFingerprintTruncated() throws Exception {
     this.defaultServerDescriptorBuilder.replaceLineStartingWith(
         "fingerprint ", Arrays.asList("fingerprint 4"));





More information about the tor-commits mailing list