Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
ipsec: Test and fix IPSec worker hand-off
[vpp.git]
/
test
/
vpp_ipsec.py
diff --git
a/test/vpp_ipsec.py
b/test/vpp_ipsec.py
index
0df8cb2
..
8144ea2
100644
(file)
--- a/
test/vpp_ipsec.py
+++ b/
test/vpp_ipsec.py
@@
-8,6
+8,10
@@
except NameError:
text_type = str
text_type = str
+def mk_counter():
+ return {'packets': 0, 'bytes': 0}
+
+
class VppIpsecSpd(VppObject):
"""
VPP SPD DB
class VppIpsecSpd(VppObject):
"""
VPP SPD DB
@@
-163,9
+167,16
@@
class VppIpsecSpdEntry(VppObject):
return True
return False
return True
return False
- def get_stats(self):
+ def get_stats(self
, worker=None
):
c = self.test.statistics.get_counter("/net/ipsec/policy")
c = self.test.statistics.get_counter("/net/ipsec/policy")
- return c[0][self.stat_index]
+ if worker is None:
+ total = mk_counter()
+ for t in c:
+ total['packets'] += t[self.stat_index]['packets']
+ return total
+ else:
+ # +1 to skip main thread
+ return c[worker+1][self.stat_index]
class VppIpsecSA(VppObject):
class VppIpsecSA(VppObject):
@@
-244,9
+255,16
@@
class VppIpsecSA(VppObject):
return True
return False
return True
return False
- def get_stats(self):
+ def get_stats(self
, worker=None
):
c = self.test.statistics.get_counter("/net/ipsec/sa")
c = self.test.statistics.get_counter("/net/ipsec/sa")
- return c[0][self.stat_index]
+ if worker is None:
+ total = mk_counter()
+ for t in c:
+ total['packets'] += t[self.stat_index]['packets']
+ return total
+ else:
+ # +1 to skip main thread
+ return c[worker+1][self.stat_index]
class VppIpsecTunProtect(VppObject):
class VppIpsecTunProtect(VppObject):