aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
ModeNameSize
-rw-r--r--CMakeLists.txt33887logstatsplain
-rw-r--r--MTU.md2771logstatsplain
d---------adj853logstatsplain
-rw-r--r--api_errno.h10686logstatsplain
d---------bfd492logstatsplain
d---------bier1536logstatsplain
d---------bonding211logstatsplain
-rw-r--r--buffer.c1893logstatsplain
-rw-r--r--buffer.h12617logstatsplain
d---------classify593logstatsplain
-rw-r--r--config.c10584logstatsplain
-rw-r--r--config.h5343logstatsplain
d---------cop259logstatsplain
d---------crypto141logstatsplain
d---------devices311logstatsplain
d---------dhcp1095logstatsplain
-rw-r--r--dir.dox973logstatsplain
d---------dpo1480logstatsplain
d---------ethernet1025logstatsplain
d---------feature196logstatsplain
d---------fib2333logstatsplain
d---------flow106logstatsplain
-rw-r--r--format_fns.h794logstatsplain
d---------geneve307logstatsplain
-rw-r--r--global_funcs.h949logstatsplain
d---------gre316logstatsplain
-rw-r--r--handoff.c8749logstatsplain
-rw-r--r--handoff.h6232logstatsplain
d---------hdlc207logstatsplain
-rw-r--r--interface.api17762logstatsplain
-rw-r--r--interface.c48386logstatsplain
-rw-r--r--interface.h30817logstatsplain
-rw-r--r--interface_api.c40833logstatsplain
-rw-r--r--interface_cli.c65289logstatsplain
-rw-r--r--interface_format.c19987logstatsplain
-rw-r--r--interface_funcs.h15805logstatsplain
-rw-r--r--interface_output.c42677logstatsplain
-rw-r--r--interface_output.h3548logstatsplain
-rw-r--r--interface_stats.c5606logstatsplain
-rw-r--r--interface_types.api1827logstatsplain
d---------ip3190logstatsplain
d---------ipfix-export395logstatsplain
d---------ipip324logstatsplain
d---------ipsec1178logstatsplain
d---------l21558logstatsplain
d---------l2tp280logstatsplain
-rw-r--r--l3_types.h2206logstatsplain
d---------lawful-intercept126logstatsplain
d---------lisp-cp755logstatsplain
d---------lisp-gpe869logstatsplain
d---------llc132logstatsplain
d---------lldp422logstatsplain
d---------mfib1035logstatsplain
-rw-r--r--misc.c3682logstatsplain
d---------mpls614logstatsplain
d---------osi132logstatsplain
d---------pg386logstatsplain
-rw-r--r--pipeline.h9871logstatsplain
d---------plugin36logstatsplain
d---------policer344logstatsplain
d---------ppp205logstatsplain
d---------qos604logstatsplain
d---------session1392logstatsplain
d---------snap134logstatsplain
d---------span215logstatsplain
d---------srmpls279logstatsplain
d---------srp210logstatsplain
d---------srv6498logstatsplain
d---------syslog305logstatsplain
d---------tcp652logstatsplain
d---------tls104logstatsplain
d---------udp495logstatsplain
d---------unix188logstatsplain
d---------util262logstatsplain
-rw-r--r--vnet.h3297logstatsplain
-rw-r--r--vnet_all_api_h.h2903logstatsplain
-rw-r--r--vnet_msg_enum.h1028logstatsplain
d---------vxlan-gbp406logstatsplain
d---------vxlan-gpe405logstatsplain
d---------vxlan336logstatsplain
6' href='#n1276'>1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088
import socket
import unittest
from scapy.layers.ipsec import ESP
from scapy.layers.inet import IP, ICMP, UDP
from scapy.layers.inet6 import IPv6
from scapy.layers.l2 import Ether
from scapy.packet import Raw

from parameterized import parameterized
from framework import VppTestRunner
from template_ipsec import IpsecTra46Tests, IpsecTun46Tests, TemplateIpsec, \
    IpsecTcpTests, IpsecTun4Tests, IpsecTra4Tests, config_tra_params, \
    config_tun_params, IPsecIPv4Params, IPsecIPv6Params, \
    IpsecTra4, IpsecTun4, IpsecTra6, IpsecTun6, \
    IpsecTun6HandoffTests, IpsecTun4HandoffTests, \
    IpsecTra6ExtTests
from vpp_ipsec import VppIpsecSpd, VppIpsecSpdEntry, VppIpsecSA,\
    VppIpsecSpdItfBinding
from vpp_ip_route import VppIpRoute, VppRoutePath
from vpp_ip import DpoProto
from vpp_papi import VppEnum

NUM_PKTS = 67
engines_supporting_chain_bufs = ["openssl", "async"]
engines = ["ia32", "ipsecmb", "openssl"]


class ConfigIpsecESP(TemplateIpsec):
    encryption_type = ESP
    tra4_encrypt_node_name = "esp4-encrypt"
    tra4_decrypt_node_name = ["esp4-decrypt", "esp4-decrypt-post"]
    tra6_encrypt_node_name = "esp6-encrypt"
    tra6_decrypt_node_name = ["esp6-decrypt", "esp6-decrypt-post"]
    tun4_encrypt_node_name = "esp4-encrypt"
    tun4_decrypt_node_name = ["esp4-decrypt", "esp4-decrypt-post"]
    tun6_encrypt_node_name = "esp6-encrypt"
    tun6_decrypt_node_name = ["esp6-decrypt", "esp6-decrypt-post"]

    @classmethod
    def setUpClass(cls):
        super(ConfigIpsecESP, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(ConfigIpsecESP, cls).tearDownClass()

    def setUp(self):
        super(ConfigIpsecESP, self).setUp()

    def tearDown(self):
        super(ConfigIpsecESP, self).tearDown()

    def config_anti_replay(self, params):
        saf = VppEnum.vl_api_ipsec_sad_flags_t
        for p in params:
            p.flags |= saf.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY

    def config_network(self, params):
        self.net_objs = []
        self.tun_if = self.pg0
        self.tra_if = self.pg2
        self.logger.info(self.vapi.ppcli("show int addr"))

        self.tra_spd = VppIpsecSpd(self, self.tra_spd_id)
        self.tra_spd.add_vpp_config()
        self.net_objs.append(self.tra_spd)
        self.tun_spd = VppIpsecSpd(self, self.tun_spd_id)
        self.tun_spd.add_vpp_config()
        self.net_objs.append(self.tun_spd)

        b = VppIpsecSpdItfBinding(self, self.tun_spd,
                                  self.tun_if)
        b.add_vpp_config()
        self.net_objs.append(b)

        b = VppIpsecSpdItfBinding(self, self.tra_spd,
                                  self.tra_if)
        b.add_vpp_config()
        self.net_objs.append(b)

        for p in params:
            self.config_esp_tra(p)
            config_tra_params(p, self.encryption_type)
        for p in params:
            self.config_esp_tun(p)
            config_tun_params(p, self.encryption_type, self.tun_if)

        for p in params:
            d = DpoProto.DPO_PROTO_IP6 if p.is_ipv6 else DpoProto.DPO_PROTO_IP4
            r = VppIpRoute(self,  p.remote_tun_if_host, p.addr_len,
                           [VppRoutePath(self.tun_if.remote_addr[p.addr_type],
                                         0xffffffff,
                                         proto=d)])
            r.add_vpp_config()
            self.net_objs.append(r)

        self.logger.info(self.vapi.ppcli("show ipsec all"))

    def unconfig_network(self):
        for o in reversed(self.net_objs):
            o.remove_vpp_config()
        self.net_objs = []

    def config_esp_tun(self, params):
        addr_type = params.addr_type
        scapy_tun_sa_id = params.scapy_tun_sa_id
        scapy_tun_spi = params.scapy_tun_spi
        vpp_tun_sa_id = params.vpp_tun_sa_id
        vpp_tun_spi = params.vpp_tun_spi
        auth_algo_vpp_id = params.auth_algo_vpp_id
        auth_key = params.auth_key
        crypt_algo_vpp_id = params.crypt_algo_vpp_id
        crypt_key = params.crypt_key
        remote_tun_if_host = params.remote_tun_if_host
        addr_any = params.addr_any
        addr_bcast = params.addr_bcast
        e = VppEnum.vl_api_ipsec_spd_action_t
        flags = params.flags
        tun_flags = params.tun_flags
        salt = params.salt
        objs = []

        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],
                                      tun_flags=tun_flags,
                                      dscp=params.dscp,
                                      flags=flags,
                                      salt=salt,
                                      hop_limit=params.outer_hop_limit)
        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],
                                       tun_flags=tun_flags,
                                       dscp=params.dscp,
                                       flags=flags,
                                       salt=salt,
                                       hop_limit=params.outer_hop_limit)
        objs.append(params.tun_sa_in)
        objs.append(params.tun_sa_out)

        params.spd_policy_in_any = VppIpsecSpdEntry(self, self.tun_spd,
                                                    scapy_tun_sa_id,
                                                    addr_any, addr_bcast,
                                                    addr_any, addr_bcast,
                                                    socket.IPPROTO_ESP)
        params.spd_policy_out_any = VppIpsecSpdEntry(self, self.tun_spd,
                                                     scapy_tun_sa_id,
                                                     addr_any, addr_bcast,
                                                     addr_any, addr_bcast,
                                                     socket.IPPROTO_ESP,
                                                     is_outbound=0)
        objs.append(params.spd_policy_out_any)
        objs.append(params.spd_policy_in_any)

        objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id,
                                     remote_tun_if_host, remote_tun_if_host,
                                     self.pg1.remote_addr[addr_type],
                                     self.pg1.remote_addr[addr_type],
                                     0,
                                     priority=10,
                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                                     is_outbound=0))
        objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id,
                                     self.pg1.remote_addr[addr_type],
                                     self.pg1.remote_addr[addr_type],
                                     remote_tun_if_host, remote_tun_if_host,
                                     0,
                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                                     priority=10))
        objs.append(VppIpsecSpdEntry(self, self.tun_spd, vpp_tun_sa_id,
                                     remote_tun_if_host, remote_tun_if_host,
                                     self.pg0.local_addr[addr_type],
                                     self.pg0.local_addr[addr_type],
                                     0,
                                     priority=20,
                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                                     is_outbound=0))
        objs.append(VppIpsecSpdEntry(self, self.tun_spd, scapy_tun_sa_id,
                                     self.pg0.local_addr[addr_type],
                                     self.pg0.local_addr[addr_type],
                                     remote_tun_if_host, remote_tun_if_host,
                                     0,
                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                                     priority=20))
        for o in objs:
            o.add_vpp_config()
        self.net_objs = self.net_objs + objs

    def config_esp_tra(self, params):
        addr_type = params.addr_type
        scapy_tra_sa_id = params.scapy_tra_sa_id
        scapy_tra_spi = params.scapy_tra_spi
        vpp_tra_sa_id = params.vpp_tra_sa_id
        vpp_tra_spi = params.vpp_tra_spi
        auth_algo_vpp_id = params.auth_algo_vpp_id
        auth_key = params.auth_key
        crypt_algo_vpp_id = params.crypt_algo_vpp_id
        crypt_key = params.crypt_key
        addr_any = params.addr_any
        addr_bcast = params.addr_bcast
        e = VppEnum.vl_api_ipsec_spd_action_t
        flags = params.flags
        salt = params.salt
        objs = []

        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,
                                      salt=salt)
        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,
                                       salt=salt)
        objs.append(params.tra_sa_in)
        objs.append(params.tra_sa_out)

        objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id,
                                     addr_any, addr_bcast,
                                     addr_any, addr_bcast,
                                     socket.IPPROTO_ESP))
        objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id,
                                     addr_any, addr_bcast,
                                     addr_any, addr_bcast,
                                     socket.IPPROTO_ESP,
                                     is_outbound=0))
        objs.append(VppIpsecSpdEntry(self, self.tra_spd, vpp_tra_sa_id,
                                     self.tra_if.local_addr[addr_type],
                                     self.tra_if.local_addr[addr_type],
                                     self.tra_if.remote_addr[addr_type],
                                     self.tra_if.remote_addr[addr_type],
                                     0, priority=10,
                                     policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                                     is_outbound=0))
        objs.append(VppIpsecSpdEntry(self, self.tra_spd, scapy_tra_sa_id,
                                     self.tra_if.local_addr[addr_type],
                                     self.tra_if.local_addr[addr_type],
                                     self.tra_if.remote_addr[addr_type],
                                     self.tra_if.remote_addr[addr_type],
                                     0, policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                                     priority=10))
        for o in objs:
            o.add_vpp_config()
        self.net_objs = self.net_objs + objs


class TemplateIpsecEsp(ConfigIpsecESP):
    """
    Basic test for ipsec esp sanity - tunnel and transport modes.

    Below 4 cases are covered as part of this test

    #. ipsec esp v4 transport basic test  - IPv4 Transport mode
        scenario using HMAC-SHA1-96 integrity algo

    #. ipsec esp v4 transport burst test
        Above test for 257 pkts

    #. ipsec esp 4o4 tunnel basic test    - IPv4 Tunnel mode
        scenario using HMAC-SHA1-96 integrity algo

    #. ipsec esp 4o4 tunnel burst test
        Above test for 257 pkts

    TRANSPORT MODE::

         ---   encrypt   ---
        |pg2| <-------> |VPP|
         ---   decrypt   ---

    TUNNEL MODE::

         ---   encrypt   ---   plain   ---
        |pg0| <-------  |VPP| <------ |pg1|
         ---             ---           ---

         ---   decrypt   ---   plain   ---
        |pg0| ------->  |VPP| ------> |pg1|
         ---             ---           ---

    """

    @classmethod
    def setUpClass(cls):
        super(TemplateIpsecEsp, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(TemplateIpsecEsp, cls).tearDownClass()

    def setUp(self):
        super(TemplateIpsecEsp, self).setUp()
        self.config_anti_replay(self.params.values())
        self.config_network(self.params.values())

    def tearDown(self):
        self.unconfig_network()
        super(TemplateIpsecEsp, self).tearDown()


class TestIpsecEsp1(TemplateIpsecEsp, IpsecTra46Tests,
                    IpsecTun46Tests, IpsecTra6ExtTests):
    """ Ipsec ESP - TUN & TRA tests """

    @classmethod
    def setUpClass(cls):
        super(TestIpsecEsp1, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(TestIpsecEsp1, cls).tearDownClass()

    def setUp(self):
        super(TestIpsecEsp1, self).setUp()

    def tearDown(self):
        super(TestIpsecEsp1, self).tearDown()

    def test_tun_46(self):
        """ ipsec 4o6 tunnel """
        # add an SPD entry to direct 2.2.2.2 to the v6 tunnel SA
        p6 = self.ipv6_params
        p4 = self.ipv4_params

        p6.remote_tun_if_host4 = "2.2.2.2"
        e = VppEnum.vl_api_ipsec_spd_action_t

        VppIpsecSpdEntry(self,
                         self.tun_spd,
                         p6.scapy_tun_sa_id,
                         self.pg1.remote_addr[p4.addr_type],
                         self.pg1.remote_addr[p4.addr_type],
                         p6.remote_tun_if_host4,
                         p6.remote_tun_if_host4,
                         0,
                         priority=10,
                         policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                         is_outbound=1).add_vpp_config()
        VppIpRoute(self,  p6.remote_tun_if_host4, p4.addr_len,
                   [VppRoutePath(self.tun_if.remote_addr[p4.addr_type],
                                 0xffffffff)]).add_vpp_config()

        old_name = self.tun6_encrypt_node_name
        self.tun6_encrypt_node_name = "esp4-encrypt"

        self.verify_tun_46(p6, count=63)
        self.tun6_encrypt_node_name = old_name

    def test_tun_64(self):
        """ ipsec 6o4 tunnel """
        # add an SPD entry to direct 4444::4 to the v4 tunnel SA
        p6 = self.ipv6_params
        p4 = self.ipv4_params

        p4.remote_tun_if_host6 = "4444::4"
        e = VppEnum.vl_api_ipsec_spd_action_t

        VppIpsecSpdEntry(self,
                         self.tun_spd,
                         p4.scapy_tun_sa_id,
                         self.pg1.remote_addr[p6.addr_type],
                         self.pg1.remote_addr[p6.addr_type],
                         p4.remote_tun_if_host6,
                         p4.remote_tun_if_host6,
                         0,
                         priority=10,
                         policy=e.IPSEC_API_SPD_ACTION_PROTECT,
                         is_outbound=1).add_vpp_config()
        d = DpoProto.DPO_PROTO_IP6
        VppIpRoute(self,  p4.remote_tun_if_host6, p6.addr_len,
                   [VppRoutePath(self.tun_if.remote_addr[p6.addr_type],
                                 0xffffffff,
                                 proto=d)]).add_vpp_config()

        old_name = self.tun4_encrypt_node_name
        self.tun4_encrypt_node_name = "esp6-encrypt"
        self.verify_tun_64(p4, count=63)
        self.tun4_encrypt_node_name = old_name


class TestIpsecEspTun(TemplateIpsecEsp, IpsecTun46Tests):
    """ Ipsec ESP - TUN encap tests """

    def setUp(self):
        self.ipv4_params = IPsecIPv4Params()
        self.ipv6_params = IPsecIPv6Params()

        c = (VppEnum.vl_api_tunnel_encap_decap_flags_t.
             TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP)
        c1 = c | (VppEnum.vl_api_tunnel_encap_decap_flags_t.
                  TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_ECN)

        self.ipv4_params.tun_flags = c
        self.ipv6_params.tun_flags = c1

        super(TestIpsecEspTun, self).setUp()

    def gen_pkts(self, sw_intf, src, dst, count=1, payload_size=54):
        # set the DSCP + ECN - flags are set to copy only DSCP
        return [Ether(src=sw_intf.remote_mac, dst=sw_intf.local_mac) /
                IP(src=src, dst=dst, tos=5) /
                UDP(sport=4444, dport=4444) /
                Raw(b'X' * payload_size)
                for i in range(count)]

    def gen_pkts6(self, p, sw_intf, src, dst, count=1, payload_size=54):
        # set the DSCP + ECN - flags are set to copy both
        return [Ether(src=sw_intf.remote_mac, dst=sw_intf.local_mac) /
                IPv6(src=src, dst=dst, tc=5) /
                UDP(sport=4444, dport=4444) /
                Raw(b'X' * payload_size)
                for i in range(count)]

    def verify_encrypted(self, p, sa, rxs):
        # just check that only the DSCP is copied
        for rx in rxs:
            self.assertEqual(rx[IP].tos, 4)

    def verify_encrypted6(self, p, sa, rxs):
        # just check that the DSCP & ECN are copied
        for rx in rxs:
            self.assertEqual(rx[IPv6].tc, 5)


class TestIpsecEspTun2(TemplateIpsecEsp, IpsecTun46Tests):
    """ Ipsec ESP - TUN DSCP tests """

    def setUp(self):
        self.ipv4_params = IPsecIPv4Params()
        self.ipv6_params = IPsecIPv6Params()

        self.ipv4_params.dscp = VppEnum.vl_api_ip_dscp_t.IP_API_DSCP_EF
        self.ipv6_params.dscp = VppEnum.vl_api_ip_dscp_t.IP_API_DSCP_AF11

        super(TestIpsecEspTun2, self).setUp()

    def gen_pkts(self, sw_intf, src, dst, count=1, payload_size=54):
        return [Ether(src=sw_intf.remote_mac, dst=sw_intf.local_mac) /
                IP(src=src, dst=dst) /
                UDP(sport=4444, dport=4444) /
                Raw(b'X' * payload_size)
                for i in range(count)]

    def gen_pkts6(self, p, sw_intf, src, dst, count=1, payload_size=54):
        return [Ether(src=sw_intf.remote_mac, dst=sw_intf.local_mac) /
                IPv6(src=src, dst=dst) /
                UDP(sport=4444, dport=4444) /
                Raw(b'X' * payload_size)
                for i in range(count)]

    def verify_encrypted(self, p, sa, rxs):
        # just check that only the DSCP is set
        for rx in rxs:
            self.assertEqual(rx[IP].tos,
                             VppEnum.vl_api_ip_dscp_t.IP_API_DSCP_EF << 2)

    def verify_encrypted6(self, p, sa, rxs):
        # just check that the DSCP is set
        for rx in rxs:
            self.assertEqual(rx[IPv6].tc,
                             VppEnum.vl_api_ip_dscp_t.IP_API_DSCP_AF11 << 2)


class TestIpsecEsp2(TemplateIpsecEsp, IpsecTcpTests):
    """ Ipsec ESP - TCP tests """
    pass


class TestIpsecEspAsync(TemplateIpsecEsp):
    """ Ipsec ESP - Aysnc tests """

    vpp_worker_count = 2

    def setUp(self):
        super(TestIpsecEspAsync, self).setUp()

        self.p_sync = IPsecIPv4Params()

        self.p_sync.crypt_algo_vpp_id = (VppEnum.vl_api_ipsec_crypto_alg_t.
                                         IPSEC_API_CRYPTO_ALG_AES_CBC_256)
        self.p_sync.crypt_algo = 'AES-CBC'  # scapy name
        self.p_sync.crypt_key = b'JPjyOWBeVEQiMe7hJPjyOWBeVEQiMe7h'

        self.p_sync.scapy_tun_sa_id += 0xf0000
        self.p_sync.scapy_tun_spi += 0xf0000
        self.p_sync.vpp_tun_sa_id += 0xf0000
        self.p_sync.vpp_tun_spi += 0xf0000
        self.p_sync.remote_tun_if_host = "2.2.2.2"
        e = VppEnum.vl_api_ipsec_spd_action_t

        self.p_sync.sa = VppIpsecSA(
            self,
            self.p_sync.vpp_tun_sa_id,
            self.p_sync.vpp_tun_spi,
            self.p_sync.auth_algo_vpp_id,
            self.p_sync.auth_key,
            self.p_sync.crypt_algo_vpp_id,
            self.p_sync.crypt_key,
            self.vpp_esp_protocol,
            self.tun_if.local_addr[self.p_sync.addr_type],
            self.tun_if.remote_addr[self.p_sync.addr_type]).add_vpp_config()
        self.p_sync.spd = VppIpsecSpdEntry(
            self,
            self.tun_spd,
            self.p_sync.vpp_tun_sa_id,
            self.pg1.remote_addr[self.p_sync.addr_type],
            self.pg1.remote_addr[self.p_sync.addr_type],
            self.p_sync.remote_tun_if_host,
            self.p_sync.remote_tun_if_host,
            0,
            priority=1,
            policy=e.IPSEC_API_SPD_ACTION_PROTECT,
            is_outbound=1).add_vpp_config()
        VppIpRoute(self,
                   self.p_sync.remote_tun_if_host,
                   self.p_sync.addr_len,
                   [VppRoutePath(
                       self.tun_if.remote_addr[self.p_sync.addr_type],
                       0xffffffff)]).add_vpp_config()
        config_tun_params(self.p_sync, self.encryption_type, self.tun_if)

        self.p_async = IPsecIPv4Params()

        self.p_async.crypt_algo_vpp_id = (VppEnum.vl_api_ipsec_crypto_alg_t.
                                          IPSEC_API_CRYPTO_ALG_AES_GCM_256)
        self.p_async.auth_algo_vpp_id = (VppEnum.vl_api_ipsec_integ_alg_t.
                                         IPSEC_API_INTEG_ALG_NONE)
        self.p_async.crypt_algo = 'AES-GCM'  # scapy name
        self.p_async.crypt_key = b'JPjyOWBeVEQiMe7hJPjyOWBeVEQiMe7h'
        self.p_async.auth_algo = 'NULL'

        self.p_async.scapy_tun_sa_id += 0xe0000
        self.p_async.scapy_tun_spi += 0xe0000
        self.p_async.vpp_tun_sa_id += 0xe0000
        self.p_async.vpp_tun_spi += 0xe0000
        self.p_async.remote_tun_if_host = "2.2.2.3"

        iflags = VppEnum.vl_api_ipsec_sad_flags_t
        self.p_async.flags = (iflags.IPSEC_API_SAD_FLAG_USE_ESN |
                              iflags.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY |
                              iflags.IPSEC_API_SAD_FLAG_ASYNC)

        self.p_async.sa = VppIpsecSA(
            self,
            self.p_async.vpp_tun_sa_id,
            self.p_async.vpp_tun_spi,
            self.p_async.auth_algo_vpp_id,
            self.p_async.auth_key,
            self.p_async.crypt_algo_vpp_id,
            self.p_async.crypt_key,
            self.vpp_esp_protocol,
            self.tun_if.local_addr[self.p_async.addr_type],
            self.tun_if.remote_addr[self.p_async.addr_type],
            flags=self.p_async.flags).add_vpp_config()
        self.p_async.spd = VppIpsecSpdEntry(
            self,
            self.tun_spd,
            self.p_async.vpp_tun_sa_id,
            self.pg1.remote_addr[self.p_async.addr_type],
            self.pg1.remote_addr[self.p_async.addr_type],
            self.p_async.remote_tun_if_host,
            self.p_async.remote_tun_if_host,
            0,
            priority=2,
            policy=e.IPSEC_API_SPD_ACTION_PROTECT,
            is_outbound=1).add_vpp_config()
        VppIpRoute(self,
                   self.p_async.remote_tun_if_host,
                   self.p_async.addr_len,
                   [VppRoutePath(
                       self.tun_if.remote_addr[self.p_async.addr_type],
                       0xffffffff)]).add_vpp_config()
        config_tun_params(self.p_async, self.encryption_type, self.tun_if)

    def test_dual_stream(self):
        """ Alternating SAs """
        p = self.params[self.p_sync.addr_type]
        self.vapi.ipsec_set_async_mode(async_enable=True)

        pkts = [(Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac) /
                 IP(src=self.pg1.remote_ip4,
                    dst=self.p_sync.remote_tun_if_host) /
                 UDP(sport=4444, dport=4444) /
                 Raw(b'0x0' * 200)),
                (Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac) /
                 IP(src=self.pg1.remote_ip4,
                    dst=p.remote_tun_if_host) /
                 UDP(sport=4444, dport=4444) /
                 Raw(b'0x0' * 200))]
        pkts *= 1023

        rxs = self.send_and_expect(self.pg1, pkts, self.pg0)

        self.assertEqual(len(rxs), len(pkts))

        for rx in rxs:
            if rx[ESP].spi == p.scapy_tun_spi:
                decrypted = p.vpp_tun_sa.decrypt(rx[IP])
            elif rx[ESP].spi == self.p_sync.vpp_tun_spi:
                decrypted = self.p_sync.scapy_tun_sa.decrypt(rx[IP])
            else:
                rx.show()
                self.assertTrue(False)

        self.p_sync.spd.remove_vpp_config()
        self.p_sync.sa.remove_vpp_config()
        self.p_async.spd.remove_vpp_config()
        self.p_async.sa.remove_vpp_config()
        self.vapi.ipsec_set_async_mode(async_enable=False)

    def test_sync_async_noop_stream(self):
        """ Alternating SAs sync/async/noop """
        p = self.params[self.p_sync.addr_type]

        # first pin the default/noop SA to worker 0
        pkts = [(Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac) /
                 IP(src=self.pg1.remote_ip4,
                    dst=p.remote_tun_if_host) /
                 UDP(sport=4444, dport=4444) /
                 Raw(b'0x0' * 200))]
        rxs = self.send_and_expect(self.pg1, pkts, self.pg0, worker=0)

        self.logger.info(self.vapi.cli("sh ipsec sa"))
        self.logger.info(self.vapi.cli("sh crypto async status"))

        # then use all the other SAs on worker 1.
        # some will handoff, other take the sync and async paths
        pkts = [(Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac) /
                 IP(src=self.pg1.remote_ip4,
                    dst=self.p_sync.remote_tun_if_host) /
                 UDP(sport=4444, dport=4444) /
                 Raw(b'0x0' * 200)),
                (Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac) /
                 IP(src=self.pg1.remote_ip4,
                    dst=p.remote_tun_if_host) /
                 UDP(sport=4444, dport=4444) /
                 Raw(b'0x0' * 200)),
                (Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac) /
                 IP(src=self.pg1.remote_ip4,
                    dst=self.p_async.remote_tun_if_host) /
                 UDP(sport=4444, dport=4444) /
                 Raw(b'0x0' * 200))]
        pkts *= 1023

        rxs = self.send_and_expect(self.pg1, pkts, self.pg0, worker=1)

        self.assertEqual(len(rxs), len(pkts))

        for rx in rxs:
            if rx[ESP].spi == p.scapy_tun_spi:
                decrypted = p.vpp_tun_sa.decrypt(rx[IP])
            elif rx[ESP].spi == self.p_sync.vpp_tun_spi:
                decrypted = self.p_sync.scapy_tun_sa.decrypt(rx[IP])
            elif rx[ESP].spi == self.p_async.vpp_tun_spi:
                decrypted = self.p_async.scapy_tun_sa.decrypt(rx[IP])
            else:
                rx.show()
                self.assertTrue(False)

        self.p_sync.spd.remove_vpp_config()
        self.p_sync.sa.remove_vpp_config()
        self.p_async.spd.remove_vpp_config()
        self.p_async.sa.remove_vpp_config()

        # async mode should have been disabled now that there are
        # no async SAs. there's no API for this, so a reluctant
        # screen scrape.
        self.assertTrue("DISABLED" in self.vapi.cli("sh crypto async status"))


class TestIpsecEspHandoff(TemplateIpsecEsp,
                          IpsecTun6HandoffTests,
                          IpsecTun4HandoffTests):
    """ Ipsec ESP - handoff tests """
    pass


class TemplateIpsecEspUdp(ConfigIpsecESP):
    """
    UDP encapped ESP
    """

    @classmethod
    def setUpClass(cls):
        super(TemplateIpsecEspUdp, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(TemplateIpsecEspUdp, cls).tearDownClass()

    def setUp(self):
        super(TemplateIpsecEspUdp, self).setUp()
        self.net_objs = []
        self.tun_if = self.pg0
        self.tra_if = self.pg2
        self.logger.info(self.vapi.ppcli("show int addr"))

        p = self.ipv4_params
        p.flags = (VppEnum.vl_api_ipsec_sad_flags_t.
                   IPSEC_API_SAD_FLAG_UDP_ENCAP |
                   VppEnum.vl_api_ipsec_sad_flags_t.
                   IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY)
        p.nat_header = UDP(sport=5454, dport=4500)

        self.tra_spd = VppIpsecSpd(self, self.tra_spd_id)
        self.tra_spd.add_vpp_config()
        VppIpsecSpdItfBinding(self, self.tra_spd,
                              self.tra_if).add_vpp_config()

        self.config_esp_tra(p)
        config_tra_params(p, self.encryption_type)

        self.tun_spd = VppIpsecSpd(self, self.tun_spd_id)
        self.tun_spd.add_vpp_config()
        VppIpsecSpdItfBinding(self, self.tun_spd,
                              self.tun_if).add_vpp_config()

        self.config_esp_tun(p)
        self.logger.info(self.vapi.ppcli("show ipsec all"))

        d = DpoProto.DPO_PROTO_IP4
        VppIpRoute(self,  p.remote_tun_if_host, p.addr_len,
                   [VppRoutePath(self.tun_if.remote_addr[p.addr_type],
                                 0xffffffff,
                                 proto=d)]).add_vpp_config()

    def tearDown(self):
        super(TemplateIpsecEspUdp, self).tearDown()

    def show_commands_at_teardown(self):
        self.logger.info(self.vapi.cli("show hardware"))


class TestIpsecEspUdp(TemplateIpsecEspUdp, IpsecTra4Tests):
    """ Ipsec NAT-T ESP UDP tests """
    pass


class MyParameters():
    def __init__(self):
        saf = VppEnum.vl_api_ipsec_sad_flags_t
        flag_esn = saf.IPSEC_API_SAD_FLAG_USE_ESN
        flag_ar = saf.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY
        self.flags = [0, flag_esn, flag_ar]
        # foreach crypto algorithm
        self.algos = {
            'AES-GCM-128/NONE': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_GCM_128),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_NONE),
                  'scapy-crypto': "AES-GCM",
                  'scapy-integ': "NULL",
                  'key': b"JPjyOWBeVEQiMe7h",
                  'salt': 0},
            'AES-GCM-192/NONE': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_GCM_192),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_NONE),
                  'scapy-crypto': "AES-GCM",
                  'scapy-integ': "NULL",
                  'key': b"JPjyOWBeVEQiMe7h01234567",
                  'salt': 1010},
            'AES-GCM-256/NONE': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_GCM_256),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_NONE),
                  'scapy-crypto': "AES-GCM",
                  'scapy-integ': "NULL",
                  'key': b"JPjyOWBeVEQiMe7h0123456787654321",
                  'salt': 2020},
            'AES-CBC-128/MD5-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_CBC_128),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_MD5_96),
                  'scapy-crypto': "AES-CBC",
                  'scapy-integ': "HMAC-MD5-96",
                  'salt': 0,
                  'key': b"JPjyOWBeVEQiMe7h"},
            'AES-CBC-192/SHA1-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_CBC_192),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_SHA1_96),
                  'scapy-crypto': "AES-CBC",
                  'scapy-integ': "HMAC-SHA1-96",
                  'salt': 0,
                  'key': b"JPjyOWBeVEQiMe7hJPjyOWBe"},
            'AES-CBC-256/SHA1-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_CBC_256),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_SHA1_96),
                  'scapy-crypto': "AES-CBC",
                  'scapy-integ': "HMAC-SHA1-96",
                  'salt': 0,
                  'key': b"JPjyOWBeVEQiMe7hJPjyOWBeVEQiMe7h"},
            '3DES-CBC/SHA1-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_3DES_CBC),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_SHA1_96),
                  'scapy-crypto': "3DES",
                  'scapy-integ': "HMAC-SHA1-96",
                  'salt': 0,
                  'key': b"JPjyOWBeVEQiMe7h00112233"},
            'NONE/SHA1-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_NONE),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_SHA1_96),
                  'scapy-crypto': "NULL",
                  'scapy-integ': "HMAC-SHA1-96",
                  'salt': 0,
                  'key': b"JPjyOWBeVEQiMe7h00112233"},
            'AES-CTR-128/SHA1-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_CTR_128),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_SHA1_96),
                  'scapy-crypto': "AES-CTR",
                  'scapy-integ': "HMAC-SHA1-96",
                  'salt': 0,
                  'key': b"JPjyOWBeVEQiMe7h"},
            'AES-CTR-192/SHA1-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_CTR_192),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_SHA1_96),
                  'scapy-crypto': "AES-CTR",
                  'scapy-integ': "HMAC-SHA1-96",
                  'salt': 1010,
                  'key': b"JPjyOWBeVEQiMe7hJPjyOWBe"},
            'AES-CTR-256/SHA1-96': {
                  'vpp-crypto': (VppEnum.vl_api_ipsec_crypto_alg_t.
                                 IPSEC_API_CRYPTO_ALG_AES_CTR_256),
                  'vpp-integ': (VppEnum.vl_api_ipsec_integ_alg_t.
                                IPSEC_API_INTEG_ALG_SHA1_96),
                  'scapy-crypto': "AES-CTR",
                  'scapy-integ': "HMAC-SHA1-96",
                  'salt': 2020,
                  'key': b"JPjyOWBeVEQiMe7hJPjyOWBeVEQiMe7h"}}


