[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [collector/master] Add test for retaining hidserv-* lines.
commit a5eea79f941752aeab342b565615d58dbb0b225d
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Thu Nov 24 11:19:35 2016 +0100
Add test for retaining hidserv-* lines.
This test currently breaks and will be fixed in #20714.
---
.../bridgedescs/SanitizedBridgesWriterTest.java | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java b/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java
index 10f0449..847d89b 100644
--- a/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java
+++ b/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java
@@ -515,6 +515,27 @@ public class SanitizedBridgesWriterTest {
}
@Test
+ public void testExtraInfoDescriptorHidservRetained() throws Exception {
+ this.defaultExtraInfoDescriptorBuilder.insertBeforeLineStartingWith(
+ "transport ",
+ Arrays.asList("hidserv-stats-end 2016-11-23 14:48:05 (86400 s)",
+ "hidserv-rend-relayed-cells 27653088 delta_f=2048 epsilon=0.30 "
+ + "bin_size=1024",
+ "hidserv-dir-onions-seen 204 delta_f=8 epsilon=0.30 bin_size=8"));
+ this.runTest();
+ int foundHidservLines = 0;
+ if (!this.parsedExtraInfoDescriptors.isEmpty()) {
+ for (String line : this.parsedExtraInfoDescriptors.get(0)) {
+ if (line.startsWith("hidserv-")) {
+ foundHidservLines++;
+ }
+ }
+ }
+ assertEquals("3 hidserv-* lines should have been retained.", 3,
+ foundHidservLines);
+ }
+
+ @Test
public void testExtraInfoDescriptorRouterSignatureLineSpace()
throws Exception {
this.defaultExtraInfoDescriptorBuilder.replaceLineStartingWith(
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits