From 5d2407df1b40c858be3958b4670e0f610a1dee29 Mon Sep 17 00:00:00 2001 From: Diego Pino Garcia Date: Fri, 20 Nov 2015 01:01:15 +0100 Subject: [PATCH] Add test IPv4 matches but port doesn't --- .../snabb_lwaftr/tests/data/add-vlan.sh | 4 ++++ ...ost-unreachable-ip-bound-port-unbound.pcap | Bin 0 -> 134 bytes .../icmpv6-nogress-ip-bound-port-unbound.pcap | Bin 0 -> 194 bytes .../tcp-fromb4-ipv6-bound-port-unbound.pcap | Bin 0 -> 146 bytes .../tcp-frominet-ip-bound-port-unbound.pcap | Bin 0 -> 106 bytes ...ost-unreachable-ip-bound-port-unbound.pcap | Bin 0 -> 138 bytes .../icmpv6-nogress-ip-bound-port-unbound.pcap | Bin 0 -> 198 bytes .../tcp-fromb4-ipv6-bound-port-unbound.pcap | Bin 0 -> 150 bytes .../tcp-frominet-ip-bound-port-unbound.pcap | Bin 0 -> 110 bytes .../tests/end-to-end/end-to-end-vlan.sh | 20 ++++++++++++++++++ .../tests/end-to-end/end-to-end.sh | 20 ++++++++++++++++++ 11 files changed, 44 insertions(+) create mode 100644 src/program/snabb_lwaftr/tests/data/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap create mode 100644 src/program/snabb_lwaftr/tests/data/icmpv6-nogress-ip-bound-port-unbound.pcap create mode 100644 src/program/snabb_lwaftr/tests/data/tcp-fromb4-ipv6-bound-port-unbound.pcap create mode 100644 src/program/snabb_lwaftr/tests/data/tcp-frominet-ip-bound-port-unbound.pcap create mode 100644 src/program/snabb_lwaftr/tests/data/vlan/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap create mode 100644 src/program/snabb_lwaftr/tests/data/vlan/icmpv6-nogress-ip-bound-port-unbound.pcap create mode 100644 src/program/snabb_lwaftr/tests/data/vlan/tcp-fromb4-ipv6-bound-port-unbound.pcap create mode 100644 src/program/snabb_lwaftr/tests/data/vlan/tcp-frominet-ip-bound-port-unbound.pcap diff --git a/src/program/snabb_lwaftr/tests/data/add-vlan.sh b/src/program/snabb_lwaftr/tests/data/add-vlan.sh index 2480e91312..74b027d15d 100755 --- a/src/program/snabb_lwaftr/tests/data/add-vlan.sh +++ b/src/program/snabb_lwaftr/tests/data/add-vlan.sh @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/src/program/snabb_lwaftr/tests/data/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap b/src/program/snabb_lwaftr/tests/data/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap new file mode 100644 index 0000000000000000000000000000000000000000..84ab9356c8463ac2d686c1c2d2772e25d815de1c GIT binary patch literal 134 zcmca|c+)~A1{MYw`2U}Qff2?5(s59n0R}=~z`@|kzz_gZ^q;Y`mkS7{uA39f%vg~H z5(CPa2$nlASh8*90Eut%pZ4d>kOmz2Tgm{AiyAhDg!Ey%%3%0EsoBXG}oVspK m>@P-!0EKmiQTv0YJ!=qPkUz`@bRi=L*Aj1)AcGKtFoOt#D1#WI z1_K8JCj%D)Hv1>07RP5#qfPF*)A_7@{VfWkV%sQp3Ho;3(C V$RB0{+Q`VkwZvN``N!U$ivb+79>4$q literal 0 HcmV?d00001 diff --git a/src/program/snabb_lwaftr/tests/data/tcp-frominet-ip-bound-port-unbound.pcap b/src/program/snabb_lwaftr/tests/data/tcp-frominet-ip-bound-port-unbound.pcap new file mode 100644 index 0000000000000000000000000000000000000000..7b63c43cc61737009c0fa1432594746a35fd654d GIT binary patch literal 106 zcmca|c+)~A1{MYw`2U}Qff2|_i2NVix{-;&3CITFe}6amPkY%?v4*$bk%PgNfx$$u y+=0Q8Z7avrb#r1ta+f#!VpLdX7_~oW+Oq}$2KiGVK$93bxR!XUB>&j^b1?v|mLtRf literal 0 HcmV?d00001 diff --git a/src/program/snabb_lwaftr/tests/data/vlan/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap b/src/program/snabb_lwaftr/tests/data/vlan/icmpv4-dst-host-unreachable-ip-bound-port-unbound.pcap new file mode 100644 index 0000000000000000000000000000000000000000..141caa1d3d4cad6838ab6ec256bff4c5490b8883 GIT binary patch literal 138 zcmca|c+)~A1{MYw`2U}Qff2?5(n(O90R}=~(8$2z!olFmzz_gZ_@A+~mkS7{uA39f z%vg~H5(CPa2$nlASh8*90Eut%pZ4d>kOmz2Tgm{AiyAhDg!Ey%%3%0EsoBXG} qoVspK>@P-!0EKmiQTv0YJ!=qPkUz`@bR{DP*Aj1)AcGKtFoOt# zD1#WI1_K8JCj%D)Hv1>07RP5#qfPF*)A_7@{VfWkV%sQp3H Zo;3(C$RB0{+RDhmwZvN``N!U$ivf)hACUk6 literal 0 HcmV?d00001 diff --git a/src/program/snabb_lwaftr/tests/data/vlan/tcp-frominet-ip-bound-port-unbound.pcap b/src/program/snabb_lwaftr/tests/data/vlan/tcp-frominet-ip-bound-port-unbound.pcap new file mode 100644 index 0000000000000000000000000000000000000000..ce77c82a309911e364a554a8f50d41b67a1f40b9 GIT binary patch literal 110 zcmca|c+)~A1{MYw`2U}Qff2|_i2NVix{-;&4af%Je}6amPkY%?v4*$bv5|qrg@eJB zfx$$u+=0Q8Z7avrb#r1t@|QRKVpLdX7_~oW+Oq}$2KiGVK+_mGxR!XUB>&j^b1?uL Cmn4+{ literal 0 HcmV?d00001 diff --git a/src/program/snabb_lwaftr/tests/end-to-end/end-to-end-vlan.sh b/src/program/snabb_lwaftr/tests/end-to-end/end-to-end-vlan.sh index ab3ff93912..344d681f09 100755 --- a/src/program/snabb_lwaftr/tests/end-to-end/end-to-end-vlan.sh +++ b/src/program/snabb_lwaftr/tests/end-to-end/end-to-end-vlan.sh @@ -95,11 +95,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} \ @@ -115,11 +125,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 diff --git a/src/program/snabb_lwaftr/tests/end-to-end/end-to-end.sh b/src/program/snabb_lwaftr/tests/end-to-end/end-to-end.sh index 18eaa7d267..d8e3f6d068 100755 --- a/src/program/snabb_lwaftr/tests/end-to-end/end-to-end.sh +++ b/src/program/snabb_lwaftr/tests/end-to-end/end-to-end.sh @@ -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} \ @@ -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