Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
dpdk: bump to 19.05
[vpp.git]
/
test
/
template_ipsec.py
diff --git
a/test/template_ipsec.py
b/test/template_ipsec.py
index
61ac0b5
..
87565ed
100644
(file)
--- a/
test/template_ipsec.py
+++ b/
test/template_ipsec.py
@@
-293,7
+293,7
@@
class IpsecTra4(object):
# replayed packets are dropped
self.send_and_assert_no_replies(self.tra_if, pkt * 3)
# replayed packets are dropped
self.send_and_assert_no_replies(self.tra_if, pkt * 3)
- self.assert_
packet
_counter_equal(
+ self.assert_
error
_counter_equal(
'/err/%s/SA replayed packet' % self.tra4_decrypt_node_name, 3)
# the window size is 64 packets
'/err/%s/SA replayed packet' % self.tra4_decrypt_node_name, 3)
# the window size is 64 packets
@@
-321,7
+321,7
@@
class IpsecTra4(object):
seq_num=350))
self.send_and_assert_no_replies(self.tra_if, pkt * 17)
seq_num=350))
self.send_and_assert_no_replies(self.tra_if, pkt * 17)
- self.assert_
packet
_counter_equal(
+ self.assert_
error
_counter_equal(
'/err/%s/Integrity check failed' % self.tra4_decrypt_node_name, 17)
# a malformed 'runt' packet
'/err/%s/Integrity check failed' % self.tra4_decrypt_node_name, 17)
# a malformed 'runt' packet
@@
-337,7
+337,7
@@
class IpsecTra4(object):
seq_num=350))
self.send_and_assert_no_replies(self.tra_if, pkt * 17)
seq_num=350))
self.send_and_assert_no_replies(self.tra_if, pkt * 17)
- self.assert_
packet
_counter_equal(
+ self.assert_
error
_counter_equal(
'/err/%s/undersized packet' % self.tra4_decrypt_node_name, 17)
# which we can determine since this packet is still in the window
'/err/%s/undersized packet' % self.tra4_decrypt_node_name, 17)
# which we can determine since this packet is still in the window
@@
-361,12
+361,12
@@
class IpsecTra4(object):
if use_esn:
# an out of window error with ESN looks like a high sequence
# wrap. but since it isn't then the verify will fail.
if use_esn:
# an out of window error with ESN looks like a high sequence
# wrap. but since it isn't then the verify will fail.
- self.assert_
packet
_counter_equal(
+ self.assert_
error
_counter_equal(
'/err/%s/Integrity check failed' %
self.tra4_decrypt_node_name, 34)
else:
'/err/%s/Integrity check failed' %
self.tra4_decrypt_node_name, 34)
else:
- self.assert_
packet
_counter_equal(
+ self.assert_
error
_counter_equal(
'/err/%s/SA replayed packet' %
self.tra4_decrypt_node_name, 20)
'/err/%s/SA replayed packet' %
self.tra4_decrypt_node_name, 20)
@@
-411,7
+411,7
@@
class IpsecTra4(object):
decrypted = p.vpp_tra_sa.decrypt(rx[0][IP])
else:
self.send_and_assert_no_replies(self.tra_if, [pkt])
decrypted = p.vpp_tra_sa.decrypt(rx[0][IP])
else:
self.send_and_assert_no_replies(self.tra_if, [pkt])
- self.assert_
packet
_counter_equal(
+ self.assert_
error
_counter_equal(
'/err/%s/sequence number cycled' %
self.tra4_encrypt_node_name, 1)
'/err/%s/sequence number cycled' %
self.tra4_encrypt_node_name, 1)
@@
-527,7
+527,9
@@
class IpsecTra46Tests(IpsecTra4Tests, IpsecTra6Tests):
class IpsecTun4(object):
""" verify methods for Tunnel v4 """
class IpsecTun4(object):
""" verify methods for Tunnel v4 """
- def verify_counters(self, p, count):
+ def verify_counters4(self, p, count, n_frags=None):
+ if not n_frags:
+ n_frags = count
if (hasattr(p, "spd_policy_in_any")):
pkts = p.spd_policy_in_any.get_stats()['packets']
self.assertEqual(pkts, count,
if (hasattr(p, "spd_policy_in_any")):
pkts = p.spd_policy_in_any.get_stats()['packets']
self.assertEqual(pkts, count,
@@
-544,7
+546,7
@@
class IpsecTun4(object):
"incorrect SA out counts: expected %d != %d" %
(count, pkts))
"incorrect SA out counts: expected %d != %d" %
(count, pkts))
- self.assert_packet_counter_equal(self.tun4_encrypt_node_name,
count
)
+ self.assert_packet_counter_equal(self.tun4_encrypt_node_name,
n_frags
)
self.assert_packet_counter_equal(self.tun4_decrypt_node_name, count)
def verify_decrypted(self, p, rxs):
self.assert_packet_counter_equal(self.tun4_decrypt_node_name, count)
def verify_decrypted(self, p, rxs):
@@
-600,7
+602,7
@@
class IpsecTun4(object):
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
- self.verify_counters
(p, count
)
+ self.verify_counters
4(p, count, n_rx
)
def verify_tun_64(self, p, count=1):
self.vapi.cli("clear errors")
def verify_tun_64(self, p, count=1):
self.vapi.cli("clear errors")
@@
-638,7
+640,7
@@
class IpsecTun4(object):
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
- self.verify_counters(p, count)
+ self.verify_counters
4
(p, count)
class IpsecTun4Tests(IpsecTun4):
class IpsecTun4Tests(IpsecTun4):
@@
-654,7
+656,7
@@
class IpsecTun4Tests(IpsecTun4):
class IpsecTun6(object):
""" verify methods for Tunnel v6 """
class IpsecTun6(object):
""" verify methods for Tunnel v6 """
- def verify_counters(self, p, count):
+ def verify_counters
6
(self, p, count):
if (hasattr(p, "tun_sa_in")):
pkts = p.tun_sa_in.get_stats()['packets']
self.assertEqual(pkts, count,
if (hasattr(p, "tun_sa_in")):
pkts = p.tun_sa_in.get_stats()['packets']
self.assertEqual(pkts, count,
@@
-706,7
+708,7
@@
class IpsecTun6(object):
finally:
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
finally:
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
- self.verify_counters(p, count)
+ self.verify_counters
6
(p, count)
def verify_tun_46(self, p, count=1):
""" ipsec 4o6 tunnel basic test """
def verify_tun_46(self, p, count=1):
""" ipsec 4o6 tunnel basic test """
@@
-745,7
+747,7
@@
class IpsecTun6(object):
finally:
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
finally:
self.logger.info(self.vapi.ppcli("show error"))
self.logger.info(self.vapi.ppcli("show ipsec all"))
- self.verify_counters(p, count)
+ self.verify_counters
6
(p, count)
class IpsecTun6Tests(IpsecTun6):
class IpsecTun6Tests(IpsecTun6):