mirror of
https://github.com/torproject/collector.git
synced 2024-11-27 03:10:28 +00:00
Add tests for transport and transport-info lines.
This commit is contained in:
parent
61bd56b61c
commit
bcaed1a443
@ -496,6 +496,26 @@ public class SanitizedBridgesWriterTest {
|
||||
+ "line.", this.parsedExtraInfoDescriptors.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtraInfoDescriptorTransportSpace() throws Exception {
|
||||
this.defaultExtraInfoDescriptorBuilder.replaceLineStartingWith(
|
||||
"transport ", Arrays.asList("transport "));
|
||||
this.runTest();
|
||||
assertTrue("Sanitized extra-info descriptor with invalid transport "
|
||||
+ "line.", this.parsedExtraInfoDescriptors.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtraInfoDescriptorTransportInfoRemoved() throws Exception {
|
||||
this.defaultExtraInfoDescriptorBuilder.insertBeforeLineStartingWith(
|
||||
"bridge-stats-end ", Arrays.asList("transport-info secretkey"));
|
||||
this.runTest();
|
||||
for (String line : this.parsedExtraInfoDescriptors.get(0)) {
|
||||
assertFalse("transport-info line should not have been retained.",
|
||||
line.startsWith("transport-info "));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExtraInfoDescriptorRouterSignatureLineSpace()
|
||||
throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user