class RunTestIpsecEspAll(ConfigIpsecESP,
                         IpsecTra4, IpsecTra6,
                         IpsecTun4, IpsecTun6):
    """ Ipsec ESP all Algos """

    @classmethod
    def setUpConstants(cls):
        test_args = str.split(cls.__doc__, " ")
        engine = test_args[0]
        if engine == "async":
            cls.vpp_worker_count = 2
        super(RunTestIpsecEspAll, cls).setUpConstants()

    def setUp(self):
        super(RunTestIpsecEspAll, self).setUp()
        test_args = str.split(self.__doc__, " ")

        params = MyParameters()
        self.engine = test_args[0]
        self.flag = params.flags[0]
        if test_args[1] == 'ESNon':
            self.flag |= params.flags[1]
        if test_args[2] == 'ARon':
            self.flag |= params.flags[2]

        self.algo = params.algos[test_args[3]]
        self.async_mode = False
        if self.engine == "async":
            self.async_mode = True

    def tearDown(self):
        super(RunTestIpsecEspAll, self).tearDown()

    def run_test(self):
        self.run_a_test(self.engine, self.flag, self.algo)

    def run_a_test(self, engine, flag, algo, payload_size=None):
        if self.async_mode:
            self.vapi.cli("set ipsec async mode on")
        else:
            self.vapi.cli("set crypto handler all %s" % engine)

        self.logger.info(self.vapi.cli("show crypto async status"))
        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-integ']
            p.crypt_algo_vpp_id = algo['vpp-crypto']
            p.crypt_algo = algo['scapy-crypto']
            p.auth_algo = algo['scapy-integ']
            p.crypt_key = algo['key']
            p.salt = algo['salt']
            p.flags = flag
            p.outer_flow_label = 243224
            p.async_mode = self.async_mode

        self.reporter.send_keep_alive(self)

        #
        # 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=NUM_PKTS)
        self.verify_tra_basic4(count=NUM_PKTS)
        self.verify_tun_66(self.params[socket.AF_INET6],
                           count=NUM_PKTS)
        #
        # Use an odd-byte payload size to check for correct padding.
        #
        # 49 + 2 == 51 which should pad +1 to 52 for 4 byte alignment, +5
        # to 56 for 8 byte alignment, and +13 to 64 for 64 byte alignment.
        # This should catch bugs where the code is incorrectly over-padding
        # for algorithms that don't require it
        psz = 49 - len(IP()/ICMP()) if payload_size is None else payload_size
        self.verify_tun_44(self.params[socket.AF_INET],
                           count=NUM_PKTS, payload_size=psz)

        LARGE_PKT_SZ = [
            1970,  # results in 2 chained buffers entering decrypt node
                   # but leaving as simple buffer due to ICV removal (tra4)
            2004,  # footer+ICV will be added to 2nd buffer (tun4)
            4010,  # ICV ends up splitted across 2 buffers in esp_decrypt
                   # for transport4; transport6 takes normal path
            4020,  # same as above but tra4 and tra6 are switched
        ]
        if self.engine in engines_supporting_chain_bufs:
            for sz in LARGE_PKT_SZ:
                self.verify_tra_basic4(count=NUM_PKTS, payload_size=sz)
                self.verify_tra_basic6(count=NUM_PKTS, payload_size=sz)
                self.verify_tun_66(self.params[socket.AF_INET6],
                                   count=NUM_PKTS, payload_size=sz)
                self.verify_tun_44(self.params[socket.AF_INET],
                                   count=NUM_PKTS, payload_size=sz)

        #
        # reconfigure the network and SA to run the
        # anti replay tests
        #
        saf = VppEnum.vl_api_ipsec_sad_flags_t
        if flag & saf.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY:
            self.unconfig_network()
            self.config_network(self.params.values())
            self.verify_tra_anti_replay()

        self.unconfig_network()
        self.config_network(self.params.values())
        self.verify_hi_seq_num()
        self.unconfig_network()
        self.config_network(self.params.values())
        self.verify_tra_lost()

        #
        # swap the handlers while SAs are up
        #
        self.unconfig_network()
        self.config_network(self.params.values())
        for e in engines:
            if e != engine:
                self.vapi.cli("set crypto handler all %s" % e)
                self.verify_tra_basic4(count=NUM_PKTS)

        self.unconfig_network()

