Commit Graph

5 Commits

Author SHA1 Message Date
Vincent Bernat
51cae28c23 common/helpers: make readPcap a test helper 2024-07-21 16:22:18 +02:00
Vincent Bernat
8ecc6b9570 inlet: add some test coverage around MPLS parsing 2023-11-25 20:34:45 +01:00
Vincent Bernat
8f83f9bc97 inlet/flow: add tests for ICMP and Netflow 2023-06-04 10:53:27 +02:00
Vincent Bernat
14c4391620 inlet/flow: add a benchmark for flow decoding/encoding
This will serve as a base for converting this to a one-step conversion
to Protobuf. The main goal is not to be faster, but we don't want to be
slower and faster would be a nice bonus.

```
goos: linux
goarch: amd64
pkg: akvorado/inlet/flow
cpu: AMD Ryzen 5 5600X 6-Core Processor
BenchmarkDecodeEncodeNetflow
BenchmarkDecodeEncodeNetflow-12            39586             29199 ns/op
BenchmarkDecodeEncodeSflow
BenchmarkDecodeEncodeSflow-12              24349             48914 ns/op
ok      akvorado/inlet/flow     3.167s

DONE 0 tests in 3.636s
```
2023-01-07 13:30:12 +01:00
Vincent Bernat
f8a795282e inlet/flow: replace raw data test files with PCAP files
Raw data files can be converted with Scapy:

```python
from scapy.all import *
wrpcap("data-1140.pcap",
  Ether(src="00:53:00:11:22:33",dst="00:53:00:44:55:66")/
  IP(src="192.0.2.100", dst="192.0.2.101")/
  UDP(sport=47873,dport=6343)/
  open("data-1140.data", "rb").read())
```
2022-09-09 13:55:09 +02:00