test_ipsec_esp.py revision fbc38898
1import socket
2import unittest
3from scapy.layers.ipsec import ESP
4from scapy.layers.inet import UDP
5
6from parameterized import parameterized
7from framework import VppTestRunner
8from template_ipsec import IpsecTra46Tests, IpsecTun46Tests, TemplateIpsec, \
9    IpsecTcpTests, IpsecTun4Tests, IpsecTra4Tests, config_tra_params, \
10    IPsecIPv4Params, IPsecIPv6Params, \
11    IpsecTra4, IpsecTun4, IpsecTra6, IpsecTun6
12from vpp_ipsec import VppIpsecSpd, VppIpsecSpdEntry, VppIpsecSA,\
13    VppIpsecSpdItfBinding
14from vpp_ip_route import VppIpRoute, VppRoutePath
15from vpp_ip import DpoProto
16from vpp_papi import VppEnum
17
18NUM_PKTS = 67
19
20
21class ConfigIpsecESP(TemplateIpsec):
22    encryption_type = ESP
23    tra4_encrypt_node_name = "esp4-encrypt"
24    tra4_decrypt_node_name = "esp4-decrypt"
25    tra6_encrypt_node_name = "esp6-encrypt"
26    tra6_decrypt_node_name = "esp6-decrypt"
27    tun4_encrypt_node_name = "esp4-encrypt"
28    tun4_decrypt_node_name = "esp4-decrypt"
29    tun6_encrypt_node_name = "esp6-encrypt"
30    tun6_decrypt_node_name = "esp6-decrypt"
31
32    @classmethod
33    def setUpClass(cls):
34        super(ConfigIpsecESP, cls).setUpClass()
35
36    @classmethod
37    def tearDownClass(cls):
38        super(ConfigIpsecESP, cls).tearDownClass()
39
40    def setUp(self):
41        super(ConfigIpsecESP, self).setUp()
42
43    def tearDown(self):
44        super(ConfigIpsecESP, self).tearDown()
45
46    def config_network(self, params):
47        self.net_objs = []
48        self.tun_if = self.pg0
49        self.tra_if = self.pg2
50        self.logger.info(self.vapi.ppcli("show int addr"))
51
52        self.tra_spd = VppIpsecSpd(self, self.tra_spd_id)
53        self.tra_spd.add_vpp_config()
54        self.net_objs.append(self.tra_spd)
55        self.tun_spd = VppIpsecSpd(self, self.tun_spd_id)
56        self.tun_spd.add_vpp_config()
57        self.net_objs.append(self.tun_spd)
58
59        b = VppIpsecSpdItfBinding(self, self.tun_spd,
60                                  self.tun_if)
61        b.add_vpp_config()
62        self.net_objs.append(b)
63
64        b = VppIpsecSpdItfBinding(self, self.tra_spd,
65                                  self.tra_if)
66        b.add_vpp_config()
67        self.net_objs.append(b)
68
69        for p in params:
70            self.config_esp_tra(p)
71            config_tra_params(p, self.encryption_type)
72        for p in params:
73            self.config_esp_tun(p)
74
75        for p in params:
76            d = DpoProto.DPO_PROTO_IP6 if p.is_ipv6 else DpoProto.DPO_PROTO_IP4
77            r = VppIpRoute(self,  p.remote_tun_if_host, p.addr_len,
78                           [VppRoutePath(self.tun_if.remote_addr[p.addr_type],
79                                         0xffffffff,
80                                         proto=d)])
81            r.add_vpp_config()
82            self.net_objs.append(r)
83
84        self.logger.info(self.vapi.ppcli("show ipsec all"))
85
86    def unconfig_network(self):
87        for o in reversed(self.net_objs):
88            o.remove_vpp_config()
89        self.net_objs = []
90
91    def config_esp_tun(self, params):
92        addr_type = params.addr_type
93        scapy_tun_sa_id = params.scapy_tun_sa_id
94        scapy_tun_spi = params.scapy_tun_spi
95        vpp_tun_sa_id = params.vpp_tun_sa_id
96        vpp_tun_spi = params.vpp_tun_spi
97        auth_algo_vpp_id = params.auth_algo_vpp_id
98        auth_key = params.auth_key
99        crypt_algo_vpp_id = params.crypt_algo_vpp_id
100        crypt_key = params.crypt_key
101        remote_tun_if_host = params.remote_tun_if_host
102        addr_any = params.addr_any
103        addr_bcast = params.addr_bcast
104        e = VppEnum.vl_api_ipsec_spd_action_t
105        flags = params.flags
106        salt = params.salt
107        objs = []
108
109        params.tun_sa_in = VppIpsecSA(self, scapy_tun_sa_id, scapy_tun_spi,
110                                      auth_algo_vpp_id, auth_key,
111                                      crypt_algo_vpp_id, crypt_key,
112                                      self.vpp_esp_protocol,
113                                      self.tun_if.local_addr[addr_type],
114                                      self.tun_if.remote_addr[addr_type],
115                                      flags=flags,
116                                      salt=salt)
117        params.tun_sa_out = VppIpsecSA(self, vpp_tun_sa_id, vpp_tun_spi,
118                                       auth_algo_vpp_id, auth_key,
119                                       crypt_algo_vpp_id, crypt_key,
120                                       self.vpp_esp_protocol,
121                                       self.tun_if.remote_addr[addr_type],
122                                       self.tun_if.local_addr[addr_type],
123                                       flags=flags,
124                                       salt=salt)
125        objs.append(params.tun_sa_in)
126        objs.append(params.tun_sa_out)
127
128        params.spd_policy_in_any = VppIpsecSpdEntry(self, self.tun_spd,
129                                                    scapy_tun_sa_id,
130                                                    addr_any, addr_bcast,
131                                                    addr_any, addr_bcast,
132                                                    socket.IPPROTO_ESP)
133        params.spd_policy_out_any = VppIpsecSpdEntry(self, self.tun_spd,
134                                                     scapy_tun_sa_id,
135                                                     addr_any, addr_bcast,
136                                                     addr_any, addr_bcast,
137                                                     socket.IPPROTO_ESP,
138                                                     is_outbound=0)
139        objs.append(params.spd_policy_out_any)
140        objs.append(params.spd_policy_in_any)
141
142        objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id,
143                                     remote_tun_if_host, remote_tun_if_host,
144                                     self.pg1.remote_addr[addr_type],
145                                     self.pg1.remote_addr[addr_type],
146                                     0,
147                                     priority=10,
148                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
149                                     is_outbound=0))
150        objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id,
151                                     self.pg1.remote_addr[addr_type],
152                                     self.pg1.remote_addr[addr_type],
153                                     remote_tun_if_host, remote_tun_if_host,
154                                     0,
155                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
156                                     priority=10))
157        objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id,
158                                     remote_tun_if_host, remote_tun_if_host,
159                                     self.pg0.local_addr[addr_type],
160                                     self.pg0.local_addr[addr_type],
161                                     0,
162                                     priority=20,
163                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
164                                     is_outbound=0))
165        objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id,
166                                     self.pg0.local_addr[addr_type],
167                                     self.pg0.local_addr[addr_type],
168                                     remote_tun_if_host, remote_tun_if_host,
169                                     0,
170                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
171                                     priority=20))
172        for o in objs:
173            o.add_vpp_config()
174        self.net_objs = self.net_objs + objs
175
176    def config_esp_tra(self, params):
177        addr_type = params.addr_type
178        scapy_tra_sa_id = params.scapy_tra_sa_id
179        scapy_tra_spi = params.scapy_tra_spi
180        vpp_tra_sa_id = params.vpp_tra_sa_id
181        vpp_tra_spi = params.vpp_tra_spi
182        auth_algo_vpp_id = params.auth_algo_vpp_id
183        auth_key = params.auth_key
184        crypt_algo_vpp_id = params.crypt_algo_vpp_id
185        crypt_key = params.crypt_key
186        addr_any = params.addr_any
187        addr_bcast = params.addr_bcast
188        flags = (VppEnum.vl_api_ipsec_sad_flags_t.
189                 IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY)
190        e = VppEnum.vl_api_ipsec_spd_action_t
191        flags = params.flags | flags
192        salt = params.salt
193        objs = []
194
195        params.tra_sa_in = VppIpsecSA(self, scapy_tra_sa_id, scapy_tra_spi,
196                                      auth_algo_vpp_id, auth_key,
197                                      crypt_algo_vpp_id, crypt_key,
198                                      self.vpp_esp_protocol,
199                                      flags=flags,
200                                      salt=salt)
201        params.tra_sa_out = VppIpsecSA(self, vpp_tra_sa_id, vpp_tra_spi,
202                                       auth_algo_vpp_id, auth_key,
203                                       crypt_algo_vpp_id, crypt_key,
204                                       self.vpp_esp_protocol,
205                                       flags=flags,
206                                       salt=salt)
207        objs.append(params.tra_sa_in)
208        objs.append(params.tra_sa_out)
209
210        objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id,
211                                     addr_any, addr_bcast,
212                                     addr_any, addr_bcast,
213                                     socket.IPPROTO_ESP))
214        objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id,
215                                     addr_any, addr_bcast,
216                                     addr_any, addr_bcast,
217                                     socket.IPPROTO_ESP,
218                                     is_outbound=0))
219        objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id,
220                                     self.tra_if.local_addr[addr_type],
221                                     self.tra_if.local_addr[addr_type],
222                                     self.tra_if.remote_addr[addr_type],
223                                     self.tra_if.remote_addr[addr_type],
224                                     0, priority=10,
225                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
226                                     is_outbound=0))
227        objs.append(VppIpsecSpdEntry(self, self.tra_spd, scapy_tra_sa_id,
228                                     self.tra_if.local_addr[addr_type],
229                                     self.tra_if.local_addr[addr_type],
230                                     self.tra_if.remote_addr[addr_type],
231                                     self.tra_if.remote_addr[addr_type],
232                                     0, policy=e.IPSEC_API_SPD_ACTION_PROTECT,
233                                     priority=10))
234        for o in objs:
235            o.add_vpp_config()
236        self.net_objs = self.net_objs + objs
237
238
239class TemplateIpsecEsp(ConfigIpsecESP):
240    """
241    Basic test for ipsec esp sanity - tunnel and transport modes.
242
243    Below 4 cases are covered as part of this test
244    1) ipsec esp v4 transport basic test  - IPv4 Transport mode
245        scenario using HMAC-SHA1-96 integrity algo
246    2) ipsec esp v4 transport burst test
247        Above test for 257 pkts
248    3) ipsec esp 4o4 tunnel basic test    - IPv4 Tunnel mode
249        scenario using HMAC-SHA1-96 integrity algo
250    4) ipsec esp 4o4 tunnel burst test
251        Above test for 257 pkts
252
253    TRANSPORT MODE:
254
255     ---   encrypt   ---
256    |pg2| <-------> |VPP|
257     ---   decrypt   ---
258
259    TUNNEL MODE:
260
261     ---   encrypt   ---   plain   ---
262    |pg0| <-------  |VPP| <------ |pg1|
263     ---             ---           ---
264
265     ---   decrypt   ---   plain   ---
266    |pg0| ------->  |VPP| ------> |pg1|
267     ---             ---           ---
268    """
269
270    @classmethod
271    def setUpClass(cls):
272        super(TemplateIpsecEsp, cls).setUpClass()
273
274    @classmethod
275    def tearDownClass(cls):
276        super(TemplateIpsecEsp, cls).tearDownClass()
277
278    def setUp(self):
279        super(TemplateIpsecEsp, self).setUp()
280        self.config_network(self.params.values())
281
282    def tearDown(self):
283        self.unconfig_network()
284        super(TemplateIpsecEsp, self).tearDown()
285
286
287class TestIpsecEsp1(TemplateIpsecEsp, IpsecTra46Tests, IpsecTun46Tests):
288    """ Ipsec ESP - TUN & TRA tests """
289    pass
290
291
292class TestIpsecEsp2(TemplateIpsecEsp, IpsecTcpTests):
293    """ Ipsec ESP - TCP tests """
294    pass
295
296
297class TemplateIpsecEspUdp(ConfigIpsecESP):
298    """
299    UDP encapped ESP
300    """
301
302    @classmethod
303    def setUpClass(cls):
304        super(TemplateIpsecEspUdp, cls).setUpClass()
305
306    @classmethod
307    def tearDownClass(cls):
308        super(TemplateIpsecEspUdp, cls).tearDownClass()
309
310    def setUp(self):
311        super(TemplateIpsecEspUdp, self).setUp()
312        self.net_objs = []
313        self.tun_if = self.pg0
314        self.tra_if = self.pg2
315        self.logger.info(self.vapi.ppcli("show int addr"))
316
317        p = self.ipv4_params
318        p.flags = (VppEnum.vl_api_ipsec_sad_flags_t.
319                   IPSEC_API_SAD_FLAG_UDP_ENCAP)
320        p.nat_header = UDP(sport=5454, dport=4500)
321
322        self.tra_spd = VppIpsecSpd(self, self.tra_spd_id)
323        self.tra_spd.add_vpp_config()
324        VppIpsecSpdItfBinding(self, self.tra_spd,
325                              self.tra_if).add_vpp_config()
326
327        self.config_esp_tra(p)
328        config_tra_params(p, self.encryption_type)
329
330        self.tun_spd = VppIpsecSpd(self, self.tun_spd_id)
331        self.tun_spd.add_vpp_config()
332        VppIpsecSpdItfBinding(self, self.tun_spd,
333                              self.tun_if).add_vpp_config()
334
335        self.config_esp_tun(p)
336        self.logger.info(self.vapi.ppcli("show ipsec all"))
337
338        d = DpoProto.DPO_PROTO_IP4
339        VppIpRoute(self,  p.remote_tun_if_host, p.addr_len,
340                   [VppRoutePath(self.tun_if.remote_addr[p.addr_type],
341                                 0xffffffff,
342                                 proto=d)]).add_vpp_config()
343
344    def tearDown(self):
345        super(TemplateIpsecEspUdp, self).tearDown()
346
347    def show_commands_at_teardown(self):
348        self.logger.info(self.vapi.cli("show hardware"))
349
350
351class TestIpsecEspUdp(TemplateIpsecEspUdp, IpsecTra4Tests):
352    """ Ipsec NAT-T ESP UDP tests """
353    pass
354
355
356class MyParameters():
357    def __init__(self):
358        self.engines = ["ia32", "ipsecmb", "openssl"]
359        flag_esn = VppEnum.vl_api_ipsec_sad_flags_t.IPSEC_API_SAD_FLAG_USE_ESN
360        self.flags = [0, flag_esn]
361        # foreach crypto algorithm
362        self.algos = {
363            'AES-GCM-128/NONE': {
364                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
365                                 IPSEC_API_CRYPTO_ALG_AES_GCM_128),
366                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
367                                IPSEC_API_INTEG_ALG_NONE),
368                  'scapy-crypto': "AES-GCM",
369                  'scapy-integ': "NULL",
370                  'key': "JPjyOWBeVEQiMe7h",
371                  'salt': 0},
372            'AES-GCM-192/NONE': {
373                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
374                                 IPSEC_API_CRYPTO_ALG_AES_GCM_192),
375                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
376                                IPSEC_API_INTEG_ALG_NONE),
377                  'scapy-crypto': "AES-GCM",
378                  'scapy-integ': "NULL",
379                  'key': "JPjyOWBeVEQiMe7h01234567",
380                  'salt': 1010},
381            'AES-GCM-256/NONE': {
382                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
383                                 IPSEC_API_CRYPTO_ALG_AES_GCM_256),
384                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
385                                IPSEC_API_INTEG_ALG_NONE),
386                  'scapy-crypto': "AES-GCM",
387                  'scapy-integ': "NULL",
388                  'key': "JPjyOWBeVEQiMe7h0123456787654321",
389                  'salt': 2020},
390            'AES-CBC-128/MD5-96': {
391                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
392                                 IPSEC_API_CRYPTO_ALG_AES_CBC_128),
393                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
394                                IPSEC_API_INTEG_ALG_MD5_96),
395                  'scapy-crypto': "AES-CBC",
396                  'scapy-integ': "HMAC-MD5-96",
397                  'salt': 0,
398                  'key': "JPjyOWBeVEQiMe7h"},
399            'AES-CBC-192/SHA1-96': {
400                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
401                                 IPSEC_API_CRYPTO_ALG_AES_CBC_192),
402                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
403                                IPSEC_API_INTEG_ALG_SHA1_96),
404                  'scapy-crypto': "AES-CBC",
405                  'scapy-integ': "HMAC-SHA1-96",
406                  'salt': 0,
407                  'key': "JPjyOWBeVEQiMe7hJPjyOWBe"},
408            'AES-CBC-256/SHA1-96': {
409                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
410                                 IPSEC_API_CRYPTO_ALG_AES_CBC_256),
411                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
412                                IPSEC_API_INTEG_ALG_SHA1_96),
413                  'scapy-crypto': "AES-CBC",
414                  'scapy-integ': "HMAC-SHA1-96",
415                  'salt': 0,
416                  'key': "JPjyOWBeVEQiMe7hJPjyOWBeVEQiMe7h"},
417            '3DES-CBC/SHA1-96': {
418                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
419                                 IPSEC_API_CRYPTO_ALG_3DES_CBC),
420                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
421                                IPSEC_API_INTEG_ALG_SHA1_96),
422                  'scapy-crypto': "3DES",
423                  'scapy-integ': "HMAC-SHA1-96",
424                  'salt': 0,
425                  'key': "JPjyOWBeVEQiMe7h00112233"},
426            'NONE/SHA1-96': {
427                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
428                                 IPSEC_API_CRYPTO_ALG_NONE),
429                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
430                                IPSEC_API_INTEG_ALG_SHA1_96),
431                  'scapy-crypto': "NULL",
432                  'scapy-integ': "HMAC-SHA1-96",
433                  'salt': 0,
434                  'key': "JPjyOWBeVEQiMe7h00112233"}}
435
436
437class RunTestIpsecEspAll(ConfigIpsecESP,
438                         IpsecTra4, IpsecTra6,
439                         IpsecTun4, IpsecTun6):
440    """ Ipsec ESP all Algos """
441
442    def setUp(self):
443        super(RunTestIpsecEspAll, self).setUp()
444        test_args = str.split(self.__doc__, " ")
445
446        params = MyParameters()
447        self.engine = test_args[0]
448        self.flag = params.flags[0]
449        if test_args[1] == 'ESN':
450            self.flag = params.flags[1]
451
452        self.algo = params.algos[test_args[2]]
453
454    def tearDown(self):
455        super(RunTestIpsecEspAll, self).tearDown()
456
457    def run_test(self):
458        self.run_a_test(self.engine, self.flag, self.algo)
459
460    def run_a_test(self, engine, flag, algo):
461        self.vapi.cli("set crypto handler all %s" % engine)
462
463        self.ipv4_params = IPsecIPv4Params()
464        self.ipv6_params = IPsecIPv6Params()
465
466        self.params = {self.ipv4_params.addr_type:
467                       self.ipv4_params,
468                       self.ipv6_params.addr_type:
469                       self.ipv6_params}
470
471        for _, p in self.params.items():
472            p.auth_algo_vpp_id = algo['vpp-integ']
473            p.crypt_algo_vpp_id = algo['vpp-crypto']
474            p.crypt_algo = algo['scapy-crypto']
475            p.auth_algo = algo['scapy-integ']
476            p.crypt_key = algo['key']
477            p.salt = algo['salt']
478            p.flags = p.flags | flag
479
480        self.reporter.send_keep_alive(self)
481
482        #
483        # configure the SPDs. SAs, etc
484        #
485        self.config_network(self.params.values())
486
487        #
488        # run some traffic.
489        #  An exhautsive 4o6, 6o4 is not necessary
490        #  for each algo
491        #
492        self.verify_tra_basic6(count=NUM_PKTS)
493        self.verify_tra_basic4(count=NUM_PKTS)
494        self.verify_tun_66(self.params[socket.AF_INET6],
495                           count=NUM_PKTS)
496        self.verify_tun_44(self.params[socket.AF_INET],
497                           count=NUM_PKTS)
498
499        #
500        # remove the SPDs, SAs, etc
501        #
502        self.unconfig_network()
503
504        #
505        # reconfigure the network and SA to run the
506        # anti replay tests
507        #
508        self.config_network(self.params.values())
509        self.verify_tra_anti_replay()
510        self.unconfig_network()
511
512#
513# To generate test classes, do:
514#   grep '# GEN' test_ipsec_esp.py | sed -e 's/# GEN //g' | bash
515#
516# GEN for ENG in ia32 ipsecmb openssl; do \
517# GEN   for FLG in noESN ESN; do for ALG in AES-GCM-128/NONE \
518# GEN     AES-GCM-192/NONE AES-GCM-256/NONE AES-CBC-128/MD5-96 \
519# GEN     AES-CBC-192/SHA1-96 AES-CBC-256/SHA1-96 \
520# GEN     3DES-CBC/SHA1-96 NONE/SHA1-96; do \
521# GEN      echo -e "\n\nclass Test_${ENG}_${FLG}_${ALG}(RunTestIpsecEspAll):" |
522# GEN             sed -e 's/-/_/g' -e 's#/#_#g' ; \
523# GEN      echo '    """'$ENG $FLG $ALG IPSec test'"""' ;
524# GEN      echo "    def test_ipsec(self):";
525# GEN      echo "        self.run_test()";
526# GEN done; done; done
527
528
529class Test_ia32_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
530    """ia32 noESN AES-GCM-128/NONE IPSec test"""
531    def test_ipsec(self):
532        self.run_test()
533
534
535class Test_ia32_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
536    """ia32 noESN AES-GCM-192/NONE IPSec test"""
537    def test_ipsec(self):
538        self.run_test()
539
540
541class Test_ia32_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
542    """ia32 noESN AES-GCM-256/NONE IPSec test"""
543    def test_ipsec(self):
544        self.run_test()
545
546
547class Test_ia32_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
548    """ia32 noESN AES-CBC-128/MD5-96 IPSec test"""
549    def test_ipsec(self):
550        self.run_test()
551
552
553class Test_ia32_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
554    """ia32 noESN AES-CBC-192/SHA1-96 IPSec test"""
555    def test_ipsec(self):
556        self.run_test()
557
558
559class Test_ia32_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
560    """ia32 noESN AES-CBC-256/SHA1-96 IPSec test"""
561    def test_ipsec(self):
562        self.run_test()
563
564
565class Test_ia32_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
566    """ia32 noESN 3DES-CBC/SHA1-96 IPSec test"""
567    def test_ipsec(self):
568        self.run_test()
569
570
571class Test_ia32_noESN_NONE_SHA1_96(RunTestIpsecEspAll):
572    """ia32 noESN NONE/SHA1-96 IPSec test"""
573    def test_ipsec(self):
574        self.run_test()
575
576
577class Test_ia32_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
578    """ia32 ESN AES-GCM-128/NONE IPSec test"""
579    def test_ipsec(self):
580        self.run_test()
581
582
583class Test_ia32_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
584    """ia32 ESN AES-GCM-192/NONE IPSec test"""
585    def test_ipsec(self):
586        self.run_test()
587
588
589class Test_ia32_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
590    """ia32 ESN AES-GCM-256/NONE IPSec test"""
591    def test_ipsec(self):
592        self.run_test()
593
594
595class Test_ia32_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
596    """ia32 ESN AES-CBC-128/MD5-96 IPSec test"""
597    def test_ipsec(self):
598        self.run_test()
599
600
601class Test_ia32_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
602    """ia32 ESN AES-CBC-192/SHA1-96 IPSec test"""
603    def test_ipsec(self):
604        self.run_test()
605
606
607class Test_ia32_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
608    """ia32 ESN AES-CBC-256/SHA1-96 IPSec test"""
609    def test_ipsec(self):
610        self.run_test()
611
612
613class Test_ia32_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
614    """ia32 ESN 3DES-CBC/SHA1-96 IPSec test"""
615    def test_ipsec(self):
616        self.run_test()
617
618
619class Test_ia32_ESN_NONE_SHA1_96(RunTestIpsecEspAll):
620    """ia32 ESN NONE/SHA1-96 IPSec test"""
621    def test_ipsec(self):
622        self.run_test()
623
624
625class Test_ipsecmb_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
626    """ipsecmb noESN AES-GCM-128/NONE IPSec test"""
627    def test_ipsec(self):
628        self.run_test()
629
630
631class Test_ipsecmb_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
632    """ipsecmb noESN AES-GCM-192/NONE IPSec test"""
633    def test_ipsec(self):
634        self.run_test()
635
636
637class Test_ipsecmb_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
638    """ipsecmb noESN AES-GCM-256/NONE IPSec test"""
639    def test_ipsec(self):
640        self.run_test()
641
642
643class Test_ipsecmb_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
644    """ipsecmb noESN AES-CBC-128/MD5-96 IPSec test"""
645    def test_ipsec(self):
646        self.run_test()
647
648
649class Test_ipsecmb_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
650    """ipsecmb noESN AES-CBC-192/SHA1-96 IPSec test"""
651    def test_ipsec(self):
652        self.run_test()
653
654
655class Test_ipsecmb_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
656    """ipsecmb noESN AES-CBC-256/SHA1-96 IPSec test"""
657    def test_ipsec(self):
658        self.run_test()
659
660
661class Test_ipsecmb_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
662    """ipsecmb noESN 3DES-CBC/SHA1-96 IPSec test"""
663    def test_ipsec(self):
664        self.run_test()
665
666
667class Test_ipsecmb_noESN_NONE_SHA1_96(RunTestIpsecEspAll):
668    """ipsecmb noESN NONE/SHA1-96 IPSec test"""
669    def test_ipsec(self):
670        self.run_test()
671
672
673class Test_ipsecmb_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
674    """ipsecmb ESN AES-GCM-128/NONE IPSec test"""
675    def test_ipsec(self):
676        self.run_test()
677
678
679class Test_ipsecmb_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
680    """ipsecmb ESN AES-GCM-192/NONE IPSec test"""
681    def test_ipsec(self):
682        self.run_test()
683
684
685class Test_ipsecmb_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
686    """ipsecmb ESN AES-GCM-256/NONE IPSec test"""
687    def test_ipsec(self):
688        self.run_test()
689
690
691class Test_ipsecmb_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
692    """ipsecmb ESN AES-CBC-128/MD5-96 IPSec test"""
693    def test_ipsec(self):
694        self.run_test()
695
696
697class Test_ipsecmb_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
698    """ipsecmb ESN AES-CBC-192/SHA1-96 IPSec test"""
699    def test_ipsec(self):
700        self.run_test()
701
702
703class Test_ipsecmb_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
704    """ipsecmb ESN AES-CBC-256/SHA1-96 IPSec test"""
705    def test_ipsec(self):
706        self.run_test()
707
708
709class Test_ipsecmb_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
710    """ipsecmb ESN 3DES-CBC/SHA1-96 IPSec test"""
711    def test_ipsec(self):
712        self.run_test()
713
714
715class Test_ipsecmb_ESN_NONE_SHA1_96(RunTestIpsecEspAll):
716    """ipsecmb ESN NONE/SHA1-96 IPSec test"""
717    def test_ipsec(self):
718        self.run_test()
719
720
721class Test_openssl_noESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
722    """openssl noESN AES-GCM-128/NONE IPSec test"""
723    def test_ipsec(self):
724        self.run_test()
725
726
727class Test_openssl_noESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
728    """openssl noESN AES-GCM-192/NONE IPSec test"""
729    def test_ipsec(self):
730        self.run_test()
731
732
733class Test_openssl_noESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
734    """openssl noESN AES-GCM-256/NONE IPSec test"""
735    def test_ipsec(self):
736        self.run_test()
737
738
739class Test_openssl_noESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
740    """openssl noESN AES-CBC-128/MD5-96 IPSec test"""
741    def test_ipsec(self):
742        self.run_test()
743
744
745class Test_openssl_noESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
746    """openssl noESN AES-CBC-192/SHA1-96 IPSec test"""
747    def test_ipsec(self):
748        self.run_test()
749
750
751class Test_openssl_noESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
752    """openssl noESN AES-CBC-256/SHA1-96 IPSec test"""
753    def test_ipsec(self):
754        self.run_test()
755
756
757class Test_openssl_noESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
758    """openssl noESN 3DES-CBC/SHA1-96 IPSec test"""
759    def test_ipsec(self):
760        self.run_test()
761
762
763class Test_openssl_noESN_NONE_SHA1_96(RunTestIpsecEspAll):
764    """openssl noESN NONE/SHA1-96 IPSec test"""
765    def test_ipsec(self):
766        self.run_test()
767
768
769class Test_openssl_ESN_AES_GCM_128_NONE(RunTestIpsecEspAll):
770    """openssl ESN AES-GCM-128/NONE IPSec test"""
771    def test_ipsec(self):
772        self.run_test()
773
774
775class Test_openssl_ESN_AES_GCM_192_NONE(RunTestIpsecEspAll):
776    """openssl ESN AES-GCM-192/NONE IPSec test"""
777    def test_ipsec(self):
778        self.run_test()
779
780
781class Test_openssl_ESN_AES_GCM_256_NONE(RunTestIpsecEspAll):
782    """openssl ESN AES-GCM-256/NONE IPSec test"""
783    def test_ipsec(self):
784        self.run_test()
785
786
787class Test_openssl_ESN_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
788    """openssl ESN AES-CBC-128/MD5-96 IPSec test"""
789    def test_ipsec(self):
790        self.run_test()
791
792
793class Test_openssl_ESN_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
794    """openssl ESN AES-CBC-192/SHA1-96 IPSec test"""
795    def test_ipsec(self):
796        self.run_test()
797
798
799class Test_openssl_ESN_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
800    """openssl ESN AES-CBC-256/SHA1-96 IPSec test"""
801    def test_ipsec(self):
802        self.run_test()
803
804
805class Test_openssl_ESN_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
806    """openssl ESN 3DES-CBC/SHA1-96 IPSec test"""
807    def test_ipsec(self):
808        self.run_test()
809
810
811class Test_openssl_ESN_NONE_SHA1_96(RunTestIpsecEspAll):
812    """openssl ESN NONE/SHA1-96 IPSec test"""
813    def test_ipsec(self):
814        self.run_test()
815
816
817if __name__ == '__main__':
818    unittest.main(testRunner=VppTestRunner)
819