Abort on error detection
This commit is contained in:
parent
0f2e7f6049
commit
8def761c32
|
@ -12,7 +12,15 @@ read something
|
||||||
cd $P4_PROJECT_DIR && make
|
cd $P4_PROJECT_DIR && make
|
||||||
|
|
||||||
# Step 5
|
# 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
|
# Step 6
|
||||||
cd $P4_PROJECT_DIR && make config_writes
|
cd $P4_PROJECT_DIR && make config_writes
|
||||||
|
|
|
@ -100,9 +100,18 @@ lookup_table = {
|
||||||
3: 0x00001000
|
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
|
# Test that packets are being mirrored
|
||||||
def test_mirror():
|
def test_mirror():
|
||||||
|
|
||||||
pktCnt = 0
|
pktCnt = 0
|
||||||
|
|
||||||
# First ethernet
|
# First ethernet
|
||||||
|
@ -136,5 +145,7 @@ def test_mirror():
|
||||||
# pkt = pad_pkt(pkt, 64)
|
# pkt = pad_pkt(pkt, 64)
|
||||||
# expPkt(pkt, 'nf0')
|
# expPkt(pkt, 'nf0')
|
||||||
|
|
||||||
test_mirror()
|
#test_mirror()
|
||||||
|
test_port1()
|
||||||
|
|
||||||
write_pcap_files()
|
write_pcap_files()
|
||||||
|
|
Loading…
Reference in New Issue