X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=test%2Fvpp_ipsec.py;h=7a5a95a457a488ffccc0ba8b8a950404d7d17707;hb=08c50e3b7acb932adb1f62002619a1e52207262a;hp=1db7f853e72a82aff8fe9b2c5808e701ff318c15;hpb=d9b0c6fbf7aa5bd9af84264105b39c82028a4a29;p=vpp.git diff --git a/test/vpp_ipsec.py b/test/vpp_ipsec.py index 1db7f853e72..7a5a95a457a 100644 --- a/test/vpp_ipsec.py +++ b/test/vpp_ipsec.py @@ -85,7 +85,7 @@ class VppIpsecSpdEntry(VppObject): local_stop, remote_start, remote_stop, - proto, + proto=socket.IPPROTO_RAW, priority=100, policy=None, is_outbound=1, @@ -295,6 +295,26 @@ class VppIpsecSA(VppObject): self.test.registry.register(self, self.test.logger) return self + def update_vpp_config( + self, udp_src=None, udp_dst=None, is_tun=False, tun_src=None, tun_dst=None + ): + if is_tun: + if tun_src: + self.tun_src = ip_address(text_type(tun_src)) + if tun_dst: + self.tun_dst = ip_address(text_type(tun_dst)) + if udp_src: + self.udp_src = udp_src + if udp_dst: + self.udp_dst = udp_dst + self.test.vapi.ipsec_sad_entry_update( + sad_id=self.id, + is_tun=is_tun, + tunnel=self.tunnel_encode(), + udp_src_port=udp_src, + udp_dst_port=udp_dst, + ) + def remove_vpp_config(self): self.test.vapi.ipsec_sad_entry_del(id=self.id) @@ -338,8 +358,8 @@ 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") + def get_err(self, name, worker=None): + c = self.test.statistics.get_counter("/net/ipsec/sa/err/" + name) if worker is None: total = 0 for t in c: