Skip to content

Commit

Permalink
Merge pull request snabbco#125 from dpino/add-test-no-matching-port
Browse files Browse the repository at this point in the history
Add test IPv4 matches but port doesn't
  • Loading branch information
wingo committed Nov 20, 2015
2 parents 672424a + 5d2407d commit bed891c
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/program/snabb_lwaftr/tests/data/add-vlan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
V4=(
decap-ipv4-nohair.pcap
decap-ipv4.pcap
icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap
icmpv4-dst-host-unreachable.pcap
icmpv4-fromlwaftr-replyto-tcp-frominet-bound1494-DF.pcap
icmpv4-time-expired.pcap
Expand All @@ -23,6 +24,7 @@ V4=(
tcp-frominet-bound.pcap
tcp-frominet-bound1494-DF.pcap
tcp-frominet-bound1494.pcap
tcp-frominet-ip-bound-port-unbound.pcap
tcp-frominet-trafficclass.pcap
tcp-frominet-unbound.pcap
tcp-ipv4-2ipv6frags-reassembled.pcap
Expand All @@ -31,6 +33,7 @@ V4=(
)

V6=(
icmpv6-nogress-ip-bound-port-unbound.pcap
icmpv6-nogress.pcap
incoming-icmpv6-13dstaddressunreach-inet-OPE.pcap
incoming-icmpv6-20pkttoobig-inet-OPE.pcap
Expand All @@ -52,6 +55,7 @@ V6=(
tcp-afteraftr-ipv6.pcap
tcp-fromb4-customBRIP-tob4-ipv6.pcap
tcp-fromb4-customBRIP1-tob4-customBRIP2-ipv6.pcap
tcp-fromb4-ipv6-bound-port-unbound.pcap
tcp-fromb4-ipv6-unbound.pcap
tcp-fromb4-ipv6.pcap
tcp-fromb4-tob4-customBRIP-ipv6.pcap
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
20 changes: 20 additions & 0 deletions src/program/snabb_lwaftr/tests/end-to-end/end-to-end-vlan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,21 @@ snabb_run_and_cmp ${TEST_CONF}/no_icmp_vlan.conf \
${TEST_DATA}/tcp-frominet-unbound.pcap ${EMPTY} \
${EMPTY} ${EMPTY}

echo "Testing: from-internet IPv4 packet NOT found in the binding table (matches IPv4, but not port), no ICMP."
snabb_run_and_cmp ${TEST_CONF}/no_icmp_vlan.conf \
${TEST_DATA}/tcp-frominet-ip-bound-port-unbound.pcap ${EMPTY} \
${EMPTY} ${EMPTY}

echo "Testing: from-internet IPv4 packet NOT found in the binding table (ICMP-on-fail)."
snabb_run_and_cmp ${TEST_CONF}/icmp_on_fail_vlan.conf \
${TEST_DATA}/tcp-frominet-unbound.pcap ${EMPTY} \
${TEST_DATA}/icmpv4-dst-host-unreachable.pcap ${EMPTY}

echo "Testing: from-internet IPv4 packet NOT found in the binding table (matches IPv4, but not port) (ICMP-on-fail)."
snabb_run_and_cmp ${TEST_CONF}/icmp_on_fail_vlan.conf \
${TEST_DATA}/tcp-frominet-ip-bound-port-unbound.pcap ${EMPTY} \
${TEST_DATA}/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap ${EMPTY}

echo "Testing: from-to-b4 IPv6 packet NOT found in the binding table, no ICMP."
snabb_run_and_cmp ${TEST_CONF}/no_icmp_vlan.conf \
${TEST_DATA}/tcp-afteraftr-ipv6.pcap ${EMPTY} \
Expand All @@ -112,11 +122,21 @@ snabb_run_and_cmp ${TEST_CONF}/no_icmp_vlan.conf \
${EMPTY} ${TEST_DATA}/tcp-fromb4-ipv6-unbound.pcap \
${EMPTY} ${EMPTY}

echo "Testing: from-b4 to-internet IPv6 packet NOT found in the binding table (matches IPv4, but not port), no ICMP"
snabb_run_and_cmp ${TEST_CONF}/no_icmp_vlan.conf \
${EMPTY} ${TEST_DATA}/tcp-fromb4-ipv6-bound-port-unbound.pcap \
${EMPTY} ${EMPTY}

echo "Testing: from-b4 to-internet IPv6 packet NOT found in the binding table (ICMP-on-fail)"
snabb_run_and_cmp ${TEST_CONF}/icmp_on_fail_vlan.conf \
${EMPTY} ${TEST_DATA}/tcp-fromb4-ipv6-unbound.pcap \
${EMPTY} ${TEST_DATA}/icmpv6-nogress.pcap

echo "Testing: from-b4 to-internet IPv6 packet NOT found in the binding table (matches IPv4, but not port) (ICMP-on-fail)"
snabb_run_and_cmp ${TEST_CONF}/icmp_on_fail_vlan.conf \
${EMPTY} ${TEST_DATA}/tcp-fromb4-ipv6-bound-port-unbound.pcap \
${EMPTY} ${TEST_DATA}/icmpv6-nogress-ip-bound-port-unbound.pcap

echo "Testing: from-to-b4 IPv6 packet, no hairpinning"
# The idea is that with hairpinning off, the packet goes out the inet interface
# and something else routes it back for re-encapsulation. It's not clear why
Expand Down
20 changes: 20 additions & 0 deletions src/program/snabb_lwaftr/tests/end-to-end/end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,21 @@ snabb_run_and_cmp ${TEST_BASE}/no_icmp.conf \
${TEST_BASE}/tcp-frominet-unbound.pcap ${EMPTY} \
${EMPTY} ${EMPTY}

echo "Testing: from-internet IPv4 packet NOT found in the binding table (IPv4 matches, but port doesn't), no ICMP."
snabb_run_and_cmp ${TEST_BASE}/no_icmp.conf \
${TEST_BASE}/tcp-frominet-ip-bound-port-unbound.pcap ${EMPTY} \
${EMPTY} ${EMPTY}

echo "Testing: from-internet IPv4 packet NOT found in the binding table (ICMP-on-fail)."
snabb_run_and_cmp ${TEST_BASE}/icmp_on_fail.conf \
${TEST_BASE}/tcp-frominet-unbound.pcap ${EMPTY} \
${TEST_BASE}/icmpv4-dst-host-unreachable.pcap ${EMPTY}

echo "Testing: from-internet IPv4 packet NOT found in the binding table (IPv4 matches, but port doesn't) (ICMP-on-fail)."
snabb_run_and_cmp ${TEST_BASE}/icmp_on_fail.conf \
${TEST_BASE}/tcp-frominet-ip-bound-port-unbound.pcap ${EMPTY} \
${TEST_BASE}/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap ${EMPTY}

echo "Testing: from-to-b4 IPv6 packet NOT found in the binding table, no ICMP."
snabb_run_and_cmp ${TEST_BASE}/no_icmp.conf \
${TEST_BASE}/tcp-afteraftr-ipv6.pcap ${EMPTY} \
Expand All @@ -125,11 +135,21 @@ snabb_run_and_cmp ${TEST_BASE}/no_icmp.conf \
${EMPTY} ${TEST_BASE}/tcp-fromb4-ipv6-unbound.pcap \
${EMPTY} ${EMPTY}

echo "Testing: from-b4 to-internet IPv6 packet NOT found in the binding table, (IPv4 matches, but port doesn't), no ICMP"
snabb_run_and_cmp ${TEST_BASE}/no_icmp.conf \
${EMPTY} ${TEST_BASE}/tcp-fromb4-ipv6-bound-port-unbound.pcap \
${EMPTY} ${EMPTY}

echo "Testing: from-b4 to-internet IPv6 packet NOT found in the binding table (ICMP-on-fail)"
snabb_run_and_cmp ${TEST_BASE}/icmp_on_fail.conf \
${EMPTY} ${TEST_BASE}/tcp-fromb4-ipv6-unbound.pcap \
${EMPTY} ${TEST_BASE}/icmpv6-nogress.pcap

echo "Testing: from-b4 to-internet IPv6 packet NOT found in the binding table (IPv4 matches, but port doesn't) (ICMP-on-fail)"
snabb_run_and_cmp ${TEST_BASE}/icmp_on_fail.conf \
${EMPTY} ${TEST_BASE}/tcp-fromb4-ipv6-bound-port-unbound.pcap \
${EMPTY} ${TEST_BASE}/icmpv6-nogress-ip-bound-port-unbound.pcap

echo "Testing: from-to-b4 IPv6 packet, no hairpinning"
# The idea is that with hairpinning off, the packet goes out the inet interface
# and something else routes it back for re-encapsulation. It's not clear why
Expand Down

0 comments on commit bed891c

Please sign in to comment.