blob: 8368a9f922f6c23186d4580a08cc408576a3b050 [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 Wallace85ce9312024-08-19 18:47:55 -040010from asfframework import VppAsfTestCase, VppTestRunner, Worker, tag_fixme_ubuntu2404
Dave Wallace8800f732023-08-31 00:47:44 -040011from 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
Dave Wallace85ce9312024-08-19 18:47:55 -0400314@tag_fixme_ubuntu2404
Florin Coras0ae445e2018-11-29 18:22:10 -0800315class LDPCutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200316 """LDP Cut Thru Tests"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500317
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800318 @classmethod
319 def setUpClass(cls):
Florin Coras4c45d6f2021-08-12 08:38:02 -0700320 cls.session_startup = ["poll-main", "use-app-socket-api"]
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800321 super(LDPCutThruTestCase, cls).setUpClass()
322
323 @classmethod
324 def tearDownClass(cls):
325 super(LDPCutThruTestCase, cls).tearDownClass()
326
Dave Wallace9f11c012018-02-28 17:55:23 -0500327 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800328 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500329
330 self.cut_thru_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200331 self.client_echo_test_args = [
332 "-E",
333 self.echo_phrase,
334 "-X",
335 self.server_addr,
336 self.server_port,
337 ]
Dave Wallace816833f2018-03-14 20:01:28 -0400338 self.client_iperf3_timeout = 20
Florin Coras1d879142021-05-06 00:08:18 -0700339 self.client_iperf3_args = ["-4", "-t 2", "-c", self.server_addr]
340 self.server_iperf3_args = ["-4", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800341 self.client_uni_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200342 self.client_uni_dir_nsock_test_args = [
343 "-N",
344 "1000",
345 "-U",
346 "-X",
347 "-I",
348 "2",
349 self.server_addr,
350 self.server_port,
351 ]
Florin Coras2eb42e72018-11-29 00:39:53 -0800352 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200353 self.client_bi_dir_nsock_test_args = [
354 "-N",
355 "1000",
356 "-B",
357 "-X",
358 "-I",
359 "2",
360 self.server_addr,
361 self.server_port,
362 ]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700363 self.sapi_client_sock = "default"
364 self.sapi_server_sock = "default"
Dave Wallace9f11c012018-02-28 17:55:23 -0500365
366 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800367 super(LDPCutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400368 self.cut_thru_tear_down()
Dave Wallace9f11c012018-02-28 17:55:23 -0500369
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700370 def show_commands_at_teardown(self):
371 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800372 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700373
Klement Sekerab23ffd72021-05-31 16:08:53 +0200374 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500375 def test_ldp_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200376 """run LDP cut thru echo test"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500377
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200378 self.cut_thru_test(
379 "sock_test_server",
380 self.server_args,
381 "sock_test_client",
382 self.client_echo_test_args,
383 )
Dave Wallace816833f2018-03-14 20:01:28 -0400384
385 def test_ldp_cut_thru_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200386 """run LDP cut thru iperf3 test"""
Dave Wallace816833f2018-03-14 20:01:28 -0400387
Dave Wallace816833f2018-03-14 20:01:28 -0400388 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200389 self.cut_thru_test(
390 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
391 )
Dave Wallace9f11c012018-02-28 17:55:23 -0500392
Klement Sekerab23ffd72021-05-31 16:08:53 +0200393 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500394 def test_ldp_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200395 """run LDP cut thru uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500396
397 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200398 self.cut_thru_test(
399 "sock_test_server",
400 self.server_args,
401 "sock_test_client",
402 self.client_uni_dir_nsock_test_args,
403 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500404
Klement Sekerab23ffd72021-05-31 16:08:53 +0200405 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -0700406 @unittest.skip("sock test apps need to be improved")
Dave Wallaced85075e2018-03-02 13:19:30 -0500407 def test_ldp_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200408 """run LDP cut thru bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500409
410 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200411 self.cut_thru_test(
412 "sock_test_server",
413 self.server_args,
414 "sock_test_client",
415 self.client_bi_dir_nsock_test_args,
416 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500417
Florin Coras0ae445e2018-11-29 18:22:10 -0800418
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000419@unittest.skipIf(
420 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
421)
Florin Coras0ae445e2018-11-29 18:22:10 -0800422class VCLCutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200423 """VCL Cut Thru Tests"""
Florin Coras0ae445e2018-11-29 18:22:10 -0800424
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800425 @classmethod
426 def setUpClass(cls):
427 super(VCLCutThruTestCase, cls).setUpClass()
428
429 @classmethod
430 def tearDownClass(cls):
431 super(VCLCutThruTestCase, cls).tearDownClass()
432
Florin Coras0ae445e2018-11-29 18:22:10 -0800433 def setUp(self):
434 super(VCLCutThruTestCase, self).setUp()
435
436 self.cut_thru_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200437 self.client_echo_test_args = [
438 "-E",
439 self.echo_phrase,
440 "-X",
441 self.server_addr,
442 self.server_port,
443 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800444
445 self.client_uni_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200446 self.client_uni_dir_nsock_test_args = [
447 "-N",
448 "1000",
449 "-U",
450 "-X",
451 "-I",
452 "2",
453 self.server_addr,
454 self.server_port,
455 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800456 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200457 self.client_bi_dir_nsock_test_args = [
458 "-N",
459 "1000",
460 "-B",
461 "-X",
462 "-I",
463 "2",
464 self.server_addr,
465 self.server_port,
466 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800467
468 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800469 super(VCLCutThruTestCase, self).tearDown()
470
Florin Coras317b8e02019-04-17 09:57:46 -0700471 def show_commands_at_teardown(self):
472 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800473 self.logger.debug(self.vapi.cli("show app mq"))
Florin Coras317b8e02019-04-17 09:57:46 -0700474
Dave Wallace9f11c012018-02-28 17:55:23 -0500475 def test_vcl_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200476 """run VCL cut thru echo test"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500477
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200478 self.cut_thru_test(
479 "vcl_test_server",
480 self.server_args,
481 "vcl_test_client",
482 self.client_echo_test_args,
483 )
Dave Wallace9f11c012018-02-28 17:55:23 -0500484
Dave Wallaced85075e2018-03-02 13:19:30 -0500485 def test_vcl_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200486 """run VCL cut thru uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500487
488 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200489 self.cut_thru_test(
490 "vcl_test_server",
491 self.server_args,
492 "vcl_test_client",
493 self.client_uni_dir_nsock_test_args,
494 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500495
Dave Wallaced85075e2018-03-02 13:19:30 -0500496 def test_vcl_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200497 """run VCL cut thru bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500498
499 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200500 self.cut_thru_test(
501 "vcl_test_server",
502 self.server_args,
503 "vcl_test_client",
504 self.client_bi_dir_nsock_test_args,
505 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500506
Dave Wallace9f11c012018-02-28 17:55:23 -0500507
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000508@unittest.skipIf(
509 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
510)
Florin Corasdc2e2512018-12-03 17:47:26 -0800511class VCLThruHostStackEcho(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200512 """VCL Thru Host Stack Echo"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500513
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800514 @classmethod
515 def setUpClass(cls):
516 super(VCLThruHostStackEcho, cls).setUpClass()
517
518 @classmethod
519 def tearDownClass(cls):
520 super(VCLThruHostStackEcho, cls).tearDownClass()
521
Dave Wallaced85075e2018-03-02 13:19:30 -0500522 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800523 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500524
525 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800526 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200527 self.client_bi_dir_nsock_test_args = [
528 "-N",
529 "1000",
530 "-B",
531 "-X",
532 "-I",
533 "2",
534 self.loop0.local_ip4,
535 self.server_port,
536 ]
537 self.client_echo_test_args = [
538 "-E",
539 self.echo_phrase,
540 "-X",
541 self.loop0.local_ip4,
542 self.server_port,
543 ]
Florin Corasdc2e2512018-12-03 17:47:26 -0800544
545 def tearDown(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800546 self.thru_host_stack_tear_down()
547 super(VCLThruHostStackEcho, self).tearDown()
548
Filip Tehlar48bdf242022-02-08 09:40:00 +0000549 def test_vcl_thru_host_stack_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200550 """run VCL IPv4 thru host stack echo test"""
Filip Tehlar48bdf242022-02-08 09:40:00 +0000551
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200552 self.thru_host_stack_test(
553 "vcl_test_server",
554 self.server_args,
555 "vcl_test_client",
556 self.client_echo_test_args,
557 )
Filip Tehlar48bdf242022-02-08 09:40:00 +0000558
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700559 def show_commands_at_teardown(self):
560 self.logger.debug(self.vapi.cli("show app server"))
561 self.logger.debug(self.vapi.cli("show session verbose"))
Florin Coras41d5f542021-01-15 13:49:33 -0800562 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700563
Florin Corasdc2e2512018-12-03 17:47:26 -0800564
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000565@unittest.skipIf(
566 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
567)
Florin Coras8a140612019-02-18 22:39:39 -0800568class VCLThruHostStackTLS(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200569 """VCL Thru Host Stack TLS"""
Florin Coras8a140612019-02-18 22:39:39 -0800570
571 @classmethod
572 def setUpClass(cls):
Florin Coras4c45d6f2021-08-12 08:38:02 -0700573 cls.session_startup = ["poll-main", "use-app-socket-api"]
Florin Coras8a140612019-02-18 22:39:39 -0800574 super(VCLThruHostStackTLS, cls).setUpClass()
575
576 @classmethod
577 def tearDownClass(cls):
578 super(VCLThruHostStackTLS, cls).tearDownClass()
579
580 def setUp(self):
581 super(VCLThruHostStackTLS, self).setUp()
582
583 self.thru_host_stack_setup()
584 self.client_uni_dir_tls_timeout = 20
Dave Wallace03dd90a2019-03-25 19:34:50 -0400585 self.server_tls_args = ["-L", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200586 self.client_uni_dir_tls_test_args = [
587 "-N",
588 "1000",
589 "-U",
590 "-X",
591 "-L",
592 self.loop0.local_ip4,
593 self.server_port,
594 ]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700595 self.sapi_server_sock = "1"
596 self.sapi_client_sock = "2"
Florin Coras8a140612019-02-18 22:39:39 -0800597
598 def test_vcl_thru_host_stack_tls_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200599 """run VCL thru host stack uni-directional TLS test"""
Florin Coras8a140612019-02-18 22:39:39 -0800600
601 self.timeout = self.client_uni_dir_tls_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200602 self.thru_host_stack_test(
603 "vcl_test_server",
604 self.server_tls_args,
605 "vcl_test_client",
606 self.client_uni_dir_tls_test_args,
607 )
Florin Coras8a140612019-02-18 22:39:39 -0800608
609 def tearDown(self):
Florin Coras8a140612019-02-18 22:39:39 -0800610 self.thru_host_stack_tear_down()
611 super(VCLThruHostStackTLS, self).tearDown()
612
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700613 def show_commands_at_teardown(self):
614 self.logger.debug(self.vapi.cli("show app server"))
615 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800616 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700617
Florin Coras8a140612019-02-18 22:39:39 -0800618
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000619@unittest.skipIf(
620 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
621)
Filip Tehlar99a66f42022-11-11 11:56:54 +0100622class VCLThruHostStackEchoInterruptMode(VCLThruHostStackEcho):
623 """VCL Thru Host Stack Echo interrupt mode"""
624
625 @classmethod
626 def setUpClass(cls):
627 cls.session_startup = ["use-private-rx-mqs", "use-app-socket-api"]
628 super(VCLThruHostStackEcho, cls).setUpClass()
629
630 def test_vcl_thru_host_stack_echo(self):
631 """run VCL IPv4 thru host stack echo test interrupt mode"""
632
633 self.sapi_server_sock = "1"
634 self.sapi_client_sock = "2"
635
636 self.thru_host_stack_test(
637 "vcl_test_server",
638 self.server_args,
639 "vcl_test_client",
640 self.client_echo_test_args,
641 )
642
643
Filip Tehlard82c39e2022-02-14 15:39:26 +0000644class VCLThruHostStackTLSInterruptMode(VCLThruHostStackTLS):
645 """VCL Thru Host Stack TLS interrupt mode"""
646
647 @classmethod
648 def setUpClass(cls):
649 cls.session_startup = ["poll-main", "use-app-socket-api", "use-private-rx-mqs"]
650 super(VCLThruHostStackTLS, cls).setUpClass()
651
652
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000653@unittest.skipIf(
654 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
655)
Florin Corascec1b272021-05-06 12:46:04 -0700656class VCLThruHostStackDTLS(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200657 """VCL Thru Host Stack DTLS"""
Florin Corascec1b272021-05-06 12:46:04 -0700658
659 @classmethod
660 def setUpClass(cls):
661 super(VCLThruHostStackDTLS, cls).setUpClass()
662
663 @classmethod
664 def tearDownClass(cls):
665 super(VCLThruHostStackDTLS, cls).tearDownClass()
666
667 def setUp(self):
668 super(VCLThruHostStackDTLS, self).setUp()
669
670 self.thru_host_stack_setup()
671 self.client_uni_dir_dtls_timeout = 20
Florin Corasfb50bc32021-05-18 00:28:59 -0700672 self.server_dtls_args = ["-p", "dtls", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200673 self.client_uni_dir_dtls_test_args = [
674 "-N",
675 "1000",
676 "-U",
677 "-X",
678 "-p",
679 "dtls",
680 "-T 1400",
681 self.loop0.local_ip4,
682 self.server_port,
683 ]
Florin Corascec1b272021-05-06 12:46:04 -0700684
685 def test_vcl_thru_host_stack_dtls_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200686 """run VCL thru host stack uni-directional DTLS test"""
Florin Corascec1b272021-05-06 12:46:04 -0700687
688 self.timeout = self.client_uni_dir_dtls_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200689 self.thru_host_stack_test(
690 "vcl_test_server",
691 self.server_dtls_args,
692 "vcl_test_client",
693 self.client_uni_dir_dtls_test_args,
694 )
Florin Corascec1b272021-05-06 12:46:04 -0700695
696 def tearDown(self):
697 self.thru_host_stack_tear_down()
698 super(VCLThruHostStackDTLS, self).tearDown()
699
700 def show_commands_at_teardown(self):
701 self.logger.debug(self.vapi.cli("show app server"))
702 self.logger.debug(self.vapi.cli("show session verbose 2"))
703 self.logger.debug(self.vapi.cli("show app mq"))
704
705
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000706@unittest.skipIf(
707 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
708)
Florin Corasdebb3522021-05-18 00:35:50 -0700709class VCLThruHostStackQUIC(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200710 """VCL Thru Host Stack QUIC"""
Florin Corasdebb3522021-05-18 00:35:50 -0700711
712 @classmethod
713 def setUpClass(cls):
714 cls.extra_vpp_plugin_config.append("plugin quic_plugin.so { enable }")
715 super(VCLThruHostStackQUIC, cls).setUpClass()
716
717 @classmethod
718 def tearDownClass(cls):
719 super(VCLThruHostStackQUIC, cls).tearDownClass()
720
721 def setUp(self):
722 super(VCLThruHostStackQUIC, self).setUp()
723
724 self.thru_host_stack_setup()
725 self.client_uni_dir_quic_timeout = 20
726 self.server_quic_args = ["-p", "quic", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200727 self.client_uni_dir_quic_test_args = [
728 "-N",
729 "1000",
730 "-U",
731 "-X",
732 "-p",
733 "quic",
734 self.loop0.local_ip4,
735 self.server_port,
736 ]
Florin Corasdebb3522021-05-18 00:35:50 -0700737
Klement Sekerab23ffd72021-05-31 16:08:53 +0200738 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Corasdebb3522021-05-18 00:35:50 -0700739 def test_vcl_thru_host_stack_quic_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200740 """run VCL thru host stack uni-directional QUIC test"""
Florin Corasdebb3522021-05-18 00:35:50 -0700741
742 self.timeout = self.client_uni_dir_quic_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200743 self.thru_host_stack_test(
744 "vcl_test_server",
745 self.server_quic_args,
746 "vcl_test_client",
747 self.client_uni_dir_quic_test_args,
748 )
Florin Corasdebb3522021-05-18 00:35:50 -0700749
750 def tearDown(self):
751 self.thru_host_stack_tear_down()
752 super(VCLThruHostStackQUIC, self).tearDown()
753
754 def show_commands_at_teardown(self):
755 self.logger.debug(self.vapi.cli("show app server"))
756 self.logger.debug(self.vapi.cli("show session verbose 2"))
757 self.logger.debug(self.vapi.cli("show app mq"))
758
759
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000760@unittest.skipIf(
761 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
762)
Florin Corasdc2e2512018-12-03 17:47:26 -0800763class VCLThruHostStackBidirNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200764 """VCL Thru Host Stack Bidir Nsock"""
Florin Corasdc2e2512018-12-03 17:47:26 -0800765
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800766 @classmethod
767 def setUpClass(cls):
768 super(VCLThruHostStackBidirNsock, cls).setUpClass()
769
770 @classmethod
771 def tearDownClass(cls):
772 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
773
Florin Corasdc2e2512018-12-03 17:47:26 -0800774 def setUp(self):
775 super(VCLThruHostStackBidirNsock, self).setUp()
776
777 self.thru_host_stack_setup()
778 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200779 self.client_bi_dir_nsock_test_args = [
780 "-N",
781 "1000",
782 "-B",
783 "-X",
784 "-I",
785 "2",
786 self.loop0.local_ip4,
787 self.server_port,
788 ]
789 self.client_echo_test_args = [
790 "-E",
791 self.echo_phrase,
792 "-X",
793 self.loop0.local_ip4,
794 self.server_port,
795 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500796
797 def tearDown(self):
798 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800799 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500800
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700801 def show_commands_at_teardown(self):
802 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800803 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700804
Dave Wallaced85075e2018-03-02 13:19:30 -0500805 def test_vcl_thru_host_stack_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200806 """run VCL thru host stack bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500807
808 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200809 self.thru_host_stack_test(
810 "vcl_test_server",
811 self.server_args,
812 "vcl_test_client",
813 self.client_bi_dir_nsock_test_args,
814 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500815
816
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000817@unittest.skipIf(
818 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
819)
Florin Corasdc2e2512018-12-03 17:47:26 -0800820class LDPThruHostStackBidirNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200821 """LDP Thru Host Stack Bidir Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500822
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800823 @classmethod
824 def setUpClass(cls):
825 super(LDPThruHostStackBidirNsock, cls).setUpClass()
826
827 @classmethod
828 def tearDownClass(cls):
829 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
830
Dave Wallaced85075e2018-03-02 13:19:30 -0500831 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800832 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500833
834 self.thru_host_stack_setup()
Dave Wallace3102c382020-04-03 19:48:48 -0400835 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200836 self.client_bi_dir_nsock_test_args = [
837 "-N",
838 "1000",
839 "-B",
840 "-X",
841 # OUCH! Host Stack Bug?
842 # Only fails when running
843 # 'make test TEST_JOBS=auto'
844 # or TEST_JOBS > 1
845 # "-I", "2",
846 self.loop0.local_ip4,
847 self.server_port,
848 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500849
850 def tearDown(self):
851 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800852 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500853
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700854 def show_commands_at_teardown(self):
855 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800856 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700857
Dave Wallaced85075e2018-03-02 13:19:30 -0500858 def test_ldp_thru_host_stack_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200859 """run LDP thru host stack bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500860
861 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200862 self.thru_host_stack_test(
863 "sock_test_server",
864 self.server_args,
865 "sock_test_client",
866 self.client_bi_dir_nsock_test_args,
867 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500868
869
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000870@unittest.skipIf(
871 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
872)
Florin Corasdc2e2512018-12-03 17:47:26 -0800873class LDPThruHostStackNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200874 """LDP Thru Host Stack Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500875
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800876 @classmethod
877 def setUpClass(cls):
878 super(LDPThruHostStackNsock, cls).setUpClass()
879
880 @classmethod
881 def tearDownClass(cls):
882 super(LDPThruHostStackNsock, cls).tearDownClass()
883
Dave Wallaced85075e2018-03-02 13:19:30 -0500884 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800885 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500886
887 self.thru_host_stack_setup()
888 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800889 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500890 self.numSockets = "2"
891 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800892 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500893 self.numSockets = "5"
894
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200895 self.client_uni_dir_nsock_test_args = [
896 "-N",
897 "1000",
898 "-U",
899 "-X",
900 "-I",
901 self.numSockets,
902 self.loop0.local_ip4,
903 self.server_port,
904 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500905
906 def tearDown(self):
907 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800908 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500909
Dave Wallaced85075e2018-03-02 13:19:30 -0500910 def test_ldp_thru_host_stack_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200911 """run LDP thru host stack uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500912
913 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200914 self.thru_host_stack_test(
915 "sock_test_server",
916 self.server_args,
917 "sock_test_client",
918 self.client_uni_dir_nsock_test_args,
919 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500920
921
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000922@unittest.skipIf(
923 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
924)
Florin Corasdc2e2512018-12-03 17:47:26 -0800925class VCLThruHostStackNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200926 """VCL Thru Host Stack Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500927
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800928 @classmethod
929 def setUpClass(cls):
930 super(VCLThruHostStackNsock, cls).setUpClass()
931
932 @classmethod
933 def tearDownClass(cls):
934 super(VCLThruHostStackNsock, cls).tearDownClass()
935
Dave Wallaced85075e2018-03-02 13:19:30 -0500936 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800937 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500938
939 self.thru_host_stack_setup()
940 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800941 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500942 self.numSockets = "2"
943 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800944 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500945 self.numSockets = "5"
946
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200947 self.client_uni_dir_nsock_test_args = [
948 "-N",
949 "1000",
950 "-U",
951 "-X",
952 "-I",
953 self.numSockets,
954 self.loop0.local_ip4,
955 self.server_port,
956 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500957
958 def tearDown(self):
959 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800960 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500961
Dave Wallaced85075e2018-03-02 13:19:30 -0500962 def test_vcl_thru_host_stack_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200963 """run VCL thru host stack uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500964
965 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200966 self.thru_host_stack_test(
967 "vcl_test_server",
968 self.server_args,
969 "vcl_test_client",
970 self.client_uni_dir_nsock_test_args,
971 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500972
973
Dave Wallace85ce9312024-08-19 18:47:55 -0400974@tag_fixme_ubuntu2404
Florin Corasdc2e2512018-12-03 17:47:26 -0800975class LDPThruHostStackIperf(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200976 """LDP Thru Host Stack Iperf"""
Dave Wallace816833f2018-03-14 20:01:28 -0400977
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800978 @classmethod
979 def setUpClass(cls):
980 super(LDPThruHostStackIperf, cls).setUpClass()
981
982 @classmethod
983 def tearDownClass(cls):
984 super(LDPThruHostStackIperf, cls).tearDownClass()
985
Dave Wallace816833f2018-03-14 20:01:28 -0400986 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800987 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400988
989 self.thru_host_stack_setup()
990 self.client_iperf3_timeout = 20
Florin Coras1d879142021-05-06 00:08:18 -0700991 self.client_iperf3_args = ["-4", "-t 2", "-c", self.loop0.local_ip4]
992 self.server_iperf3_args = ["-4", "-s"]
Dave Wallace816833f2018-03-14 20:01:28 -0400993
994 def tearDown(self):
995 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800996 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400997
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700998 def show_commands_at_teardown(self):
999 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -08001000 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -07001001
Paul Vinciguerra063366e2019-06-30 15:38:55 -04001002 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -04001003 def test_ldp_thru_host_stack_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001004 """run LDP thru host stack iperf3 test"""
Dave Wallace816833f2018-03-14 20:01:28 -04001005
Dave Wallace816833f2018-03-14 20:01:28 -04001006 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001007 self.thru_host_stack_test(
1008 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1009 )
Dave Wallace816833f2018-03-14 20:01:28 -04001010
Liangxing Wang22112772022-05-13 04:24:19 +00001011 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
1012 def test_ldp_thru_host_stack_iperf3_mss(self):
1013 """run LDP thru host stack iperf3 test with mss option"""
1014
1015 self.timeout = self.client_iperf3_timeout
1016 self.client_iperf3_args.append("-M 1000")
1017 self.thru_host_stack_test(
1018 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1019 )
1020
Dave Wallace816833f2018-03-14 20:01:28 -04001021
Dave Wallace85ce9312024-08-19 18:47:55 -04001022@tag_fixme_ubuntu2404
Florin Coras57a5a2d2020-04-01 23:16:11 +00001023class LDPThruHostStackIperfUdp(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001024 """LDP Thru Host Stack Iperf UDP"""
Florin Coras57a5a2d2020-04-01 23:16:11 +00001025
1026 @classmethod
1027 def setUpClass(cls):
1028 super(LDPThruHostStackIperfUdp, cls).setUpClass()
1029
1030 @classmethod
1031 def tearDownClass(cls):
1032 super(LDPThruHostStackIperfUdp, cls).tearDownClass()
1033
1034 def setUp(self):
1035 super(LDPThruHostStackIperfUdp, self).setUp()
1036
1037 self.thru_host_stack_setup()
1038 self.client_iperf3_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001039 self.client_iperf3_args = [
1040 "-4",
1041 "-t 2",
1042 "-u",
1043 "-l 1400",
Florin Corasd921b892023-05-25 12:04:53 -07001044 "-P 2",
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001045 "-c",
1046 self.loop0.local_ip4,
1047 ]
Florin Coras1d879142021-05-06 00:08:18 -07001048 self.server_iperf3_args = ["-4", "-s"]
Florin Coras57a5a2d2020-04-01 23:16:11 +00001049
1050 def tearDown(self):
1051 self.thru_host_stack_tear_down()
1052 super(LDPThruHostStackIperfUdp, self).tearDown()
1053
1054 def show_commands_at_teardown(self):
1055 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -08001056 self.logger.debug(self.vapi.cli("show app mq"))
Florin Coras57a5a2d2020-04-01 23:16:11 +00001057
1058 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
1059 def test_ldp_thru_host_stack_iperf3_udp(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001060 """run LDP thru host stack iperf3 UDP test"""
Florin Coras57a5a2d2020-04-01 23:16:11 +00001061
1062 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001063 self.thru_host_stack_test(
1064 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1065 )
Florin Coras57a5a2d2020-04-01 23:16:11 +00001066
1067
Dave Wallace85ce9312024-08-19 18:47:55 -04001068@tag_fixme_ubuntu2404
Florin Coras0ae445e2018-11-29 18:22:10 -08001069class LDPIpv6CutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001070 """LDP IPv6 Cut Thru Tests"""
Dave Wallacede910062018-03-20 09:22:13 -04001071
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001072 @classmethod
1073 def setUpClass(cls):
1074 super(LDPIpv6CutThruTestCase, cls).setUpClass()
1075
1076 @classmethod
1077 def tearDownClass(cls):
1078 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
1079
Florin Coras41d5f542021-01-15 13:49:33 -08001080 def show_commands_at_teardown(self):
1081 self.logger.debug(self.vapi.cli("show session verbose 2"))
1082 self.logger.debug(self.vapi.cli("show app mq"))
1083
Dave Wallacede910062018-03-20 09:22:13 -04001084 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001085 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -04001086
1087 self.cut_thru_setup()
1088 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -08001089 self.client_uni_dir_nsock_timeout = 20
1090 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001091 self.client_ipv6_echo_test_args = [
1092 "-6",
1093 "-E",
1094 self.echo_phrase,
1095 "-X",
1096 self.server_ipv6_addr,
1097 self.server_port,
1098 ]
1099 self.client_ipv6_iperf3_args = ["-6", "-t 2", "-c", self.server_ipv6_addr]
Florin Coras1d879142021-05-06 00:08:18 -07001100 self.server_ipv6_iperf3_args = ["-6", "-s"]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001101 self.client_ipv6_uni_dir_nsock_test_args = [
1102 "-N",
1103 "1000",
1104 "-U",
1105 "-X",
1106 "-6",
1107 "-I",
1108 "2",
1109 self.server_ipv6_addr,
1110 self.server_port,
1111 ]
1112 self.client_ipv6_bi_dir_nsock_test_args = [
1113 "-N",
1114 "1000",
1115 "-B",
1116 "-X",
1117 "-6",
1118 "-I",
1119 "2",
1120 self.server_ipv6_addr,
1121 self.server_port,
1122 ]
Dave Wallacede910062018-03-20 09:22:13 -04001123
1124 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001125 super(LDPIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -04001126 self.cut_thru_tear_down()
Dave Wallacede910062018-03-20 09:22:13 -04001127
Klement Sekerab23ffd72021-05-31 16:08:53 +02001128 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001129 def test_ldp_ipv6_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001130 """run LDP IPv6 cut thru echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001131
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001132 self.cut_thru_test(
1133 "sock_test_server",
1134 self.server_ipv6_args,
1135 "sock_test_client",
1136 self.client_ipv6_echo_test_args,
1137 )
Dave Wallacede910062018-03-20 09:22:13 -04001138
Paul Vinciguerra063366e2019-06-30 15:38:55 -04001139 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallacede910062018-03-20 09:22:13 -04001140 def test_ldp_ipv6_cut_thru_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001141 """run LDP IPv6 cut thru iperf3 test"""
Dave Wallacede910062018-03-20 09:22:13 -04001142
Dave Wallacede910062018-03-20 09:22:13 -04001143 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001144 self.cut_thru_test(
1145 iperf3, self.server_ipv6_iperf3_args, iperf3, self.client_ipv6_iperf3_args
1146 )
Dave Wallacede910062018-03-20 09:22:13 -04001147
Klement Sekerab23ffd72021-05-31 16:08:53 +02001148 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001149 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001150 """run LDP IPv6 cut thru uni-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001151
1152 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001153 self.cut_thru_test(
1154 "sock_test_server",
1155 self.server_ipv6_args,
1156 "sock_test_client",
1157 self.client_ipv6_uni_dir_nsock_test_args,
1158 )
Dave Wallacede910062018-03-20 09:22:13 -04001159
Klement Sekerab23ffd72021-05-31 16:08:53 +02001160 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -07001161 @unittest.skip("sock test apps need to be improved")
Dave Wallacede910062018-03-20 09:22:13 -04001162 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001163 """run LDP IPv6 cut thru bi-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001164
1165 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001166 self.cut_thru_test(
1167 "sock_test_server",
1168 self.server_ipv6_args,
1169 "sock_test_client",
1170 self.client_ipv6_bi_dir_nsock_test_args,
1171 )
Dave Wallacede910062018-03-20 09:22:13 -04001172
Florin Coras0ae445e2018-11-29 18:22:10 -08001173
Dmitry Valter34fa0ce2024-03-11 10:38:46 +00001174@unittest.skipIf(
1175 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
1176)
Florin Coras0ae445e2018-11-29 18:22:10 -08001177class VCLIpv6CutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001178 """VCL IPv6 Cut Thru Tests"""
Florin Coras0ae445e2018-11-29 18:22:10 -08001179
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001180 @classmethod
1181 def setUpClass(cls):
1182 super(VCLIpv6CutThruTestCase, cls).setUpClass()
1183
1184 @classmethod
1185 def tearDownClass(cls):
1186 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
1187
Florin Coras41d5f542021-01-15 13:49:33 -08001188 def show_commands_at_teardown(self):
1189 self.logger.debug(self.vapi.cli("show session verbose 2"))
1190 self.logger.debug(self.vapi.cli("show app mq"))
1191
Florin Coras0ae445e2018-11-29 18:22:10 -08001192 def setUp(self):
1193 super(VCLIpv6CutThruTestCase, self).setUp()
1194
1195 self.cut_thru_setup()
1196 self.client_uni_dir_nsock_timeout = 20
1197 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001198 self.client_ipv6_echo_test_args = [
1199 "-6",
1200 "-E",
1201 self.echo_phrase,
1202 "-X",
1203 self.server_ipv6_addr,
1204 self.server_port,
1205 ]
1206 self.client_ipv6_uni_dir_nsock_test_args = [
1207 "-N",
1208 "1000",
1209 "-U",
1210 "-X",
1211 "-6",
1212 "-I",
1213 "2",
1214 self.server_ipv6_addr,
1215 self.server_port,
1216 ]
1217 self.client_ipv6_bi_dir_nsock_test_args = [
1218 "-N",
1219 "1000",
1220 "-B",
1221 "-X",
1222 "-6",
1223 "-I",
1224 "2",
1225 self.server_ipv6_addr,
1226 self.server_port,
1227 ]
Florin Coras0ae445e2018-11-29 18:22:10 -08001228
1229 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001230 super(VCLIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -04001231 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -08001232
Florin Coras41d5f542021-01-15 13:49:33 -08001233 def show_commands_at_teardown(self):
1234 self.logger.debug(self.vapi.cli("show session verbose 2"))
1235 self.logger.debug(self.vapi.cli("show app mq"))
1236
Dave Wallacede910062018-03-20 09:22:13 -04001237 def test_vcl_ipv6_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001238 """run VCL IPv6 cut thru echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001239
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001240 self.cut_thru_test(
1241 "vcl_test_server",
1242 self.server_ipv6_args,
1243 "vcl_test_client",
1244 self.client_ipv6_echo_test_args,
1245 )
Dave Wallacede910062018-03-20 09:22:13 -04001246
Klement Sekerab23ffd72021-05-31 16:08:53 +02001247 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001248 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001249 """run VCL IPv6 cut thru uni-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001250
1251 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001252 self.cut_thru_test(
1253 "vcl_test_server",
1254 self.server_ipv6_args,
1255 "vcl_test_client",
1256 self.client_ipv6_uni_dir_nsock_test_args,
1257 )
Dave Wallacede910062018-03-20 09:22:13 -04001258
Klement Sekerab23ffd72021-05-31 16:08:53 +02001259 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001260 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001261 """run VCL IPv6 cut thru bi-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001262
1263 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001264 self.cut_thru_test(
1265 "vcl_test_server",
1266 self.server_ipv6_args,
1267 "vcl_test_client",
1268 self.client_ipv6_bi_dir_nsock_test_args,
1269 )
Dave Wallacede910062018-03-20 09:22:13 -04001270
1271
Dmitry Valter34fa0ce2024-03-11 10:38:46 +00001272@unittest.skipIf(
1273 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
1274)
Florin Corasdc2e2512018-12-03 17:47:26 -08001275class VCLIpv6ThruHostStackEcho(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001276 """VCL IPv6 Thru Host Stack Echo"""
Dave Wallacede910062018-03-20 09:22:13 -04001277
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001278 @classmethod
1279 def setUpClass(cls):
1280 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
1281
1282 @classmethod
1283 def tearDownClass(cls):
1284 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
1285
Dave Wallacede910062018-03-20 09:22:13 -04001286 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -08001287 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -04001288
1289 self.thru_host_stack_ipv6_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001290 self.client_ipv6_echo_test_args = [
1291 "-6",
1292 "-E",
1293 self.echo_phrase,
1294 "-X",
1295 self.loop0.local_ip6,
1296 self.server_port,
1297 ]
Dave Wallacede910062018-03-20 09:22:13 -04001298
1299 def tearDown(self):
1300 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -08001301 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -04001302
1303 def test_vcl_ipv6_thru_host_stack_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001304 """run VCL IPv6 thru host stack echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001305
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001306 self.thru_host_stack_test(
1307 "vcl_test_server",
1308 self.server_ipv6_args,
1309 "vcl_test_client",
1310 self.client_ipv6_echo_test_args,
1311 )
Dave Wallacede910062018-03-20 09:22:13 -04001312
1313
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001314if __name__ == "__main__":
Dave Wallacecfcf2f42018-02-16 18:31:56 -05001315 unittest.main(testRunner=VppTestRunner)