X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Ftemplate_ipsec.py;h=725cec58846f60a5a53cc52169bd2ffb339b4dec;hb=855ad3373ee9257ce7c917b90c638bd2f8a76da4;hp=bbfe776f5c2c349b3762544d01fa2ab2783544d1;hpb=a1175b726d428ab6e67e2fe35514099bffa43bc2;p=vpp.git diff --git a/test/template_ipsec.py b/test/template_ipsec.py index bbfe776f5c2..725cec58846 100644 --- a/test/template_ipsec.py +++ b/test/template_ipsec.py @@ -1293,10 +1293,13 @@ class IpsecTun4(object): self.verify_counters4(p, count) def verify_keepalive(self, p): + # the sizeof Raw is calculated to pad to the minimum ehternet + # frame size of 64 btyes pkt = (Ether(src=self.tun_if.remote_mac, dst=self.tun_if.local_mac) / IP(src=p.remote_tun_if_host, dst=self.tun_if.local_ip4) / UDP(sport=333, dport=4500) / - Raw(b'\xff')) + Raw(b'\xff') / + Padding(0 * 21)) self.send_and_assert_no_replies(self.tun_if, pkt*31) self.assert_error_counter_equal( '/err/%s/NAT Keepalive' % self.tun4_input_node, 31) @@ -1309,6 +1312,15 @@ class IpsecTun4(object): self.assert_error_counter_equal( '/err/%s/Too Short' % self.tun4_input_node, 31) + pkt = (Ether(src=self.tun_if.remote_mac, dst=self.tun_if.local_mac) / + IP(src=p.remote_tun_if_host, dst=self.tun_if.local_ip4) / + UDP(sport=333, dport=4500) / + Raw(b'\xfe') / + Padding(0 * 21)) + self.send_and_assert_no_replies(self.tun_if, pkt*31) + self.assert_error_counter_equal( + '/err/%s/Too Short' % self.tun4_input_node, 62) + class IpsecTun4Tests(IpsecTun4): """ UT test methods for Tunnel v4 """