++log ++change gen_testdata.py

This commit is contained in:
Nico Schottelius 2019-07-13 19:10:05 +02:00
commit c243778bc3
2 changed files with 69 additions and 4 deletions

View file

@ -103,20 +103,35 @@ lookup_table = {
def test_port1():
""" packets for a certain mac always go to nf0 """
pktCnt = 0
# First ethernet
pktCnt += 1
pkt = Ether(dst=MAC2, src=MAC1)
pkt = pad_pkt(pkt, 64)
# Send on nf0
pktCnt += 1
applyPkt(pkt, 'nf0', pktCnt)
pktCnt += 1
# Receive on nf0
expPkt(pkt, 'nf0')
# Send on nf1
pktCnt += 1
applyPkt(pkt, 'nf1', pktCnt)
# Receive on nf0
expPkt(pkt, 'nf0')
# Send on nf2
pktCnt += 1
applyPkt(pkt, 'nf2', pktCnt)
# Receive on nf0
expPkt(pkt, 'nf0')
# Send on nf3
pktCnt += 1
applyPkt(pkt, 'nf2', pktCnt)
# Receive on nf0
expPkt(pkt, 'nf0')
# Test that packets are being mirrored