Skip to content

Commit

Permalink
Adds basic chain tests for packets which are not udp or tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
ana-cc authored and irl committed Jan 17, 2018
1 parent 9ca1b55 commit 1997988
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Binary file added pathspider/tests/data/basic_ipv4_non_udp_tcp.pcap
Binary file not shown.
23 changes: 23 additions & 0 deletions pathspider/tests/test_chain_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,26 @@ def test_chain_basic_ipv6_udp(self):

for key in expected_basic:
assert flows[0][key] == expected_basic[key]

def test_chain_basic_ipv4_non_udp_tcp(self):
test_trace = "basic_ipv4_non_udp_tcp.pcap"
self.create_observer(test_trace, [BasicChain])

expected_basic = {
'oct_fwd': 506,
'dp': None,
'pkt_rev': 0,
'pkt_fwd': 11,
'proto': 112,
'oct_rev': 0,
'sip': '192.168.0.10',
'sp': None,
'dip': '224.0.0.18'
}

flows = self.run_observer()
print(flows)
assert len(flows) == 1

for key in expected_basic:
assert flows[0][key] == expected_basic[key]

0 comments on commit 1997988

Please sign in to comment.