blob: 11b77aeb0cce62d46e516a8ac3e9d1a98e7e59bd [file] [log] [blame]
Renato Botelho do Coutoead1e532019-10-31 13:31:07 -05001#!/usr/bin/env python3
Dave Wallacecfcf2f42018-02-16 18:31:56 -05002""" Vpp VCL tests """
3
4import unittest
5import os
Dave Wallace816833f2018-03-14 20:01:28 -04006import subprocess
Dave Wallacecfcf2f42018-02-16 18:31:56 -05007import signal
Damjan Marion5546e432021-09-30 20:04:14 +02008import glob
Klement Sekerab23ffd72021-05-31 16:08:53 +02009from config import config
Dave Wallace8800f732023-08-31 00:47:44 -040010from asfframework import VppAsfTestCase, VppTestRunner, Worker
11from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
Dave Wallacecfcf2f42018-02-16 18:31:56 -050012
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020013iperf3 = "/usr/bin/iperf3"
Paul Vinciguerra063366e2019-06-30 15:38:55 -040014
15
16def have_app(app):
17 try:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020018 subprocess.check_output([app, "-v"])
Paul Vinciguerra063366e2019-06-30 15:38:55 -040019 except (subprocess.CalledProcessError, OSError):
20 return False
21 return True
22
23
24_have_iperf3 = have_app(iperf3)
Paul Vinciguerra063366e2019-06-30 15:38:55 -040025
Dave Wallacecfcf2f42018-02-16 18:31:56 -050026
Dave Wallace816833f2018-03-14 20:01:28 -040027class VCLAppWorker(Worker):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020028 """VCL Test Application Worker"""
Dave Wallace42996c02018-02-26 14:40:13 -050029
Damjan Marion5546e432021-09-30 20:04:14 +020030 libname = "libvcl_ldpreload.so"
31
32 class LibraryNotFound(Exception):
33 pass
34
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020035 def __init__(
36 self, appname, executable_args, logger, env=None, role=None, *args, **kwargs
37 ):
Dave Wallace4ee17d82021-05-20 14:01:51 -040038 self.role = role
Klement Sekerab23ffd72021-05-31 16:08:53 +020039 vcl_ldpreload_glob = f"{config.vpp_install_dir}/**/{self.libname}"
Damjan Marion5546e432021-09-30 20:04:14 +020040 vcl_ldpreload_so = glob.glob(vcl_ldpreload_glob, recursive=True)
41
42 if len(vcl_ldpreload_so) < 1:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020043 raise LibraryNotFound("cannot locate library: {}".format(self.libname))
Damjan Marion5546e432021-09-30 20:04:14 +020044
45 vcl_ldpreload_so = vcl_ldpreload_so[0]
46
Paul Vinciguerra48bdbcd2019-12-04 19:43:53 -050047 if env is None:
48 env = {}
Dave Wallace816833f2018-03-14 20:01:28 -040049 if "iperf" in appname:
50 app = appname
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020051 env.update({"LD_PRELOAD": vcl_ldpreload_so})
Florin Corasab2f6db2018-08-31 14:31:41 -070052 elif "sock" in appname:
Klement Sekerab23ffd72021-05-31 16:08:53 +020053 app = f"{config.vpp_build_dir}/vpp/bin/{appname}"
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020054 env.update({"LD_PRELOAD": vcl_ldpreload_so})
Dave Wallace816833f2018-03-14 20:01:28 -040055 else:
Klement Sekerab23ffd72021-05-31 16:08:53 +020056 app = f"{config.vpp_build_dir}/vpp/bin/{appname}"
Paul Vinciguerra48bdbcd2019-12-04 19:43:53 -050057 self.args = [app] + executable_args
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020058 super(VCLAppWorker, self).__init__(self.args, logger, env, *args, **kwargs)
Dave Wallace42996c02018-02-26 14:40:13 -050059
60
Dave Wallace8800f732023-08-31 00:47:44 -040061class VCLTestCase(VppAsfTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020062 """VCL Test Class"""
63
Florin Coras4c45d6f2021-08-12 08:38:02 -070064 session_startup = ["poll-main"]
Dave Wallace42996c02018-02-26 14:40:13 -050065
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080066 @classmethod
67 def setUpClass(cls):
Florin Coras4c45d6f2021-08-12 08:38:02 -070068 if cls.session_startup:
69 conf = "session {" + " ".join(cls.session_startup) + "}"
Klement Sekerad3e0d102023-01-26 12:35:35 +010070 cls.extra_vpp_config = [conf]
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080071 super(VCLTestCase, cls).setUpClass()
72
73 @classmethod
74 def tearDownClass(cls):
75 super(VCLTestCase, cls).tearDownClass()
76
77 def setUp(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020078 self.vppDebug = "vpp_debug" in config.vpp_install_dir
Dave Wallace9f11c012018-02-28 17:55:23 -050079 self.server_addr = "127.0.0.1"
80 self.server_port = "22000"
Dave Wallace816833f2018-03-14 20:01:28 -040081 self.server_args = [self.server_port]
Dave Wallacede910062018-03-20 09:22:13 -040082 self.server_ipv6_addr = "::1"
83 self.server_ipv6_args = ["-6", self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -080084 self.timeout = 20
Dave Wallace9f11c012018-02-28 17:55:23 -050085 self.echo_phrase = "Hello, world! Jenny is a friend of mine."
Florin Corasdc2e2512018-12-03 17:47:26 -080086 self.pre_test_sleep = 0.3
Dave Wallace8800f732023-08-31 00:47:44 -040087 self.post_test_sleep = 1
Florin Coras4c45d6f2021-08-12 08:38:02 -070088 self.sapi_client_sock = ""
89 self.sapi_server_sock = ""
Florin Corasdc2e2512018-12-03 17:47:26 -080090
91 if os.path.isfile("/tmp/ldp_server_af_unix_socket"):
92 os.remove("/tmp/ldp_server_af_unix_socket")
Dave Wallace42996c02018-02-26 14:40:13 -050093
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080094 super(VCLTestCase, self).setUp()
Dave Wallace42996c02018-02-26 14:40:13 -050095
Florin Coras4c45d6f2021-08-12 08:38:02 -070096 def update_vcl_app_env(self, ns_id, ns_secret, attach_sock):
97 if not ns_id:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020098 if "VCL_APP_NAMESPACE_ID" in self.vcl_app_env:
99 del self.vcl_app_env["VCL_APP_NAMESPACE_ID"]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700100 else:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200101 self.vcl_app_env["VCL_APP_NAMESPACE_ID"] = ns_id
Florin Coras4c45d6f2021-08-12 08:38:02 -0700102
103 if not ns_secret:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200104 if "VCL_APP_NAMESPACE_SECRET" in self.vcl_app_env:
105 del self.vcl_app_env["VCL_APP_NAMESPACE_SECRET"]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700106 else:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200107 self.vcl_app_env["VCL_APP_NAMESPACE_SECRET"] = ns_secret
Florin Coras4c45d6f2021-08-12 08:38:02 -0700108
109 if not attach_sock:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200110 self.vcl_app_env["VCL_VPP_API_SOCKET"] = self.get_api_sock_path()
111 if "VCL_VPP_SAPI_SOCKET" in self.vcl_app_env:
112 del self.vcl_app_env["VCL_VPP_SAPI_SOCKET"]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700113 else:
114 sapi_sock = "%s/app_ns_sockets/%s" % (self.tempdir, attach_sock)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200115 self.vcl_app_env["VCL_VPP_SAPI_SOCKET"] = sapi_sock
116 if "VCL_VPP_API_SOCKET" in self.vcl_app_env:
117 del self.vcl_app_env["VCL_VPP_API_SOCKET"]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700118
Dave Wallace9f11c012018-02-28 17:55:23 -0500119 def cut_thru_setup(self):
Jakub Grajciar6a2794e2020-11-24 11:22:01 +0100120 self.vapi.session_enable_disable(is_enable=1)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500121
Dave Wallace9f11c012018-02-28 17:55:23 -0500122 def cut_thru_tear_down(self):
Jakub Grajciar6a2794e2020-11-24 11:22:01 +0100123 self.vapi.session_enable_disable(is_enable=0)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500124
Dave Wallace816833f2018-03-14 20:01:28 -0400125 def cut_thru_test(self, server_app, server_args, client_app, client_args):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200126 self.vcl_app_env = {"VCL_APP_SCOPE_LOCAL": "true"}
Florin Coras4c45d6f2021-08-12 08:38:02 -0700127
128 self.update_vcl_app_env("", "", self.sapi_server_sock)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200129 worker_server = VCLAppWorker(
130 server_app, server_args, self.logger, self.vcl_app_env, "server"
131 )
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500132 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800133 self.sleep(self.pre_test_sleep)
Florin Coras4c45d6f2021-08-12 08:38:02 -0700134
135 self.update_vcl_app_env("", "", self.sapi_client_sock)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200136 worker_client = VCLAppWorker(
137 client_app, client_args, self.logger, self.vcl_app_env, "client"
138 )
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500139 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500140 worker_client.join(self.timeout)
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500141 try:
142 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200143 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500144 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800145 self.sleep(self.post_test_sleep)
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500146
Dave Wallace9f11c012018-02-28 17:55:23 -0500147 def thru_host_stack_setup(self):
Jakub Grajciar6a2794e2020-11-24 11:22:01 +0100148 self.vapi.session_enable_disable(is_enable=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200149 self.create_loopback_interfaces(2)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500150
Florin Coras56b39f62018-03-27 17:29:32 -0700151 table_id = 1
Dave Wallacea67a03e2018-02-20 12:39:37 -0500152
153 for i in self.lo_interfaces:
154 i.admin_up()
155
156 if table_id != 0:
157 tbl = VppIpTable(self, table_id)
158 tbl.add_vpp_config()
159
160 i.set_table_ip4(table_id)
161 i.config_ip4()
162 table_id += 1
163
164 # Configure namespaces
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200165 self.vapi.app_namespace_add_del_v4(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200166 namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
167 )
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200168 self.vapi.app_namespace_add_del_v4(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200169 namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
170 )
Dave Wallacea67a03e2018-02-20 12:39:37 -0500171
Dave Wallacea67a03e2018-02-20 12:39:37 -0500172 # Add inter-table routes
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200173 ip_t01 = VppIpRoute(
174 self,
175 self.loop1.local_ip4,
176 32,
177 [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=2)],
178 table_id=1,
179 )
180 ip_t10 = VppIpRoute(
181 self,
182 self.loop0.local_ip4,
183 32,
184 [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=1)],
185 table_id=2,
186 )
Dave Wallacea67a03e2018-02-20 12:39:37 -0500187 ip_t01.add_vpp_config()
188 ip_t10.add_vpp_config()
Florin Coras56b39f62018-03-27 17:29:32 -0700189 self.logger.debug(self.vapi.cli("show ip fib"))
Dave Wallacea67a03e2018-02-20 12:39:37 -0500190
Dave Wallace9f11c012018-02-28 17:55:23 -0500191 def thru_host_stack_tear_down(self):
Steven Luong67bae202024-07-08 11:21:23 -0700192 self.vapi.app_namespace_add_del_v4(
193 is_add=0, namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
194 )
195 self.vapi.app_namespace_add_del_v4(
196 is_add=0, namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
197 )
Dave Wallace9f11c012018-02-28 17:55:23 -0500198 for i in self.lo_interfaces:
199 i.unconfig_ip4()
200 i.set_table_ip4(0)
201 i.admin_down()
Liangxing Wang22112772022-05-13 04:24:19 +0000202 i.remove_vpp_config()
Dave Wallace9f11c012018-02-28 17:55:23 -0500203
Dave Wallacede910062018-03-20 09:22:13 -0400204 def thru_host_stack_ipv6_setup(self):
Jakub Grajciar6a2794e2020-11-24 11:22:01 +0100205 self.vapi.session_enable_disable(is_enable=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200206 self.create_loopback_interfaces(2)
Dave Wallacede910062018-03-20 09:22:13 -0400207
208 table_id = 1
209
210 for i in self.lo_interfaces:
211 i.admin_up()
212
213 tbl = VppIpTable(self, table_id, is_ip6=1)
214 tbl.add_vpp_config()
215
216 i.set_table_ip6(table_id)
217 i.config_ip6()
218 table_id += 1
219
220 # Configure namespaces
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200221 self.vapi.app_namespace_add_del_v4(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200222 namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
223 )
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200224 self.vapi.app_namespace_add_del_v4(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200225 namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
226 )
Dave Wallacede910062018-03-20 09:22:13 -0400227
228 # Add inter-table routes
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200229 ip_t01 = VppIpRoute(
230 self,
231 self.loop1.local_ip6,
232 128,
233 [VppRoutePath("::0", 0xFFFFFFFF, nh_table_id=2)],
234 table_id=1,
235 )
236 ip_t10 = VppIpRoute(
237 self,
238 self.loop0.local_ip6,
239 128,
240 [VppRoutePath("::0", 0xFFFFFFFF, nh_table_id=1)],
241 table_id=2,
242 )
Dave Wallacede910062018-03-20 09:22:13 -0400243 ip_t01.add_vpp_config()
244 ip_t10.add_vpp_config()
245 self.logger.debug(self.vapi.cli("show interface addr"))
246 self.logger.debug(self.vapi.cli("show ip6 fib"))
247
248 def thru_host_stack_ipv6_tear_down(self):
Steven Luong67bae202024-07-08 11:21:23 -0700249 self.vapi.app_namespace_add_del_v4(
250 is_add=0, namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
251 )
252 self.vapi.app_namespace_add_del_v4(
253 is_add=0, namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
254 )
Dave Wallacede910062018-03-20 09:22:13 -0400255 for i in self.lo_interfaces:
256 i.unconfig_ip6()
257 i.set_table_ip6(0)
258 i.admin_down()
259
Jakub Grajciar6a2794e2020-11-24 11:22:01 +0100260 self.vapi.session_enable_disable(is_enable=0)
Dave Wallacede910062018-03-20 09:22:13 -0400261
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400262 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200263 def thru_host_stack_test(self, server_app, server_args, client_app, client_args):
264 self.vcl_app_env = {"VCL_APP_SCOPE_GLOBAL": "true"}
Dave Wallace9f11c012018-02-28 17:55:23 -0500265
Florin Coras4c45d6f2021-08-12 08:38:02 -0700266 self.update_vcl_app_env("1", "1234", self.sapi_server_sock)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200267 worker_server = VCLAppWorker(
268 server_app, server_args, self.logger, self.vcl_app_env, "server"
269 )
Dave Wallacea67a03e2018-02-20 12:39:37 -0500270 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800271 self.sleep(self.pre_test_sleep)
Dave Wallace42996c02018-02-26 14:40:13 -0500272
Florin Coras4c45d6f2021-08-12 08:38:02 -0700273 self.update_vcl_app_env("2", "5678", self.sapi_client_sock)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200274 worker_client = VCLAppWorker(
275 client_app, client_args, self.logger, self.vcl_app_env, "client"
276 )
Dave Wallacea67a03e2018-02-20 12:39:37 -0500277 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500278 worker_client.join(self.timeout)
279
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500280 try:
281 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200282 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500283 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800284 self.sleep(self.post_test_sleep)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500285
Dave Wallace9f11c012018-02-28 17:55:23 -0500286 def validateResults(self, worker_client, worker_server, timeout):
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400287 if worker_server.process is None:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200288 raise RuntimeError("worker_server is not running.")
289 if os.path.isdir("/proc/{}".format(worker_server.process.pid)):
290 self.logger.info(
291 "Killing server worker process (pid %d)" % worker_server.process.pid
292 )
Dave Barachad646872019-05-06 10:49:41 -0400293 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM)
Dave Wallaced85075e2018-03-02 13:19:30 -0500294 worker_server.join()
Dave Wallace9f11c012018-02-28 17:55:23 -0500295 self.logger.info("Client worker result is `%s'" % worker_client.result)
296 error = False
297 if worker_client.result is None:
298 try:
299 error = True
300 self.logger.error(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200301 "Timeout: %ss! Killing client worker process (pid %d)"
302 % (timeout, worker_client.process.pid)
303 )
304 os.killpg(os.getpgid(worker_client.process.pid), signal.SIGKILL)
Dave Wallace9f11c012018-02-28 17:55:23 -0500305 worker_client.join()
Dave Wallace07c0a9d2019-05-13 19:21:24 -0400306 except OSError:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200307 self.logger.debug("Couldn't kill client worker process")
Dave Wallace9f11c012018-02-28 17:55:23 -0500308 raise
309 if error:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200310 raise RuntimeError("Timeout! Client worker did not finish in %ss" % timeout)
Dave Wallace9f11c012018-02-28 17:55:23 -0500311 self.assert_equal(worker_client.result, 0, "Binary test return code")
312
313
Florin Coras0ae445e2018-11-29 18:22:10 -0800314class LDPCutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200315 """LDP Cut Thru Tests"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500316
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800317 @classmethod
318 def setUpClass(cls):
Florin Coras4c45d6f2021-08-12 08:38:02 -0700319 cls.session_startup = ["poll-main", "use-app-socket-api"]
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800320 super(LDPCutThruTestCase, cls).setUpClass()
321
322 @classmethod
323 def tearDownClass(cls):
324 super(LDPCutThruTestCase, cls).tearDownClass()
325
Dave Wallace9f11c012018-02-28 17:55:23 -0500326 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800327 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500328
329 self.cut_thru_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200330 self.client_echo_test_args = [
331 "-E",
332 self.echo_phrase,
333 "-X",
334 self.server_addr,
335 self.server_port,
336 ]
Dave Wallace816833f2018-03-14 20:01:28 -0400337 self.client_iperf3_timeout = 20
Florin Coras1d879142021-05-06 00:08:18 -0700338 self.client_iperf3_args = ["-4", "-t 2", "-c", self.server_addr]
339 self.server_iperf3_args = ["-4", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800340 self.client_uni_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200341 self.client_uni_dir_nsock_test_args = [
342 "-N",
343 "1000",
344 "-U",
345 "-X",
346 "-I",
347 "2",
348 self.server_addr,
349 self.server_port,
350 ]
Florin Coras2eb42e72018-11-29 00:39:53 -0800351 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200352 self.client_bi_dir_nsock_test_args = [
353 "-N",
354 "1000",
355 "-B",
356 "-X",
357 "-I",
358 "2",
359 self.server_addr,
360 self.server_port,
361 ]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700362 self.sapi_client_sock = "default"
363 self.sapi_server_sock = "default"
Dave Wallace9f11c012018-02-28 17:55:23 -0500364
365 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800366 super(LDPCutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400367 self.cut_thru_tear_down()
Dave Wallace9f11c012018-02-28 17:55:23 -0500368
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700369 def show_commands_at_teardown(self):
370 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800371 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700372
Klement Sekerab23ffd72021-05-31 16:08:53 +0200373 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500374 def test_ldp_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200375 """run LDP cut thru echo test"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500376
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200377 self.cut_thru_test(
378 "sock_test_server",
379 self.server_args,
380 "sock_test_client",
381 self.client_echo_test_args,
382 )
Dave Wallace816833f2018-03-14 20:01:28 -0400383
384 def test_ldp_cut_thru_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200385 """run LDP cut thru iperf3 test"""
Dave Wallace816833f2018-03-14 20:01:28 -0400386
Dave Wallace816833f2018-03-14 20:01:28 -0400387 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200388 self.cut_thru_test(
389 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
390 )
Dave Wallace9f11c012018-02-28 17:55:23 -0500391
Klement Sekerab23ffd72021-05-31 16:08:53 +0200392 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500393 def test_ldp_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200394 """run LDP cut thru uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500395
396 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200397 self.cut_thru_test(
398 "sock_test_server",
399 self.server_args,
400 "sock_test_client",
401 self.client_uni_dir_nsock_test_args,
402 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500403
Klement Sekerab23ffd72021-05-31 16:08:53 +0200404 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -0700405 @unittest.skip("sock test apps need to be improved")
Dave Wallaced85075e2018-03-02 13:19:30 -0500406 def test_ldp_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200407 """run LDP cut thru bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500408
409 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200410 self.cut_thru_test(
411 "sock_test_server",
412 self.server_args,
413 "sock_test_client",
414 self.client_bi_dir_nsock_test_args,
415 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500416
Florin Coras0ae445e2018-11-29 18:22:10 -0800417
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000418@unittest.skipIf(
419 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
420)
Florin Coras0ae445e2018-11-29 18:22:10 -0800421class VCLCutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200422 """VCL Cut Thru Tests"""
Florin Coras0ae445e2018-11-29 18:22:10 -0800423
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800424 @classmethod
425 def setUpClass(cls):
426 super(VCLCutThruTestCase, cls).setUpClass()
427
428 @classmethod
429 def tearDownClass(cls):
430 super(VCLCutThruTestCase, cls).tearDownClass()
431
Florin Coras0ae445e2018-11-29 18:22:10 -0800432 def setUp(self):
433 super(VCLCutThruTestCase, self).setUp()
434
435 self.cut_thru_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200436 self.client_echo_test_args = [
437 "-E",
438 self.echo_phrase,
439 "-X",
440 self.server_addr,
441 self.server_port,
442 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800443
444 self.client_uni_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200445 self.client_uni_dir_nsock_test_args = [
446 "-N",
447 "1000",
448 "-U",
449 "-X",
450 "-I",
451 "2",
452 self.server_addr,
453 self.server_port,
454 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800455 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200456 self.client_bi_dir_nsock_test_args = [
457 "-N",
458 "1000",
459 "-B",
460 "-X",
461 "-I",
462 "2",
463 self.server_addr,
464 self.server_port,
465 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800466
467 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800468 super(VCLCutThruTestCase, self).tearDown()
469
Florin Coras317b8e02019-04-17 09:57:46 -0700470 def show_commands_at_teardown(self):
471 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800472 self.logger.debug(self.vapi.cli("show app mq"))
Florin Coras317b8e02019-04-17 09:57:46 -0700473
Dave Wallace9f11c012018-02-28 17:55:23 -0500474 def test_vcl_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200475 """run VCL cut thru echo test"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500476
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200477 self.cut_thru_test(
478 "vcl_test_server",
479 self.server_args,
480 "vcl_test_client",
481 self.client_echo_test_args,
482 )
Dave Wallace9f11c012018-02-28 17:55:23 -0500483
Dave Wallaced85075e2018-03-02 13:19:30 -0500484 def test_vcl_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200485 """run VCL cut thru uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500486
487 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200488 self.cut_thru_test(
489 "vcl_test_server",
490 self.server_args,
491 "vcl_test_client",
492 self.client_uni_dir_nsock_test_args,
493 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500494
Dave Wallaced85075e2018-03-02 13:19:30 -0500495 def test_vcl_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200496 """run VCL cut thru bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500497
498 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200499 self.cut_thru_test(
500 "vcl_test_server",
501 self.server_args,
502 "vcl_test_client",
503 self.client_bi_dir_nsock_test_args,
504 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500505
Dave Wallace9f11c012018-02-28 17:55:23 -0500506
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000507@unittest.skipIf(
508 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
509)
Florin Corasdc2e2512018-12-03 17:47:26 -0800510class VCLThruHostStackEcho(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200511 """VCL Thru Host Stack Echo"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500512
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800513 @classmethod
514 def setUpClass(cls):
515 super(VCLThruHostStackEcho, cls).setUpClass()
516
517 @classmethod
518 def tearDownClass(cls):
519 super(VCLThruHostStackEcho, cls).tearDownClass()
520
Dave Wallaced85075e2018-03-02 13:19:30 -0500521 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800522 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500523
524 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800525 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200526 self.client_bi_dir_nsock_test_args = [
527 "-N",
528 "1000",
529 "-B",
530 "-X",
531 "-I",
532 "2",
533 self.loop0.local_ip4,
534 self.server_port,
535 ]
536 self.client_echo_test_args = [
537 "-E",
538 self.echo_phrase,
539 "-X",
540 self.loop0.local_ip4,
541 self.server_port,
542 ]
Florin Corasdc2e2512018-12-03 17:47:26 -0800543
544 def tearDown(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800545 self.thru_host_stack_tear_down()
546 super(VCLThruHostStackEcho, self).tearDown()
547
Filip Tehlar48bdf242022-02-08 09:40:00 +0000548 def test_vcl_thru_host_stack_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200549 """run VCL IPv4 thru host stack echo test"""
Filip Tehlar48bdf242022-02-08 09:40:00 +0000550
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200551 self.thru_host_stack_test(
552 "vcl_test_server",
553 self.server_args,
554 "vcl_test_client",
555 self.client_echo_test_args,
556 )
Filip Tehlar48bdf242022-02-08 09:40:00 +0000557
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700558 def show_commands_at_teardown(self):
559 self.logger.debug(self.vapi.cli("show app server"))
560 self.logger.debug(self.vapi.cli("show session verbose"))
Florin Coras41d5f542021-01-15 13:49:33 -0800561 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700562
Florin Corasdc2e2512018-12-03 17:47:26 -0800563
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000564@unittest.skipIf(
565 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
566)
Florin Coras8a140612019-02-18 22:39:39 -0800567class VCLThruHostStackTLS(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200568 """VCL Thru Host Stack TLS"""
Florin Coras8a140612019-02-18 22:39:39 -0800569
570 @classmethod
571 def setUpClass(cls):
Florin Coras4c45d6f2021-08-12 08:38:02 -0700572 cls.session_startup = ["poll-main", "use-app-socket-api"]
Florin Coras8a140612019-02-18 22:39:39 -0800573 super(VCLThruHostStackTLS, cls).setUpClass()
574
575 @classmethod
576 def tearDownClass(cls):
577 super(VCLThruHostStackTLS, cls).tearDownClass()
578
579 def setUp(self):
580 super(VCLThruHostStackTLS, self).setUp()
581
582 self.thru_host_stack_setup()
583 self.client_uni_dir_tls_timeout = 20
Dave Wallace03dd90a2019-03-25 19:34:50 -0400584 self.server_tls_args = ["-L", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200585 self.client_uni_dir_tls_test_args = [
586 "-N",
587 "1000",
588 "-U",
589 "-X",
590 "-L",
591 self.loop0.local_ip4,
592 self.server_port,
593 ]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700594 self.sapi_server_sock = "1"
595 self.sapi_client_sock = "2"
Florin Coras8a140612019-02-18 22:39:39 -0800596
597 def test_vcl_thru_host_stack_tls_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200598 """run VCL thru host stack uni-directional TLS test"""
Florin Coras8a140612019-02-18 22:39:39 -0800599
600 self.timeout = self.client_uni_dir_tls_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200601 self.thru_host_stack_test(
602 "vcl_test_server",
603 self.server_tls_args,
604 "vcl_test_client",
605 self.client_uni_dir_tls_test_args,
606 )
Florin Coras8a140612019-02-18 22:39:39 -0800607
608 def tearDown(self):
Florin Coras8a140612019-02-18 22:39:39 -0800609 self.thru_host_stack_tear_down()
610 super(VCLThruHostStackTLS, self).tearDown()
611
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700612 def show_commands_at_teardown(self):
613 self.logger.debug(self.vapi.cli("show app server"))
614 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800615 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700616
Florin Coras8a140612019-02-18 22:39:39 -0800617
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000618@unittest.skipIf(
619 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
620)
Filip Tehlar99a66f42022-11-11 11:56:54 +0100621class VCLThruHostStackEchoInterruptMode(VCLThruHostStackEcho):
622 """VCL Thru Host Stack Echo interrupt mode"""
623
624 @classmethod
625 def setUpClass(cls):
626 cls.session_startup = ["use-private-rx-mqs", "use-app-socket-api"]
627 super(VCLThruHostStackEcho, cls).setUpClass()
628
629 def test_vcl_thru_host_stack_echo(self):
630 """run VCL IPv4 thru host stack echo test interrupt mode"""
631
632 self.sapi_server_sock = "1"
633 self.sapi_client_sock = "2"
634
635 self.thru_host_stack_test(
636 "vcl_test_server",
637 self.server_args,
638 "vcl_test_client",
639 self.client_echo_test_args,
640 )
641
642
Filip Tehlard82c39e2022-02-14 15:39:26 +0000643class VCLThruHostStackTLSInterruptMode(VCLThruHostStackTLS):
644 """VCL Thru Host Stack TLS interrupt mode"""
645
646 @classmethod
647 def setUpClass(cls):
648 cls.session_startup = ["poll-main", "use-app-socket-api", "use-private-rx-mqs"]
649 super(VCLThruHostStackTLS, cls).setUpClass()
650
651
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000652@unittest.skipIf(
653 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
654)
Florin Corascec1b272021-05-06 12:46:04 -0700655class VCLThruHostStackDTLS(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200656 """VCL Thru Host Stack DTLS"""
Florin Corascec1b272021-05-06 12:46:04 -0700657
658 @classmethod
659 def setUpClass(cls):
660 super(VCLThruHostStackDTLS, cls).setUpClass()
661
662 @classmethod
663 def tearDownClass(cls):
664 super(VCLThruHostStackDTLS, cls).tearDownClass()
665
666 def setUp(self):
667 super(VCLThruHostStackDTLS, self).setUp()
668
669 self.thru_host_stack_setup()
670 self.client_uni_dir_dtls_timeout = 20
Florin Corasfb50bc32021-05-18 00:28:59 -0700671 self.server_dtls_args = ["-p", "dtls", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200672 self.client_uni_dir_dtls_test_args = [
673 "-N",
674 "1000",
675 "-U",
676 "-X",
677 "-p",
678 "dtls",
679 "-T 1400",
680 self.loop0.local_ip4,
681 self.server_port,
682 ]
Florin Corascec1b272021-05-06 12:46:04 -0700683
684 def test_vcl_thru_host_stack_dtls_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200685 """run VCL thru host stack uni-directional DTLS test"""
Florin Corascec1b272021-05-06 12:46:04 -0700686
687 self.timeout = self.client_uni_dir_dtls_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200688 self.thru_host_stack_test(
689 "vcl_test_server",
690 self.server_dtls_args,
691 "vcl_test_client",
692 self.client_uni_dir_dtls_test_args,
693 )
Florin Corascec1b272021-05-06 12:46:04 -0700694
695 def tearDown(self):
696 self.thru_host_stack_tear_down()
697 super(VCLThruHostStackDTLS, self).tearDown()
698
699 def show_commands_at_teardown(self):
700 self.logger.debug(self.vapi.cli("show app server"))
701 self.logger.debug(self.vapi.cli("show session verbose 2"))
702 self.logger.debug(self.vapi.cli("show app mq"))
703
704
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000705@unittest.skipIf(
706 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
707)
Florin Corasdebb3522021-05-18 00:35:50 -0700708class VCLThruHostStackQUIC(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200709 """VCL Thru Host Stack QUIC"""
Florin Corasdebb3522021-05-18 00:35:50 -0700710
711 @classmethod
712 def setUpClass(cls):
713 cls.extra_vpp_plugin_config.append("plugin quic_plugin.so { enable }")
714 super(VCLThruHostStackQUIC, cls).setUpClass()
715
716 @classmethod
717 def tearDownClass(cls):
718 super(VCLThruHostStackQUIC, cls).tearDownClass()
719
720 def setUp(self):
721 super(VCLThruHostStackQUIC, self).setUp()
722
723 self.thru_host_stack_setup()
724 self.client_uni_dir_quic_timeout = 20
725 self.server_quic_args = ["-p", "quic", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200726 self.client_uni_dir_quic_test_args = [
727 "-N",
728 "1000",
729 "-U",
730 "-X",
731 "-p",
732 "quic",
733 self.loop0.local_ip4,
734 self.server_port,
735 ]
Florin Corasdebb3522021-05-18 00:35:50 -0700736
Klement Sekerab23ffd72021-05-31 16:08:53 +0200737 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Corasdebb3522021-05-18 00:35:50 -0700738 def test_vcl_thru_host_stack_quic_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200739 """run VCL thru host stack uni-directional QUIC test"""
Florin Corasdebb3522021-05-18 00:35:50 -0700740
741 self.timeout = self.client_uni_dir_quic_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200742 self.thru_host_stack_test(
743 "vcl_test_server",
744 self.server_quic_args,
745 "vcl_test_client",
746 self.client_uni_dir_quic_test_args,
747 )
Florin Corasdebb3522021-05-18 00:35:50 -0700748
749 def tearDown(self):
750 self.thru_host_stack_tear_down()
751 super(VCLThruHostStackQUIC, self).tearDown()
752
753 def show_commands_at_teardown(self):
754 self.logger.debug(self.vapi.cli("show app server"))
755 self.logger.debug(self.vapi.cli("show session verbose 2"))
756 self.logger.debug(self.vapi.cli("show app mq"))
757
758
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000759@unittest.skipIf(
760 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
761)
Florin Corasdc2e2512018-12-03 17:47:26 -0800762class VCLThruHostStackBidirNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200763 """VCL Thru Host Stack Bidir Nsock"""
Florin Corasdc2e2512018-12-03 17:47:26 -0800764
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800765 @classmethod
766 def setUpClass(cls):
767 super(VCLThruHostStackBidirNsock, cls).setUpClass()
768
769 @classmethod
770 def tearDownClass(cls):
771 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
772
Florin Corasdc2e2512018-12-03 17:47:26 -0800773 def setUp(self):
774 super(VCLThruHostStackBidirNsock, self).setUp()
775
776 self.thru_host_stack_setup()
777 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200778 self.client_bi_dir_nsock_test_args = [
779 "-N",
780 "1000",
781 "-B",
782 "-X",
783 "-I",
784 "2",
785 self.loop0.local_ip4,
786 self.server_port,
787 ]
788 self.client_echo_test_args = [
789 "-E",
790 self.echo_phrase,
791 "-X",
792 self.loop0.local_ip4,
793 self.server_port,
794 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500795
796 def tearDown(self):
797 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800798 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500799
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700800 def show_commands_at_teardown(self):
801 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800802 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700803
Dave Wallaced85075e2018-03-02 13:19:30 -0500804 def test_vcl_thru_host_stack_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200805 """run VCL thru host stack bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500806
807 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200808 self.thru_host_stack_test(
809 "vcl_test_server",
810 self.server_args,
811 "vcl_test_client",
812 self.client_bi_dir_nsock_test_args,
813 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500814
815
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000816@unittest.skipIf(
817 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
818)
Florin Corasdc2e2512018-12-03 17:47:26 -0800819class LDPThruHostStackBidirNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200820 """LDP Thru Host Stack Bidir Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500821
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800822 @classmethod
823 def setUpClass(cls):
824 super(LDPThruHostStackBidirNsock, cls).setUpClass()
825
826 @classmethod
827 def tearDownClass(cls):
828 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
829
Dave Wallaced85075e2018-03-02 13:19:30 -0500830 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800831 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500832
833 self.thru_host_stack_setup()
Dave Wallace3102c382020-04-03 19:48:48 -0400834 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200835 self.client_bi_dir_nsock_test_args = [
836 "-N",
837 "1000",
838 "-B",
839 "-X",
840 # OUCH! Host Stack Bug?
841 # Only fails when running
842 # 'make test TEST_JOBS=auto'
843 # or TEST_JOBS > 1
844 # "-I", "2",
845 self.loop0.local_ip4,
846 self.server_port,
847 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500848
849 def tearDown(self):
850 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800851 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500852
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700853 def show_commands_at_teardown(self):
854 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800855 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700856
Dave Wallaced85075e2018-03-02 13:19:30 -0500857 def test_ldp_thru_host_stack_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200858 """run LDP thru host stack bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500859
860 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200861 self.thru_host_stack_test(
862 "sock_test_server",
863 self.server_args,
864 "sock_test_client",
865 self.client_bi_dir_nsock_test_args,
866 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500867
868
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000869@unittest.skipIf(
870 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
871)
Florin Corasdc2e2512018-12-03 17:47:26 -0800872class LDPThruHostStackNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200873 """LDP Thru Host Stack Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500874
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800875 @classmethod
876 def setUpClass(cls):
877 super(LDPThruHostStackNsock, cls).setUpClass()
878
879 @classmethod
880 def tearDownClass(cls):
881 super(LDPThruHostStackNsock, cls).tearDownClass()
882
Dave Wallaced85075e2018-03-02 13:19:30 -0500883 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800884 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500885
886 self.thru_host_stack_setup()
887 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800888 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500889 self.numSockets = "2"
890 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800891 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500892 self.numSockets = "5"
893
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200894 self.client_uni_dir_nsock_test_args = [
895 "-N",
896 "1000",
897 "-U",
898 "-X",
899 "-I",
900 self.numSockets,
901 self.loop0.local_ip4,
902 self.server_port,
903 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500904
905 def tearDown(self):
906 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800907 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500908
Dave Wallaced85075e2018-03-02 13:19:30 -0500909 def test_ldp_thru_host_stack_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200910 """run LDP thru host stack uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500911
912 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200913 self.thru_host_stack_test(
914 "sock_test_server",
915 self.server_args,
916 "sock_test_client",
917 self.client_uni_dir_nsock_test_args,
918 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500919
920
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000921@unittest.skipIf(
922 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
923)
Florin Corasdc2e2512018-12-03 17:47:26 -0800924class VCLThruHostStackNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200925 """VCL Thru Host Stack Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500926
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800927 @classmethod
928 def setUpClass(cls):
929 super(VCLThruHostStackNsock, cls).setUpClass()
930
931 @classmethod
932 def tearDownClass(cls):
933 super(VCLThruHostStackNsock, cls).tearDownClass()
934
Dave Wallaced85075e2018-03-02 13:19:30 -0500935 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800936 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500937
938 self.thru_host_stack_setup()
939 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800940 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500941 self.numSockets = "2"
942 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800943 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500944 self.numSockets = "5"
945
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200946 self.client_uni_dir_nsock_test_args = [
947 "-N",
948 "1000",
949 "-U",
950 "-X",
951 "-I",
952 self.numSockets,
953 self.loop0.local_ip4,
954 self.server_port,
955 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500956
957 def tearDown(self):
958 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800959 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500960
Dave Wallaced85075e2018-03-02 13:19:30 -0500961 def test_vcl_thru_host_stack_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200962 """run VCL thru host stack uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500963
964 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200965 self.thru_host_stack_test(
966 "vcl_test_server",
967 self.server_args,
968 "vcl_test_client",
969 self.client_uni_dir_nsock_test_args,
970 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500971
972
Florin Corasdc2e2512018-12-03 17:47:26 -0800973class LDPThruHostStackIperf(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200974 """LDP Thru Host Stack Iperf"""
Dave Wallace816833f2018-03-14 20:01:28 -0400975
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800976 @classmethod
977 def setUpClass(cls):
978 super(LDPThruHostStackIperf, cls).setUpClass()
979
980 @classmethod
981 def tearDownClass(cls):
982 super(LDPThruHostStackIperf, cls).tearDownClass()
983
Dave Wallace816833f2018-03-14 20:01:28 -0400984 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800985 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400986
987 self.thru_host_stack_setup()
988 self.client_iperf3_timeout = 20
Florin Coras1d879142021-05-06 00:08:18 -0700989 self.client_iperf3_args = ["-4", "-t 2", "-c", self.loop0.local_ip4]
990 self.server_iperf3_args = ["-4", "-s"]
Dave Wallace816833f2018-03-14 20:01:28 -0400991
992 def tearDown(self):
993 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800994 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400995
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700996 def show_commands_at_teardown(self):
997 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800998 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700999
Paul Vinciguerra063366e2019-06-30 15:38:55 -04001000 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -04001001 def test_ldp_thru_host_stack_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001002 """run LDP thru host stack iperf3 test"""
Dave Wallace816833f2018-03-14 20:01:28 -04001003
Dave Wallace816833f2018-03-14 20:01:28 -04001004 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001005 self.thru_host_stack_test(
1006 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1007 )
Dave Wallace816833f2018-03-14 20:01:28 -04001008
Liangxing Wang22112772022-05-13 04:24:19 +00001009 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
1010 def test_ldp_thru_host_stack_iperf3_mss(self):
1011 """run LDP thru host stack iperf3 test with mss option"""
1012
1013 self.timeout = self.client_iperf3_timeout
1014 self.client_iperf3_args.append("-M 1000")
1015 self.thru_host_stack_test(
1016 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1017 )
1018
Dave Wallace816833f2018-03-14 20:01:28 -04001019
Florin Coras57a5a2d2020-04-01 23:16:11 +00001020class LDPThruHostStackIperfUdp(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001021 """LDP Thru Host Stack Iperf UDP"""
Florin Coras57a5a2d2020-04-01 23:16:11 +00001022
1023 @classmethod
1024 def setUpClass(cls):
1025 super(LDPThruHostStackIperfUdp, cls).setUpClass()
1026
1027 @classmethod
1028 def tearDownClass(cls):
1029 super(LDPThruHostStackIperfUdp, cls).tearDownClass()
1030
1031 def setUp(self):
1032 super(LDPThruHostStackIperfUdp, self).setUp()
1033
1034 self.thru_host_stack_setup()
1035 self.client_iperf3_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001036 self.client_iperf3_args = [
1037 "-4",
1038 "-t 2",
1039 "-u",
1040 "-l 1400",
Florin Corasd921b892023-05-25 12:04:53 -07001041 "-P 2",
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001042 "-c",
1043 self.loop0.local_ip4,
1044 ]
Florin Coras1d879142021-05-06 00:08:18 -07001045 self.server_iperf3_args = ["-4", "-s"]
Florin Coras57a5a2d2020-04-01 23:16:11 +00001046
1047 def tearDown(self):
1048 self.thru_host_stack_tear_down()
1049 super(LDPThruHostStackIperfUdp, self).tearDown()
1050
1051 def show_commands_at_teardown(self):
1052 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -08001053 self.logger.debug(self.vapi.cli("show app mq"))
Florin Coras57a5a2d2020-04-01 23:16:11 +00001054
1055 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
1056 def test_ldp_thru_host_stack_iperf3_udp(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001057 """run LDP thru host stack iperf3 UDP test"""
Florin Coras57a5a2d2020-04-01 23:16:11 +00001058
1059 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001060 self.thru_host_stack_test(
1061 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1062 )
Florin Coras57a5a2d2020-04-01 23:16:11 +00001063
1064
Florin Coras0ae445e2018-11-29 18:22:10 -08001065class LDPIpv6CutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001066 """LDP IPv6 Cut Thru Tests"""
Dave Wallacede910062018-03-20 09:22:13 -04001067
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001068 @classmethod
1069 def setUpClass(cls):
1070 super(LDPIpv6CutThruTestCase, cls).setUpClass()
1071
1072 @classmethod
1073 def tearDownClass(cls):
1074 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
1075
Florin Coras41d5f542021-01-15 13:49:33 -08001076 def show_commands_at_teardown(self):
1077 self.logger.debug(self.vapi.cli("show session verbose 2"))
1078 self.logger.debug(self.vapi.cli("show app mq"))
1079
Dave Wallacede910062018-03-20 09:22:13 -04001080 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001081 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -04001082
1083 self.cut_thru_setup()
1084 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -08001085 self.client_uni_dir_nsock_timeout = 20
1086 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001087 self.client_ipv6_echo_test_args = [
1088 "-6",
1089 "-E",
1090 self.echo_phrase,
1091 "-X",
1092 self.server_ipv6_addr,
1093 self.server_port,
1094 ]
1095 self.client_ipv6_iperf3_args = ["-6", "-t 2", "-c", self.server_ipv6_addr]
Florin Coras1d879142021-05-06 00:08:18 -07001096 self.server_ipv6_iperf3_args = ["-6", "-s"]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001097 self.client_ipv6_uni_dir_nsock_test_args = [
1098 "-N",
1099 "1000",
1100 "-U",
1101 "-X",
1102 "-6",
1103 "-I",
1104 "2",
1105 self.server_ipv6_addr,
1106 self.server_port,
1107 ]
1108 self.client_ipv6_bi_dir_nsock_test_args = [
1109 "-N",
1110 "1000",
1111 "-B",
1112 "-X",
1113 "-6",
1114 "-I",
1115 "2",
1116 self.server_ipv6_addr,
1117 self.server_port,
1118 ]
Dave Wallacede910062018-03-20 09:22:13 -04001119
1120 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001121 super(LDPIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -04001122 self.cut_thru_tear_down()
Dave Wallacede910062018-03-20 09:22:13 -04001123
Klement Sekerab23ffd72021-05-31 16:08:53 +02001124 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001125 def test_ldp_ipv6_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001126 """run LDP IPv6 cut thru echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001127
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001128 self.cut_thru_test(
1129 "sock_test_server",
1130 self.server_ipv6_args,
1131 "sock_test_client",
1132 self.client_ipv6_echo_test_args,
1133 )
Dave Wallacede910062018-03-20 09:22:13 -04001134
Paul Vinciguerra063366e2019-06-30 15:38:55 -04001135 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallacede910062018-03-20 09:22:13 -04001136 def test_ldp_ipv6_cut_thru_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001137 """run LDP IPv6 cut thru iperf3 test"""
Dave Wallacede910062018-03-20 09:22:13 -04001138
Dave Wallacede910062018-03-20 09:22:13 -04001139 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001140 self.cut_thru_test(
1141 iperf3, self.server_ipv6_iperf3_args, iperf3, self.client_ipv6_iperf3_args
1142 )
Dave Wallacede910062018-03-20 09:22:13 -04001143
Klement Sekerab23ffd72021-05-31 16:08:53 +02001144 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001145 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001146 """run LDP IPv6 cut thru uni-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001147
1148 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001149 self.cut_thru_test(
1150 "sock_test_server",
1151 self.server_ipv6_args,
1152 "sock_test_client",
1153 self.client_ipv6_uni_dir_nsock_test_args,
1154 )
Dave Wallacede910062018-03-20 09:22:13 -04001155
Klement Sekerab23ffd72021-05-31 16:08:53 +02001156 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -07001157 @unittest.skip("sock test apps need to be improved")
Dave Wallacede910062018-03-20 09:22:13 -04001158 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001159 """run LDP IPv6 cut thru bi-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001160
1161 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001162 self.cut_thru_test(
1163 "sock_test_server",
1164 self.server_ipv6_args,
1165 "sock_test_client",
1166 self.client_ipv6_bi_dir_nsock_test_args,
1167 )
Dave Wallacede910062018-03-20 09:22:13 -04001168
Florin Coras0ae445e2018-11-29 18:22:10 -08001169
Dmitry Valter34fa0ce2024-03-11 10:38:46 +00001170@unittest.skipIf(
1171 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
1172)
Florin Coras0ae445e2018-11-29 18:22:10 -08001173class VCLIpv6CutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001174 """VCL IPv6 Cut Thru Tests"""
Florin Coras0ae445e2018-11-29 18:22:10 -08001175
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001176 @classmethod
1177 def setUpClass(cls):
1178 super(VCLIpv6CutThruTestCase, cls).setUpClass()
1179
1180 @classmethod
1181 def tearDownClass(cls):
1182 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
1183
Florin Coras41d5f542021-01-15 13:49:33 -08001184 def show_commands_at_teardown(self):
1185 self.logger.debug(self.vapi.cli("show session verbose 2"))
1186 self.logger.debug(self.vapi.cli("show app mq"))
1187
Florin Coras0ae445e2018-11-29 18:22:10 -08001188 def setUp(self):
1189 super(VCLIpv6CutThruTestCase, self).setUp()
1190
1191 self.cut_thru_setup()
1192 self.client_uni_dir_nsock_timeout = 20
1193 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001194 self.client_ipv6_echo_test_args = [
1195 "-6",
1196 "-E",
1197 self.echo_phrase,
1198 "-X",
1199 self.server_ipv6_addr,
1200 self.server_port,
1201 ]
1202 self.client_ipv6_uni_dir_nsock_test_args = [
1203 "-N",
1204 "1000",
1205 "-U",
1206 "-X",
1207 "-6",
1208 "-I",
1209 "2",
1210 self.server_ipv6_addr,
1211 self.server_port,
1212 ]
1213 self.client_ipv6_bi_dir_nsock_test_args = [
1214 "-N",
1215 "1000",
1216 "-B",
1217 "-X",
1218 "-6",
1219 "-I",
1220 "2",
1221 self.server_ipv6_addr,
1222 self.server_port,
1223 ]
Florin Coras0ae445e2018-11-29 18:22:10 -08001224
1225 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001226 super(VCLIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -04001227 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -08001228
Florin Coras41d5f542021-01-15 13:49:33 -08001229 def show_commands_at_teardown(self):
1230 self.logger.debug(self.vapi.cli("show session verbose 2"))
1231 self.logger.debug(self.vapi.cli("show app mq"))
1232
Dave Wallacede910062018-03-20 09:22:13 -04001233 def test_vcl_ipv6_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001234 """run VCL IPv6 cut thru echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001235
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001236 self.cut_thru_test(
1237 "vcl_test_server",
1238 self.server_ipv6_args,
1239 "vcl_test_client",
1240 self.client_ipv6_echo_test_args,
1241 )
Dave Wallacede910062018-03-20 09:22:13 -04001242
Klement Sekerab23ffd72021-05-31 16:08:53 +02001243 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001244 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001245 """run VCL IPv6 cut thru uni-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001246
1247 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001248 self.cut_thru_test(
1249 "vcl_test_server",
1250 self.server_ipv6_args,
1251 "vcl_test_client",
1252 self.client_ipv6_uni_dir_nsock_test_args,
1253 )
Dave Wallacede910062018-03-20 09:22:13 -04001254
Klement Sekerab23ffd72021-05-31 16:08:53 +02001255 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001256 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001257 """run VCL IPv6 cut thru bi-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001258
1259 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001260 self.cut_thru_test(
1261 "vcl_test_server",
1262 self.server_ipv6_args,
1263 "vcl_test_client",
1264 self.client_ipv6_bi_dir_nsock_test_args,
1265 )
Dave Wallacede910062018-03-20 09:22:13 -04001266
1267
Dmitry Valter34fa0ce2024-03-11 10:38:46 +00001268@unittest.skipIf(
1269 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
1270)
Florin Corasdc2e2512018-12-03 17:47:26 -08001271class VCLIpv6ThruHostStackEcho(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001272 """VCL IPv6 Thru Host Stack Echo"""
Dave Wallacede910062018-03-20 09:22:13 -04001273
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001274 @classmethod
1275 def setUpClass(cls):
1276 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
1277
1278 @classmethod
1279 def tearDownClass(cls):
1280 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
1281
Dave Wallacede910062018-03-20 09:22:13 -04001282 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -08001283 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -04001284
1285 self.thru_host_stack_ipv6_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001286 self.client_ipv6_echo_test_args = [
1287 "-6",
1288 "-E",
1289 self.echo_phrase,
1290 "-X",
1291 self.loop0.local_ip6,
1292 self.server_port,
1293 ]
Dave Wallacede910062018-03-20 09:22:13 -04001294
1295 def tearDown(self):
1296 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -08001297 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -04001298
1299 def test_vcl_ipv6_thru_host_stack_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001300 """run VCL IPv6 thru host stack echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001301
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001302 self.thru_host_stack_test(
1303 "vcl_test_server",
1304 self.server_ipv6_args,
1305 "vcl_test_client",
1306 self.client_ipv6_echo_test_args,
1307 )
Dave Wallacede910062018-03-20 09:22:13 -04001308
1309
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001310if __name__ == "__main__":
Dave Wallacecfcf2f42018-02-16 18:31:56 -05001311 unittest.main(testRunner=VppTestRunner)