Expand UTScapy dissection corpus field coverage for tshark vs Scapy on existing pcaps (including enum-string validation)#40
Conversation
|
@copilot add a few example tests using existing pcap files |
|
@copilot compare as much fields as possible |
Implemented in commit c93fa4a. I expanded each corpus entry to compare many more fields: broad IP coverage ( |
|
@copilot If fields contain enums as strings, validate those as well. Maybe allow a list of compare functions in the map. |
Implemented in commit 472d912. I added enum-string validation support and updated the mapping model to accept a list of compare functions per field (OR semantics), then applied this to enum-prone fields like |
|
@copilot move all helper functions in a python file inside test. Apply proper typing and flake8. |
Done in commit c8d5b09. I moved the dissection corpus helper logic into |
|
@copilot fix the AI trailer reminder check |
|
@copilot one unit test failed the dissection test. Analyse the issue |
I analyzed the failing run: the dissection corpus test mismatched on |
This PR introduces a reusable dissection-verification corpus for UTScapy that compares tshark field output against Scapy dissection on real pcaps. It establishes a mapping-driven framework so new protocol checks can be added by data, not custom test logic.
What was added
test/scapy/layers/dissection_corpus.uts-T fields)tshark_field -> scapy layer.field)Mapping/comparison model
tcp.flags.Corpus entries (using existing Scapy pcaps)
test/pcaps/http_content_length.pcaptest/pcaps/netflowv9.pcaptest/pcaps/http_compressed.pcaptest/pcaps/ssh_ed25519.pcaptest/pcaps/ipfix.pcapField coverage expanded to compare many more protocol fields
ip.src,ip.dst,ip.version,ip.dsfield,ip.len,ip.id,ip.flags,ip.frag_offset,ip.ttl,ip.proto,ip.checksumtcp.srcport,tcp.dstport,tcp.seq,tcp.ack,tcp.window_size_value,tcp.checksum,tcp.urgent_pointer,tcp.flagsudp.srcport,udp.dstport,udp.length,udp.checksumHardening in helper logic
Layer.fieldshape checks).