Abort on error detection

This commit is contained in:
Nico Schottelius 2019-06-03 21:39:03 +02:00
parent 0f2e7f6049
commit 8def761c32
2 changed files with 22 additions and 3 deletions

View File

@ -12,7 +12,15 @@ read something
cd $P4_PROJECT_DIR && make
# Step 5
cd $P4_PROJECT_DIR/nf_sume_sdnet_ip/SimpleSumeSwitch && ./vivado_sim.bash
cd $P4_PROJECT_DIR/nf_sume_sdnet_ip/SimpleSumeSwitch && ./vivado_sim.bash >& LOG 2>&1
expected_line=$(grep ^expected LOG | sed 's/.*(//')
actual_line=$(grep ^actual LOG | sed 's/.*(//')
if [ "$expected_line" != "$actual_line" ]; then
echo packet mismatch
exit 1
fi
# Step 6
cd $P4_PROJECT_DIR && make config_writes

View File

@ -100,9 +100,18 @@ lookup_table = {
3: 0x00001000
}
def test_port1():
pktCnt = 0
# First ethernet
pktCnt += 1
pkt = Ether(dst=MAC2, src=MAC1)
pkt = pad_pkt(pkt, 64)
applyPkt(pkt, 'nf0', pktCnt)
expPkt(pkt, 'nf0')
# Test that packets are being mirrored
def test_mirror():
pktCnt = 0
# First ethernet
@ -136,5 +145,7 @@ def test_mirror():
# pkt = pad_pkt(pkt, 64)
# expPkt(pkt, 'nf0')
test_mirror()
#test_mirror()
test_port1()
write_pcap_files()