summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNeale Ranns <neale@graphiant.com>2022-11-18 04:24:09 +0000
committerNeale Ranns <neale@graphiant.com>2022-11-21 01:02:29 +0000
commit267175fd0416acb5355332693f5769fb0d2d65ee (patch)
tree2fbfd80dfa42f0e06a1114df3d6b765776f3098c /test
parent07e0c05e698cf5ffd1e2d2de0296d1907519dc3d (diff)
ipsec: Failure at the start of the batch should not invalidate the rest of the batch
Type: fix Signed-off-by: Neale Ranns <neale@graphiant.com> Change-Id: Icd1e43a5764496784c355c93066273435f16dd35 (cherry picked from commit fe2d23f916d1991f4a1a8384eae41b5cceb80189)
Diffstat (limited to 'test')
-rw-r--r--test/template_ipsec.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/template_ipsec.py b/test/template_ipsec.py
index def31cbebbd..9d9ea3a86d3 100644
--- a/test/template_ipsec.py
+++ b/test/template_ipsec.py
@@ -432,6 +432,34 @@ class IpsecTra4(object):
]
recv_pkts = self.send_and_expect(self.tra_if, pkts, self.tra_if)
+ # a replayed packet, then an out of window, then a legit
+ # tests that a early failure on the batch doesn't affect subsequent packets.
+ pkts = [
+ (
+ Ether(src=self.tra_if.remote_mac, dst=self.tra_if.local_mac)
+ / p.scapy_tra_sa.encrypt(
+ IP(src=self.tra_if.remote_ip4, dst=self.tra_if.local_ip4) / ICMP(),
+ seq_num=203,
+ )
+ ),
+ (
+ Ether(src=self.tra_if.remote_mac, dst=self.tra_if.local_mac)
+ / p.scapy_tra_sa.encrypt(
+ IP(src=self.tra_if.remote_ip4, dst=self.tra_if.local_ip4) / ICMP(),
+ seq_num=81,
+ )
+ ),
+ (
+ Ether(src=self.tra_if.remote_mac, dst=self.tra_if.local_mac)
+ / p.scapy_tra_sa.encrypt(
+ IP(src=self.tra_if.remote_ip4, dst=self.tra_if.local_ip4) / ICMP(),
+ seq_num=204,
+ )
+ ),
+ ]
+ n_rx = 1 if ar_on else 3
+ recv_pkts = self.send_and_expect(self.tra_if, pkts, self.tra_if, n_rx=n_rx)
+
# move the window over half way to a wrap
pkts = [
(