Commit graph

4 commits

Author SHA1 Message Date
Dominik Pataky 258b7c1e0b Tests: move packets into lib again, add packet generator
The static packets in the tests are back in lib.py to avoid circular
imports. A new packet generator function was added.
2020-04-03 15:20:41 +02:00
Dominik Pataky 55272e8a0a Fix analyzer test; IPFIX: change handling of 16 bytes fields
Analyzer test was missing imports.

IPFIX templates with 16 bytes fields were processed extra, since struct
does not natively support conversion to int. The new implementation
still handles it extra, but uses struct's "s" unpack format descriptor
now.
2020-04-03 10:29:38 +02:00
Dominik Pataky 547792c5c2 Tests: move packets into each version test file; add tests for IPFIX
The previously introduced tests/lib.py contained the NetFlow v9 packets
and then the IPFIX packets, those were split and put into their
respective test files again. The lib now contains shared objects only.

For IPFIX tests were added. Two new packets were added, one with
templates and one without (again, real exports from softflowd).
Different cases are checked: no template, template and later template.
Fields of flows are also checked, especially IPv6 addresses.

Note: exports made with softflowd were created by softflowd 1.0.0,
compiled from https://github.com/irino/softflowd
2020-04-01 14:15:53 +02:00
Dominik Pataky 56d443aa2a Refactor tests, moved into tests/
The tests are now located in tests/. They are also split into multiple
files, beginning with test_netflow and test_analyzer. The tests for
IPFIX will be added to test_ipfix.
2020-04-01 11:55:45 +02:00