tests: tag the tests that do not work with multi-worker configuration
[vpp.git] / test / test_punt.py
index 8ebf447..c6d6dbc 100644 (file)
@@ -26,12 +26,13 @@ from scapy.layers.ipsec import ESP
 import scapy.layers.inet6 as inet6
 from scapy.layers.inet6 import IPv6, ICMPv6DestUnreach
 from scapy.contrib.ospf import OSPF_Hdr, OSPFv3_Hello
+from framework import tag_fixme_vpp_workers
 from framework import VppTestCase, VppTestRunner
 
 from vpp_ip import DpoProto
 from vpp_ip_route import VppIpRoute, VppRoutePath
+from vpp_ipsec import VppIpsecSA, VppIpsecTunProtect, VppIpsecInterface
 from vpp_papi import VppEnum
-from vpp_ipsec_tun_interface import VppIpsecTunInterface
 
 NUM_PKTS = 67
 
@@ -795,15 +796,12 @@ class TestExceptionPuntSocket(TestPuntSocket):
 
         #
         # we're dealing with IPSec tunnels punting for no-such-tunnel
-        # adn SPI=0
+        # (SPI=0 goes to ikev2)
         #
         cfgs = dict()
         cfgs['ipsec4-no-such-tunnel'] = {'spi': 99,
                                          'udp': False,
                                          'itf': self.pg0}
-        cfgs['ipsec4-spi-o-udp-0'] = {'spi': 0,
-                                      'udp': True,
-                                      'itf': self.pg1}
 
         #
         # find the VPP ID for these punt exception reasin
@@ -811,6 +809,8 @@ class TestExceptionPuntSocket(TestPuntSocket):
         rs = self.vapi.punt_reason_dump()
         for key in cfgs:
             for r in rs:
+                print(r.reason.name)
+                print(key)
                 if r.reason.name == key:
                     cfgs[key]['id'] = r.reason.id
                     cfgs[key]['vpp'] = copy.deepcopy(
@@ -858,25 +858,30 @@ class TestExceptionPuntSocket(TestPuntSocket):
         #
         # add some tunnels, make sure it still punts
         #
-        VppIpsecTunInterface(self, self.pg0, 1000, 1000,
-                             (VppEnum.vl_api_ipsec_crypto_alg_t.
-                              IPSEC_API_CRYPTO_ALG_AES_CBC_128),
-                             b"0123456701234567",
-                             b"0123456701234567",
-                             (VppEnum.vl_api_ipsec_integ_alg_t.
-                              IPSEC_API_INTEG_ALG_SHA1_96),
-                             b"0123456701234567",
-                             b"0123456701234567").add_vpp_config()
-        VppIpsecTunInterface(self, self.pg1, 1000, 1000,
-                             (VppEnum.vl_api_ipsec_crypto_alg_t.
-                              IPSEC_API_CRYPTO_ALG_AES_CBC_128),
-                             b"0123456701234567",
-                             b"0123456701234567",
-                             (VppEnum.vl_api_ipsec_integ_alg_t.
-                              IPSEC_API_INTEG_ALG_SHA1_96),
-                             b"0123456701234567",
-                             b"0123456701234567",
-                             udp_encap=True).add_vpp_config()
+        tun = VppIpsecInterface(self).add_vpp_config()
+        sa_in = VppIpsecSA(self, 11, 11,
+                           (VppEnum.vl_api_ipsec_integ_alg_t.
+                            IPSEC_API_INTEG_ALG_SHA1_96),
+                           b"0123456701234567",
+                           (VppEnum.vl_api_ipsec_crypto_alg_t.
+                            IPSEC_API_CRYPTO_ALG_AES_CBC_128),
+                           b"0123456701234567",
+                           50,
+                           self.pg0.local_ip4,
+                           self.pg0.remote_ip4).add_vpp_config()
+        sa_out = VppIpsecSA(self, 22, 22,
+                            (VppEnum.vl_api_ipsec_integ_alg_t.
+                             IPSEC_API_INTEG_ALG_SHA1_96),
+                            b"0123456701234567",
+                            (VppEnum.vl_api_ipsec_crypto_alg_t.
+                             IPSEC_API_CRYPTO_ALG_AES_CBC_128),
+                            b"0123456701234567",
+                            50,
+                            self.pg0.local_ip4,
+                            self.pg0.remote_ip4).add_vpp_config()
+        protect = VppIpsecTunProtect(self, tun,
+                                     sa_out,
+                                     [sa_in]).add_vpp_config()
 
         #
         # send packets for each SPI we expect to be punted
@@ -1042,6 +1047,7 @@ class TestIpProtoPuntSocket(TestPuntSocket):
         self.vapi.punt_socket_deregister(punt_ospf)
 
 
+@tag_fixme_vpp_workers
 class TestPunt(VppTestCase):
     """ Exception Punt Test Case """