commit a5eea79f941752aeab342b565615d58dbb0b225d Author: Karsten Loesing karsten.loesing@gmx.net 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@lists.torproject.org