tests: Use errno value rather than a specific int
[vpp.git] / test / asf / test_vcl.py
index eaca105..a1113b8 100644 (file)
@@ -7,8 +7,8 @@ import subprocess
 import signal
 import glob
 from config import config
-from asfframework import VppTestCase, VppTestRunner, Worker
-from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, FibPathProto
+from asfframework import VppAsfTestCase, VppTestRunner, Worker
+from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
 
 iperf3 = "/usr/bin/iperf3"
 
@@ -58,7 +58,7 @@ class VCLAppWorker(Worker):
         super(VCLAppWorker, self).__init__(self.args, logger, env, *args, **kwargs)
 
 
-class VCLTestCase(VppTestCase):
+class VCLTestCase(VppAsfTestCase):
     """VCL Test Class"""
 
     session_startup = ["poll-main"]
@@ -67,7 +67,7 @@ class VCLTestCase(VppTestCase):
     def setUpClass(cls):
         if cls.session_startup:
             conf = "session {" + " ".join(cls.session_startup) + "}"
-            cls.extra_vpp_punt_config = [conf]
+            cls.extra_vpp_config = [conf]
         super(VCLTestCase, cls).setUpClass()
 
     @classmethod
@@ -84,7 +84,7 @@ class VCLTestCase(VppTestCase):
         self.timeout = 20
         self.echo_phrase = "Hello, world! Jenny is a friend of mine."
         self.pre_test_sleep = 0.3
-        self.post_test_sleep = 0.2
+        self.post_test_sleep = 1
         self.sapi_client_sock = ""
         self.sapi_server_sock = ""
 
@@ -162,10 +162,10 @@ class VCLTestCase(VppTestCase):
             table_id += 1
 
         # Configure namespaces
-        self.vapi.app_namespace_add_del(
+        self.vapi.app_namespace_add_del_v4(
             namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
         )
-        self.vapi.app_namespace_add_del(
+        self.vapi.app_namespace_add_del_v4(
             namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
         )
 
@@ -212,10 +212,10 @@ class VCLTestCase(VppTestCase):
             table_id += 1
 
         # Configure namespaces
-        self.vapi.app_namespace_add_del(
+        self.vapi.app_namespace_add_del_v4(
             namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
         )
-        self.vapi.app_namespace_add_del(
+        self.vapi.app_namespace_add_del_v4(
             namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
         )
 
@@ -594,6 +594,28 @@ class VCLThruHostStackTLS(VCLTestCase):
         self.logger.debug(self.vapi.cli("show app mq"))
 
 
+class VCLThruHostStackEchoInterruptMode(VCLThruHostStackEcho):
+    """VCL Thru Host Stack Echo interrupt mode"""
+
+    @classmethod
+    def setUpClass(cls):
+        cls.session_startup = ["use-private-rx-mqs", "use-app-socket-api"]
+        super(VCLThruHostStackEcho, cls).setUpClass()
+
+    def test_vcl_thru_host_stack_echo(self):
+        """run VCL IPv4 thru host stack echo test interrupt mode"""
+
+        self.sapi_server_sock = "1"
+        self.sapi_client_sock = "2"
+
+        self.thru_host_stack_test(
+            "vcl_test_server",
+            self.server_args,
+            "vcl_test_client",
+            self.client_echo_test_args,
+        )
+
+
 class VCLThruHostStackTLSInterruptMode(VCLThruHostStackTLS):
     """VCL Thru Host Stack TLS interrupt mode"""
 
@@ -974,6 +996,7 @@ class LDPThruHostStackIperfUdp(VCLTestCase):
             "-t 2",
             "-u",
             "-l 1400",
+            "-P 2",
             "-c",
             self.loop0.local_ip4,
         ]