summaryrefslogtreecommitdiffstats
path: root/test/test_ipsec_ah.py
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2019-04-08 07:36:50 +0000
committerDave Wallace <dwallacelf@gmail.com>2019-04-10 18:35:13 +0000
commit92e93844826fc080ea7f3495ba3e06de3f4d03f1 (patch)
tree0725acaacebcec816db24be35143824e4326bb68 /test/test_ipsec_ah.py
parent9847792e18f1fd9f3b8fedea4fc53eed1096ab75 (diff)
crypto: Intel IPSEC-MB engine
A plugin to use Intel IPSec MB library as a VPP crypto engine This changes uses concepts from: https://gerrit.fd.io/r/#/c/17301/ hence that author's work is acknowledge below Change-Id: I2bf3beeb10f3c9706fa5efbdc9bc023e310f5a92 Signed-off-by: Neale Ranns <nranns@cisco.com> Signed-off-by: Klement Sekera <ksekera@cisco.com>
Diffstat (limited to 'test/test_ipsec_ah.py')
-rw-r--r--test/test_ipsec_ah.py86
1 files changed, 47 insertions, 39 deletions
diff --git a/test/test_ipsec_ah.py b/test/test_ipsec_ah.py
index ec0c5586c2b..38d97d584c5 100644
--- a/test/test_ipsec_ah.py
+++ b/test/test_ipsec_ah.py
@@ -313,7 +313,10 @@ class TestIpsecAhAll(ConfigIpsecAH,
super(TestIpsecAhAll, self).tearDown()
def test_integ_algs(self):
- """SHA1_96, SHA256, SHA394, SHA512 w/ & w/o ESN"""
+ """All Engines SHA[1_96, 256, 394, 512] w/ & w/o ESN"""
+ # foreach VPP crypto engine
+ engines = ["ia32", "ipsecmb", "openssl"]
+
algos = [{'vpp': VppEnum.vl_api_ipsec_integ_alg_t.
IPSEC_API_INTEG_ALG_SHA1_96,
'scapy': "HMAC-SHA1-96"},
@@ -331,45 +334,50 @@ class TestIpsecAhAll(ConfigIpsecAH,
IPSEC_API_SAD_FLAG_USE_ESN)]
#
- # loop through each of the algorithms
+ # loop through the VPP engines
#
- for algo in algos:
- # with self.subTest(algo=algo['scapy']):
- for flag in flags:
- #
- # setup up the config paramters
- #
- self.ipv4_params = IPsecIPv4Params()
- self.ipv6_params = IPsecIPv6Params()
-
- self.params = {self.ipv4_params.addr_type:
- self.ipv4_params,
- self.ipv6_params.addr_type:
- self.ipv6_params}
-
- for _, p in self.params.items():
- p.auth_algo_vpp_id = algo['vpp']
- p.auth_algo = algo['scapy']
- p.flags = p.flags | flag
-
- #
- # configure the SPDs. SAs, etc
- #
- self.config_network(self.params.values())
-
- #
- # run some traffic.
- # An exhautsive 4o6, 6o4 is not necessary for each algo
- #
- self.verify_tra_basic6(count=17)
- self.verify_tra_basic4(count=17)
- self.verify_tun_66(self.params[socket.AF_INET6], count=17)
- self.verify_tun_44(self.params[socket.AF_INET], count=17)
-
- #
- # remove the SPDs, SAs, etc
- #
- self.unconfig_network()
+ for engine in engines:
+ self.vapi.cli("set crypto engine all %s" % engine)
+ #
+ # loop through each of the algorithms
+ #
+ for algo in algos:
+ # with self.subTest(algo=algo['scapy']):
+ for flag in flags:
+ #
+ # setup up the config paramters
+ #
+ self.ipv4_params = IPsecIPv4Params()
+ self.ipv6_params = IPsecIPv6Params()
+
+ self.params = {self.ipv4_params.addr_type:
+ self.ipv4_params,
+ self.ipv6_params.addr_type:
+ self.ipv6_params}
+
+ for _, p in self.params.items():
+ p.auth_algo_vpp_id = algo['vpp']
+ p.auth_algo = algo['scapy']
+ p.flags = p.flags | flag
+
+ #
+ # configure the SPDs. SAs, etc
+ #
+ self.config_network(self.params.values())
+
+ #
+ # run some traffic.
+ # An exhautsive 4o6, 6o4 is not necessary for each algo
+ #
+ self.verify_tra_basic6(count=17)
+ self.verify_tra_basic4(count=17)
+ self.verify_tun_66(self.params[socket.AF_INET6], count=17)
+ self.verify_tun_44(self.params[socket.AF_INET], count=17)
+
+ #
+ # remove the SPDs, SAs, etc
+ #
+ self.unconfig_network()
if __name__ == '__main__':