aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/ikev2/test/test_ikev2.py
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2021-01-25 10:09:27 +0000
committerBeno�t Ganne <bganne@cisco.com>2021-01-27 11:35:35 +0000
commit68d2753569592e424e7584e2f921f68d1b3d2088 (patch)
tree49926c81a0ef25cecce425e7badfcaa014eee2d9 /src/plugins/ikev2/test/test_ikev2.py
parent1b9d2c2c9d21b5a29527a738601055f67165c7ca (diff)
ikev2: add per SA stats
Type: feature Change-Id: Ic502d806410ea3c8f3f1eac70b694114ccb053bf Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/plugins/ikev2/test/test_ikev2.py')
-rw-r--r--src/plugins/ikev2/test/test_ikev2.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/ikev2/test/test_ikev2.py b/src/plugins/ikev2/test/test_ikev2.py
index e6ccef7786a..9f72ffb4ae5 100644
--- a/src/plugins/ikev2/test/test_ikev2.py
+++ b/src/plugins/ikev2/test/test_ikev2.py
@@ -1325,9 +1325,14 @@ class TemplateResponder(IkePeer):
def verify_counters(self):
self.assert_counter(2, 'processed', self.IKE_NODE_SUFFIX)
- self.assert_counter(1, 'exchange_sa_req', self.IKE_NODE_SUFFIX)
+ self.assert_counter(1, 'init_sa_req', self.IKE_NODE_SUFFIX)
self.assert_counter(1, 'ike_auth_req', self.IKE_NODE_SUFFIX)
+ r = self.vapi.ikev2_sa_dump()
+ s = r[0].sa.stats
+ self.assertEqual(1, s.n_sa_auth_req)
+ self.assertEqual(1, s.n_sa_init_req)
+
def test_responder(self):
self.send_sa_init_req()
self.send_sa_auth()
@@ -1862,6 +1867,9 @@ class TestResponderRekey(TestResponderPsk):
self.sa.calc_child_keys()
self.verify_ike_sas()
self.verify_ipsec_sas(is_rekey=True)
+ self.assert_counter(1, 'rekey_req', 'ip4')
+ r = self.vapi.ikev2_sa_dump()
+ self.assertEqual(r[0].sa.stats.n_rekey_req, 1)
class TestResponderRsaSign(TemplateResponder, Ikev2Params):
@@ -1942,6 +1950,8 @@ class TestInitiatorKeepaliveMsg(TestInitiatorPsk):
plain = self.sa.hmac_and_decrypt(ih)
self.assertEqual(plain, b'')
self.assert_counter(1, 'keepalive', 'ip4')
+ r = self.vapi.ikev2_sa_dump()
+ self.assertEqual(1, r[0].sa.stats.n_keepalives)
def test_initiator(self):
super(TestInitiatorKeepaliveMsg, self).test_initiator()