#
# To generate test classes, do:
#   grep '# GEN' test_ipsec_esp.py | sed -e 's/# GEN //g' | bash
#
# GEN for ENG in native ipsecmb openssl; do \
# GEN   for ESN in ESNon ESNoff; do for AR in ARon ARoff; do \
# GEN   for ALG in AES-GCM-128/NONE \
# GEN     AES-GCM-192/NONE AES-GCM-256/NONE AES-CBC-128/MD5-96 \
# GEN     AES-CBC-192/SHA1-96 AES-CBC-256/SHA1-96 \
# GEN     3DES-CBC/SHA1-96 NONE/SHA1-96 \
# GEN     AES-CTR-128/SHA1-96 AES-CTR-192/SHA1-96 AES-CTR-256/SHA1-96; do \
# GEN      echo -en "\n\nclass "
# GEN      echo -e "Test_${ENG}_${ESN}_${AR}_${ALG}(RunTestIpsecEspAll):" |
# GEN             sed -e 's/-/_/g' -e 's#/#_#g' ;
# GEN      echo '    """'$ENG $ESN $AR $ALG IPSec test'"""' ;
# GEN      echo "    def test_ipsec(self):";
# GEN      echo '        """'$ENG $ESN $AR $ALG IPSec test'"""' ;
# GEN      echo "        self.run_test()";
# GEN done; done; done; done
#
# GEN   for ESN in ESNon ESNoff; do for AR in ARon ARoff; do \
# GEN   for ALG in \
# GEN     AES-GCM-128/NONE AES-GCM-192/NONE AES-GCM-256/NONE \
# GEN     AES-CBC-192/SHA1-96 AES-CBC-256/SHA1-96; do \
# GEN      echo -en "\n\nclass "
# GEN      echo -e "Test_async_${ESN}_${AR}_${ALG}(RunTestIpsecEspAll):" |
# GEN             sed -e 's/-/_/g' -e 's#/#_#g' ;
# GEN      echo '    """'async $ESN $AR $ALG IPSec test'"""' ;
# GEN      echo "    def test_ipsec(self):";
# GEN      echo '        """'async $ESN $AR $ALG IPSec test'"""' ;
# GEN      echo "        self.run_test()";
# GEN done; done; done;


class Test_native_ESNon_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """native ESNon ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """native ESNon ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """native ESNon ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """native ESNon ARon AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARon 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_NONE_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARon NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARon AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARon AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARon_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARon AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARon AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """native ESNon ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """native ESNon ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """native ESNon ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """native ESNon ARoff AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARoff 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_NONE_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARoff NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARoff AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARoff AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNon_ARoff_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNon ARoff AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNon ARoff AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """native ESNoff ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """native ESNoff ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """native ESNoff ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """native ESNoff ARon AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARon 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_NONE_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARon NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARon AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARon AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARon_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARon AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARon AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARoff 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_NONE_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARoff NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_native_ESNoff_ARoff_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """native ESNoff ARoff AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """native ESNoff ARoff AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_NONE_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARon_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARon AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARon AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_NONE_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNon_ARoff_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNon ARoff AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNon ARoff AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_NONE_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARon_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARon AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARon AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_NONE_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_ipsecmb_ESNoff_ARoff_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """ipsecmb ESNoff ARoff AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """ipsecmb ESNoff ARoff AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARon 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_NONE_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARon NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARon_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARon AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARon AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_NONE_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNon_ARoff_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNon ARoff AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNon ARoff AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_NONE_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARon_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARon AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARon AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_CBC_128_MD5_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-CBC-128/MD5-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-CBC-128/MD5-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_3DES_CBC_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff 3DES-CBC/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff 3DES-CBC/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_NONE_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff NONE/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff NONE/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_CTR_128_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-CTR-128/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-CTR-128/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_CTR_192_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-CTR-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-CTR-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_openssl_ESNoff_ARoff_AES_CTR_256_SHA1_96(RunTestIpsecEspAll):
    """openssl ESNoff ARoff AES-CTR-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """openssl ESNoff ARoff AES-CTR-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNon_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """async ESNon ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNon ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_async_ESNon_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """async ESNon ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNon ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_async_ESNon_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """async ESNon ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNon ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_async_ESNon_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """async ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNon ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNon_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """async ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNon ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNon_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """async ESNon ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNon ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_async_ESNon_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """async ESNon ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNon ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_async_ESNon_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """async ESNon ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNon ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_async_ESNon_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """async ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNon ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNon_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """async ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNon ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARon_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """async ESNoff ARon AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARon AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARon_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """async ESNoff ARon AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARon AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARon_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """async ESNoff ARon AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARon AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARon_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """async ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARon AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARon_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """async ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARon AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARoff_AES_GCM_128_NONE(RunTestIpsecEspAll):
    """async ESNoff ARoff AES-GCM-128/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARoff AES-GCM-128/NONE IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARoff_AES_GCM_192_NONE(RunTestIpsecEspAll):
    """async ESNoff ARoff AES-GCM-192/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARoff AES-GCM-192/NONE IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARoff_AES_GCM_256_NONE(RunTestIpsecEspAll):
    """async ESNoff ARoff AES-GCM-256/NONE IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARoff AES-GCM-256/NONE IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARoff_AES_CBC_192_SHA1_96(RunTestIpsecEspAll):
    """async ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARoff AES-CBC-192/SHA1-96 IPSec test"""
        self.run_test()


class Test_async_ESNoff_ARoff_AES_CBC_256_SHA1_96(RunTestIpsecEspAll):
    """async ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
    def test_ipsec(self):
        """async ESNoff ARoff AES-CBC-256/SHA1-96 IPSec test"""
        self.run_test()