commit 9f15d44712a1cba3d449e2c18aa4b73197c4f813 Author: Karsten Loesing <karsten.loes...@gmx.net> Date: Wed Sep 28 15:47:54 2016 +0200
Add tests for Tonga/Bifroest migration. --- .../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 7cd6e6e..3533faf 100644 --- a/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java +++ b/src/test/java/org/torproject/collector/bridgedescs/SanitizedBridgesWriterTest.java @@ -468,6 +468,27 @@ public class SanitizedBridgesWriterTest { } @Test + public void testNetworkStatusFromBifroest() throws Exception { + this.defaultTarballBuilder.setTarballFileName( + this.defaultTarballBuilder.getTarballFileName() + .replaceAll("tonga", "bifroest")); + this.runTest(); + assertTrue("Sanitized status should contain Bifroest's fingerprint.", + this.parsedFiles.containsKey("2016/06/statuses/30/" + + "20160630-234028-1D8F3A91C37C5D1C4C19B1AD1D0CFBE8BF72D8E1")); + } + + @Test + public void testNetworkStatusFromTrifroest() throws Exception { + this.defaultTarballBuilder.setTarballFileName( + this.defaultTarballBuilder.getTarballFileName() + .replaceAll("tonga", "trifroest")); + this.runTest(); + assertTrue("Should not have recognized unknown bridge authority Trifroest.", + this.parsedNetworkStatuses.isEmpty()); + } + + @Test public void testTarballContainsSameFileTwice() throws Exception { this.defaultTarballBuilder.add("cached-extrainfo.new", 1467331623000L, Arrays.asList(new DescriptorBuilder[] { _______________________________________________ tor-commits mailing list tor-commits@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits