Add tests for transport and transport-info lines.

This commit is contained in:
Karsten Loesing 2016-09-28 21:15:15 +02:00
parent 61bd56b61c
commit bcaed1a443

View File

@ -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 {