Commit 3feeae10 authored by Iain Learmonth's avatar Iain Learmonth
Browse files

Adds simple test for OnionPerf schema v3.1

This test only ensures that the new fields do
not cause the parser to crash, it does not look
at actually parsing those fields.

Fixes: #40003
parent c4453432
Pipeline #5115 passed with stage
in 3 minutes and 8 seconds
......@@ -180,5 +180,24 @@ public class OnionPerfAnalysisConverterTest {
public void testDoesNotCrashVersion31() throws IOException,
DescriptorParseException {
URL resouce = getClass().getClassLoader().getResource(
InputStream compressedInputStream = resouce.openStream();
byte[] rawDescriptorBytes = IOUtils.toByteArray(compressedInputStream);
OnionPerfAnalysisConverter onionPerfAnalysisConverter
= new OnionPerfAnalysisConverter(rawDescriptorBytes, null);
for (Descriptor descriptor
: onionPerfAnalysisConverter.asTorperfResults()) {
assertTrue(descriptor instanceof TorperfResult);
String formattedTorperfResult
= new String(descriptor.getRawDescriptorBytes()).trim();
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment