ipsec: Record the number of packets lost from an SA
[vpp.git] / test / vpp_ipsec.py
index f9b7bc4..76080e0 100644 (file)
@@ -313,6 +313,17 @@ class VppIpsecSA(VppObject):
             # +1 to skip main thread
             return c[worker+1][self.stat_index]
 
+    def get_lost(self, worker=None):
+        c = self.test.statistics.get_counter("/net/ipsec/sa/lost")
+        if worker is None:
+            total = 0
+            for t in c:
+                total += t[self.stat_index]
+            return total
+        else:
+            # +1 to skip main thread
+            return c[worker+1][self.stat_index]
+
 
 class VppIpsecTunProtect(VppObject):
     """