diff options
author | Neale Ranns <nranns@cisco.com> | 2019-02-17 18:04:27 +0000 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-02-18 13:05:17 +0000 |
commit | eba31ecebed1a7d168da17194cab7a8955761f2b (patch) | |
tree | fe640b26f9dc98d7aaf5ff0ade2d643a1b86cbbe /test/test_ipsec_esp.py | |
parent | 684586786e98bc779e269c0d879a2a4d3f1f4bce (diff) |
IPSEC: move SA counters into the stats segment
1) stats are accessed via the stat segment which is more condusive to
monitoring
2) stats are accurate in the presence of multiple threads. There's no
guarantee that an SA is access from only one worker.
Change-Id: Id5e217ea253ddfc9480aaedb0d008dea031b1148
Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'test/test_ipsec_esp.py')
-rw-r--r-- | test/test_ipsec_esp.py | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/test/test_ipsec_esp.py b/test/test_ipsec_esp.py index ba67b60a08e..7a05f0d2183 100644 --- a/test/test_ipsec_esp.py +++ b/test/test_ipsec_esp.py @@ -97,18 +97,20 @@ class TemplateIpsecEsp(TemplateIpsec): addr_bcast = params.addr_bcast e = VppEnum.vl_api_ipsec_spd_action_t - VppIpsecSA(self, scapy_tun_sa_id, scapy_tun_spi, - auth_algo_vpp_id, auth_key, - crypt_algo_vpp_id, crypt_key, - self.vpp_esp_protocol, - self.tun_if.local_addr[addr_type], - self.tun_if.remote_addr[addr_type]).add_vpp_config() - VppIpsecSA(self, vpp_tun_sa_id, vpp_tun_spi, - auth_algo_vpp_id, auth_key, - crypt_algo_vpp_id, crypt_key, - self.vpp_esp_protocol, - self.tun_if.remote_addr[addr_type], - self.tun_if.local_addr[addr_type]).add_vpp_config() + params.tun_sa_in = VppIpsecSA(self, scapy_tun_sa_id, scapy_tun_spi, + auth_algo_vpp_id, auth_key, + crypt_algo_vpp_id, crypt_key, + self.vpp_esp_protocol, + self.tun_if.local_addr[addr_type], + self.tun_if.remote_addr[addr_type]) + params.tun_sa_in.add_vpp_config() + params.tun_sa_out = VppIpsecSA(self, vpp_tun_sa_id, vpp_tun_spi, + auth_algo_vpp_id, auth_key, + crypt_algo_vpp_id, crypt_key, + self.vpp_esp_protocol, + self.tun_if.remote_addr[addr_type], + self.tun_if.local_addr[addr_type]) + params.tun_sa_out.add_vpp_config() params.spd_policy_in_any = VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id, @@ -172,16 +174,18 @@ class TemplateIpsecEsp(TemplateIpsec): IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY) e = VppEnum.vl_api_ipsec_spd_action_t - VppIpsecSA(self, scapy_tra_sa_id, scapy_tra_spi, - auth_algo_vpp_id, auth_key, - crypt_algo_vpp_id, crypt_key, - self.vpp_esp_protocol, - flags=flags).add_vpp_config() - VppIpsecSA(self, vpp_tra_sa_id, vpp_tra_spi, - auth_algo_vpp_id, auth_key, - crypt_algo_vpp_id, crypt_key, - self.vpp_esp_protocol, - flags=flags).add_vpp_config() + params.tra_sa_in = VppIpsecSA(self, scapy_tra_sa_id, scapy_tra_spi, + auth_algo_vpp_id, auth_key, + crypt_algo_vpp_id, crypt_key, + self.vpp_esp_protocol, + flags=flags) + params.tra_sa_in.add_vpp_config() + params.tra_sa_out = VppIpsecSA(self, vpp_tra_sa_id, vpp_tra_spi, + auth_algo_vpp_id, auth_key, + crypt_algo_vpp_id, crypt_key, + self.vpp_esp_protocol, + flags=flags) + params.tra_sa_out.add_vpp_config() VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id, addr_any, addr_bcast, |