X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_ipsec.py;h=5866a0bb72d55038c91aa4b1fed3ac0cd20cf8ac;hb=8feeaff56fa9a4fbdfc06131f28a1060ffd9645d;hp=69aebc599d624c7be82473347ecf954d2aa9d125;hpb=a09c1ff5b6ae535932b4fc9477ffc4e39748ca62;p=vpp.git diff --git a/test/vpp_ipsec.py b/test/vpp_ipsec.py index 69aebc599d6..5866a0bb72d 100644 --- a/test/vpp_ipsec.py +++ b/test/vpp_ipsec.py @@ -1,4 +1,4 @@ -from vpp_object import * +from vpp_object import VppObject from ipaddress import ip_address from vpp_papi import VppEnum @@ -41,7 +41,7 @@ class VppIpsecSpd(VppObject): class VppIpsecSpdItfBinding(VppObject): """ VPP SPD DB to interface binding - (i.e. this SPD is used on this interfce) + (i.e. this SPD is used on this interface) """ def __init__(self, test, spd, itf): @@ -213,7 +213,7 @@ class VppIpsecSA(VppObject): self.tun_dst = ip_address(text_type(tun_dst)) def add_vpp_config(self): - self.test.vapi.ipsec_sad_entry_add_del( + r = self.test.vapi.ipsec_sad_entry_add_del( self.id, self.spi, self.integ_alg, @@ -224,6 +224,7 @@ class VppIpsecSA(VppObject): (self.tun_src if self.tun_src else []), (self.tun_dst if self.tun_dst else []), flags=self.flags) + self.stat_index = r.stat_index self.test.registry.register(self, self.test.logger) def remove_vpp_config(self): @@ -249,6 +250,10 @@ class VppIpsecSA(VppObject): def query_vpp_config(self): bs = self.test.vapi.ipsec_sa_dump() for b in bs: - if b.sa_id == self.id: + if b.entry.sad_id == self.id: return True return False + + def get_stats(self): + c = self.test.statistics.get_counter("/net/ipsec/sa") + return c[0][self.stat_index]