blob: a0141be80b2ba6f6fbcf2d6b551bf9e63ded5a11 [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):
192 for i in self.lo_interfaces:
193 i.unconfig_ip4()
194 i.set_table_ip4(0)
195 i.admin_down()
Liangxing Wang22112772022-05-13 04:24:19 +0000196 i.remove_vpp_config()
Dave Wallace9f11c012018-02-28 17:55:23 -0500197
Dave Wallacede910062018-03-20 09:22:13 -0400198 def thru_host_stack_ipv6_setup(self):
Jakub Grajciar6a2794e2020-11-24 11:22:01 +0100199 self.vapi.session_enable_disable(is_enable=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200200 self.create_loopback_interfaces(2)
Dave Wallacede910062018-03-20 09:22:13 -0400201
202 table_id = 1
203
204 for i in self.lo_interfaces:
205 i.admin_up()
206
207 tbl = VppIpTable(self, table_id, is_ip6=1)
208 tbl.add_vpp_config()
209
210 i.set_table_ip6(table_id)
211 i.config_ip6()
212 table_id += 1
213
214 # Configure namespaces
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200215 self.vapi.app_namespace_add_del_v4(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200216 namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index
217 )
Nathan Skrzypczak51f1b262023-04-27 12:43:46 +0200218 self.vapi.app_namespace_add_del_v4(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200219 namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index
220 )
Dave Wallacede910062018-03-20 09:22:13 -0400221
222 # Add inter-table routes
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200223 ip_t01 = VppIpRoute(
224 self,
225 self.loop1.local_ip6,
226 128,
227 [VppRoutePath("::0", 0xFFFFFFFF, nh_table_id=2)],
228 table_id=1,
229 )
230 ip_t10 = VppIpRoute(
231 self,
232 self.loop0.local_ip6,
233 128,
234 [VppRoutePath("::0", 0xFFFFFFFF, nh_table_id=1)],
235 table_id=2,
236 )
Dave Wallacede910062018-03-20 09:22:13 -0400237 ip_t01.add_vpp_config()
238 ip_t10.add_vpp_config()
239 self.logger.debug(self.vapi.cli("show interface addr"))
240 self.logger.debug(self.vapi.cli("show ip6 fib"))
241
242 def thru_host_stack_ipv6_tear_down(self):
243 for i in self.lo_interfaces:
244 i.unconfig_ip6()
245 i.set_table_ip6(0)
246 i.admin_down()
247
Jakub Grajciar6a2794e2020-11-24 11:22:01 +0100248 self.vapi.session_enable_disable(is_enable=0)
Dave Wallacede910062018-03-20 09:22:13 -0400249
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400250 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200251 def thru_host_stack_test(self, server_app, server_args, client_app, client_args):
252 self.vcl_app_env = {"VCL_APP_SCOPE_GLOBAL": "true"}
Dave Wallace9f11c012018-02-28 17:55:23 -0500253
Florin Coras4c45d6f2021-08-12 08:38:02 -0700254 self.update_vcl_app_env("1", "1234", self.sapi_server_sock)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200255 worker_server = VCLAppWorker(
256 server_app, server_args, self.logger, self.vcl_app_env, "server"
257 )
Dave Wallacea67a03e2018-02-20 12:39:37 -0500258 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800259 self.sleep(self.pre_test_sleep)
Dave Wallace42996c02018-02-26 14:40:13 -0500260
Florin Coras4c45d6f2021-08-12 08:38:02 -0700261 self.update_vcl_app_env("2", "5678", self.sapi_client_sock)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200262 worker_client = VCLAppWorker(
263 client_app, client_args, self.logger, self.vcl_app_env, "client"
264 )
Dave Wallacea67a03e2018-02-20 12:39:37 -0500265 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500266 worker_client.join(self.timeout)
267
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500268 try:
269 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200270 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500271 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800272 self.sleep(self.post_test_sleep)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500273
Dave Wallace9f11c012018-02-28 17:55:23 -0500274 def validateResults(self, worker_client, worker_server, timeout):
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400275 if worker_server.process is None:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200276 raise RuntimeError("worker_server is not running.")
277 if os.path.isdir("/proc/{}".format(worker_server.process.pid)):
278 self.logger.info(
279 "Killing server worker process (pid %d)" % worker_server.process.pid
280 )
Dave Barachad646872019-05-06 10:49:41 -0400281 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM)
Dave Wallaced85075e2018-03-02 13:19:30 -0500282 worker_server.join()
Dave Wallace9f11c012018-02-28 17:55:23 -0500283 self.logger.info("Client worker result is `%s'" % worker_client.result)
284 error = False
285 if worker_client.result is None:
286 try:
287 error = True
288 self.logger.error(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200289 "Timeout: %ss! Killing client worker process (pid %d)"
290 % (timeout, worker_client.process.pid)
291 )
292 os.killpg(os.getpgid(worker_client.process.pid), signal.SIGKILL)
Dave Wallace9f11c012018-02-28 17:55:23 -0500293 worker_client.join()
Dave Wallace07c0a9d2019-05-13 19:21:24 -0400294 except OSError:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200295 self.logger.debug("Couldn't kill client worker process")
Dave Wallace9f11c012018-02-28 17:55:23 -0500296 raise
297 if error:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200298 raise RuntimeError("Timeout! Client worker did not finish in %ss" % timeout)
Dave Wallace9f11c012018-02-28 17:55:23 -0500299 self.assert_equal(worker_client.result, 0, "Binary test return code")
300
301
Florin Coras0ae445e2018-11-29 18:22:10 -0800302class LDPCutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200303 """LDP Cut Thru Tests"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500304
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800305 @classmethod
306 def setUpClass(cls):
Florin Coras4c45d6f2021-08-12 08:38:02 -0700307 cls.session_startup = ["poll-main", "use-app-socket-api"]
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800308 super(LDPCutThruTestCase, cls).setUpClass()
309
310 @classmethod
311 def tearDownClass(cls):
312 super(LDPCutThruTestCase, cls).tearDownClass()
313
Dave Wallace9f11c012018-02-28 17:55:23 -0500314 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800315 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500316
317 self.cut_thru_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200318 self.client_echo_test_args = [
319 "-E",
320 self.echo_phrase,
321 "-X",
322 self.server_addr,
323 self.server_port,
324 ]
Dave Wallace816833f2018-03-14 20:01:28 -0400325 self.client_iperf3_timeout = 20
Florin Coras1d879142021-05-06 00:08:18 -0700326 self.client_iperf3_args = ["-4", "-t 2", "-c", self.server_addr]
327 self.server_iperf3_args = ["-4", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800328 self.client_uni_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200329 self.client_uni_dir_nsock_test_args = [
330 "-N",
331 "1000",
332 "-U",
333 "-X",
334 "-I",
335 "2",
336 self.server_addr,
337 self.server_port,
338 ]
Florin Coras2eb42e72018-11-29 00:39:53 -0800339 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200340 self.client_bi_dir_nsock_test_args = [
341 "-N",
342 "1000",
343 "-B",
344 "-X",
345 "-I",
346 "2",
347 self.server_addr,
348 self.server_port,
349 ]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700350 self.sapi_client_sock = "default"
351 self.sapi_server_sock = "default"
Dave Wallace9f11c012018-02-28 17:55:23 -0500352
353 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800354 super(LDPCutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400355 self.cut_thru_tear_down()
Dave Wallace9f11c012018-02-28 17:55:23 -0500356
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700357 def show_commands_at_teardown(self):
358 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800359 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700360
Klement Sekerab23ffd72021-05-31 16:08:53 +0200361 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500362 def test_ldp_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200363 """run LDP cut thru echo test"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500364
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200365 self.cut_thru_test(
366 "sock_test_server",
367 self.server_args,
368 "sock_test_client",
369 self.client_echo_test_args,
370 )
Dave Wallace816833f2018-03-14 20:01:28 -0400371
372 def test_ldp_cut_thru_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200373 """run LDP cut thru iperf3 test"""
Dave Wallace816833f2018-03-14 20:01:28 -0400374
Dave Wallace816833f2018-03-14 20:01:28 -0400375 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200376 self.cut_thru_test(
377 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
378 )
Dave Wallace9f11c012018-02-28 17:55:23 -0500379
Klement Sekerab23ffd72021-05-31 16:08:53 +0200380 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500381 def test_ldp_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200382 """run LDP cut thru uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500383
384 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200385 self.cut_thru_test(
386 "sock_test_server",
387 self.server_args,
388 "sock_test_client",
389 self.client_uni_dir_nsock_test_args,
390 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500391
Klement Sekerab23ffd72021-05-31 16:08:53 +0200392 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -0700393 @unittest.skip("sock test apps need to be improved")
Dave Wallaced85075e2018-03-02 13:19:30 -0500394 def test_ldp_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200395 """run LDP cut thru bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500396
397 self.timeout = self.client_bi_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_bi_dir_nsock_test_args,
403 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500404
Florin Coras0ae445e2018-11-29 18:22:10 -0800405
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000406@unittest.skipIf(
407 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
408)
Florin Coras0ae445e2018-11-29 18:22:10 -0800409class VCLCutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200410 """VCL Cut Thru Tests"""
Florin Coras0ae445e2018-11-29 18:22:10 -0800411
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800412 @classmethod
413 def setUpClass(cls):
414 super(VCLCutThruTestCase, cls).setUpClass()
415
416 @classmethod
417 def tearDownClass(cls):
418 super(VCLCutThruTestCase, cls).tearDownClass()
419
Florin Coras0ae445e2018-11-29 18:22:10 -0800420 def setUp(self):
421 super(VCLCutThruTestCase, self).setUp()
422
423 self.cut_thru_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200424 self.client_echo_test_args = [
425 "-E",
426 self.echo_phrase,
427 "-X",
428 self.server_addr,
429 self.server_port,
430 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800431
432 self.client_uni_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200433 self.client_uni_dir_nsock_test_args = [
434 "-N",
435 "1000",
436 "-U",
437 "-X",
438 "-I",
439 "2",
440 self.server_addr,
441 self.server_port,
442 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800443 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200444 self.client_bi_dir_nsock_test_args = [
445 "-N",
446 "1000",
447 "-B",
448 "-X",
449 "-I",
450 "2",
451 self.server_addr,
452 self.server_port,
453 ]
Florin Coras0ae445e2018-11-29 18:22:10 -0800454
455 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800456 super(VCLCutThruTestCase, self).tearDown()
457
Florin Coras317b8e02019-04-17 09:57:46 -0700458 def show_commands_at_teardown(self):
459 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800460 self.logger.debug(self.vapi.cli("show app mq"))
Florin Coras317b8e02019-04-17 09:57:46 -0700461
Dave Wallace9f11c012018-02-28 17:55:23 -0500462 def test_vcl_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200463 """run VCL cut thru echo test"""
Dave Wallace9f11c012018-02-28 17:55:23 -0500464
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200465 self.cut_thru_test(
466 "vcl_test_server",
467 self.server_args,
468 "vcl_test_client",
469 self.client_echo_test_args,
470 )
Dave Wallace9f11c012018-02-28 17:55:23 -0500471
Dave Wallaced85075e2018-03-02 13:19:30 -0500472 def test_vcl_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200473 """run VCL cut thru uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500474
475 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200476 self.cut_thru_test(
477 "vcl_test_server",
478 self.server_args,
479 "vcl_test_client",
480 self.client_uni_dir_nsock_test_args,
481 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500482
Dave Wallaced85075e2018-03-02 13:19:30 -0500483 def test_vcl_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200484 """run VCL cut thru bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500485
486 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200487 self.cut_thru_test(
488 "vcl_test_server",
489 self.server_args,
490 "vcl_test_client",
491 self.client_bi_dir_nsock_test_args,
492 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500493
Dave Wallace9f11c012018-02-28 17:55:23 -0500494
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000495@unittest.skipIf(
496 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
497)
Florin Corasdc2e2512018-12-03 17:47:26 -0800498class VCLThruHostStackEcho(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200499 """VCL Thru Host Stack Echo"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500500
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800501 @classmethod
502 def setUpClass(cls):
503 super(VCLThruHostStackEcho, cls).setUpClass()
504
505 @classmethod
506 def tearDownClass(cls):
507 super(VCLThruHostStackEcho, cls).tearDownClass()
508
Dave Wallaced85075e2018-03-02 13:19:30 -0500509 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800510 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500511
512 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800513 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200514 self.client_bi_dir_nsock_test_args = [
515 "-N",
516 "1000",
517 "-B",
518 "-X",
519 "-I",
520 "2",
521 self.loop0.local_ip4,
522 self.server_port,
523 ]
524 self.client_echo_test_args = [
525 "-E",
526 self.echo_phrase,
527 "-X",
528 self.loop0.local_ip4,
529 self.server_port,
530 ]
Florin Corasdc2e2512018-12-03 17:47:26 -0800531
532 def tearDown(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800533 self.thru_host_stack_tear_down()
534 super(VCLThruHostStackEcho, self).tearDown()
535
Filip Tehlar48bdf242022-02-08 09:40:00 +0000536 def test_vcl_thru_host_stack_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200537 """run VCL IPv4 thru host stack echo test"""
Filip Tehlar48bdf242022-02-08 09:40:00 +0000538
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200539 self.thru_host_stack_test(
540 "vcl_test_server",
541 self.server_args,
542 "vcl_test_client",
543 self.client_echo_test_args,
544 )
Filip Tehlar48bdf242022-02-08 09:40:00 +0000545
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700546 def show_commands_at_teardown(self):
547 self.logger.debug(self.vapi.cli("show app server"))
548 self.logger.debug(self.vapi.cli("show session verbose"))
Florin Coras41d5f542021-01-15 13:49:33 -0800549 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700550
Florin Corasdc2e2512018-12-03 17:47:26 -0800551
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000552@unittest.skipIf(
553 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
554)
Florin Coras8a140612019-02-18 22:39:39 -0800555class VCLThruHostStackTLS(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200556 """VCL Thru Host Stack TLS"""
Florin Coras8a140612019-02-18 22:39:39 -0800557
558 @classmethod
559 def setUpClass(cls):
Florin Coras4c45d6f2021-08-12 08:38:02 -0700560 cls.session_startup = ["poll-main", "use-app-socket-api"]
Florin Coras8a140612019-02-18 22:39:39 -0800561 super(VCLThruHostStackTLS, cls).setUpClass()
562
563 @classmethod
564 def tearDownClass(cls):
565 super(VCLThruHostStackTLS, cls).tearDownClass()
566
567 def setUp(self):
568 super(VCLThruHostStackTLS, self).setUp()
569
570 self.thru_host_stack_setup()
571 self.client_uni_dir_tls_timeout = 20
Dave Wallace03dd90a2019-03-25 19:34:50 -0400572 self.server_tls_args = ["-L", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200573 self.client_uni_dir_tls_test_args = [
574 "-N",
575 "1000",
576 "-U",
577 "-X",
578 "-L",
579 self.loop0.local_ip4,
580 self.server_port,
581 ]
Florin Coras4c45d6f2021-08-12 08:38:02 -0700582 self.sapi_server_sock = "1"
583 self.sapi_client_sock = "2"
Florin Coras8a140612019-02-18 22:39:39 -0800584
585 def test_vcl_thru_host_stack_tls_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200586 """run VCL thru host stack uni-directional TLS test"""
Florin Coras8a140612019-02-18 22:39:39 -0800587
588 self.timeout = self.client_uni_dir_tls_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200589 self.thru_host_stack_test(
590 "vcl_test_server",
591 self.server_tls_args,
592 "vcl_test_client",
593 self.client_uni_dir_tls_test_args,
594 )
Florin Coras8a140612019-02-18 22:39:39 -0800595
596 def tearDown(self):
Florin Coras8a140612019-02-18 22:39:39 -0800597 self.thru_host_stack_tear_down()
598 super(VCLThruHostStackTLS, self).tearDown()
599
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700600 def show_commands_at_teardown(self):
601 self.logger.debug(self.vapi.cli("show app server"))
602 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800603 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700604
Florin Coras8a140612019-02-18 22:39:39 -0800605
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000606@unittest.skipIf(
607 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
608)
Filip Tehlar99a66f42022-11-11 11:56:54 +0100609class VCLThruHostStackEchoInterruptMode(VCLThruHostStackEcho):
610 """VCL Thru Host Stack Echo interrupt mode"""
611
612 @classmethod
613 def setUpClass(cls):
614 cls.session_startup = ["use-private-rx-mqs", "use-app-socket-api"]
615 super(VCLThruHostStackEcho, cls).setUpClass()
616
617 def test_vcl_thru_host_stack_echo(self):
618 """run VCL IPv4 thru host stack echo test interrupt mode"""
619
620 self.sapi_server_sock = "1"
621 self.sapi_client_sock = "2"
622
623 self.thru_host_stack_test(
624 "vcl_test_server",
625 self.server_args,
626 "vcl_test_client",
627 self.client_echo_test_args,
628 )
629
630
Filip Tehlard82c39e2022-02-14 15:39:26 +0000631class VCLThruHostStackTLSInterruptMode(VCLThruHostStackTLS):
632 """VCL Thru Host Stack TLS interrupt mode"""
633
634 @classmethod
635 def setUpClass(cls):
636 cls.session_startup = ["poll-main", "use-app-socket-api", "use-private-rx-mqs"]
637 super(VCLThruHostStackTLS, cls).setUpClass()
638
639
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000640@unittest.skipIf(
641 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
642)
Florin Corascec1b272021-05-06 12:46:04 -0700643class VCLThruHostStackDTLS(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200644 """VCL Thru Host Stack DTLS"""
Florin Corascec1b272021-05-06 12:46:04 -0700645
646 @classmethod
647 def setUpClass(cls):
648 super(VCLThruHostStackDTLS, cls).setUpClass()
649
650 @classmethod
651 def tearDownClass(cls):
652 super(VCLThruHostStackDTLS, cls).tearDownClass()
653
654 def setUp(self):
655 super(VCLThruHostStackDTLS, self).setUp()
656
657 self.thru_host_stack_setup()
658 self.client_uni_dir_dtls_timeout = 20
Florin Corasfb50bc32021-05-18 00:28:59 -0700659 self.server_dtls_args = ["-p", "dtls", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200660 self.client_uni_dir_dtls_test_args = [
661 "-N",
662 "1000",
663 "-U",
664 "-X",
665 "-p",
666 "dtls",
667 "-T 1400",
668 self.loop0.local_ip4,
669 self.server_port,
670 ]
Florin Corascec1b272021-05-06 12:46:04 -0700671
672 def test_vcl_thru_host_stack_dtls_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200673 """run VCL thru host stack uni-directional DTLS test"""
Florin Corascec1b272021-05-06 12:46:04 -0700674
675 self.timeout = self.client_uni_dir_dtls_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200676 self.thru_host_stack_test(
677 "vcl_test_server",
678 self.server_dtls_args,
679 "vcl_test_client",
680 self.client_uni_dir_dtls_test_args,
681 )
Florin Corascec1b272021-05-06 12:46:04 -0700682
683 def tearDown(self):
684 self.thru_host_stack_tear_down()
685 super(VCLThruHostStackDTLS, self).tearDown()
686
687 def show_commands_at_teardown(self):
688 self.logger.debug(self.vapi.cli("show app server"))
689 self.logger.debug(self.vapi.cli("show session verbose 2"))
690 self.logger.debug(self.vapi.cli("show app mq"))
691
692
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000693@unittest.skipIf(
694 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
695)
Florin Corasdebb3522021-05-18 00:35:50 -0700696class VCLThruHostStackQUIC(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200697 """VCL Thru Host Stack QUIC"""
Florin Corasdebb3522021-05-18 00:35:50 -0700698
699 @classmethod
700 def setUpClass(cls):
701 cls.extra_vpp_plugin_config.append("plugin quic_plugin.so { enable }")
702 super(VCLThruHostStackQUIC, cls).setUpClass()
703
704 @classmethod
705 def tearDownClass(cls):
706 super(VCLThruHostStackQUIC, cls).tearDownClass()
707
708 def setUp(self):
709 super(VCLThruHostStackQUIC, self).setUp()
710
711 self.thru_host_stack_setup()
712 self.client_uni_dir_quic_timeout = 20
713 self.server_quic_args = ["-p", "quic", self.server_port]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200714 self.client_uni_dir_quic_test_args = [
715 "-N",
716 "1000",
717 "-U",
718 "-X",
719 "-p",
720 "quic",
721 self.loop0.local_ip4,
722 self.server_port,
723 ]
Florin Corasdebb3522021-05-18 00:35:50 -0700724
Klement Sekerab23ffd72021-05-31 16:08:53 +0200725 @unittest.skipUnless(config.extended, "part of extended tests")
Florin Corasdebb3522021-05-18 00:35:50 -0700726 def test_vcl_thru_host_stack_quic_uni_dir(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200727 """run VCL thru host stack uni-directional QUIC test"""
Florin Corasdebb3522021-05-18 00:35:50 -0700728
729 self.timeout = self.client_uni_dir_quic_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200730 self.thru_host_stack_test(
731 "vcl_test_server",
732 self.server_quic_args,
733 "vcl_test_client",
734 self.client_uni_dir_quic_test_args,
735 )
Florin Corasdebb3522021-05-18 00:35:50 -0700736
737 def tearDown(self):
738 self.thru_host_stack_tear_down()
739 super(VCLThruHostStackQUIC, self).tearDown()
740
741 def show_commands_at_teardown(self):
742 self.logger.debug(self.vapi.cli("show app server"))
743 self.logger.debug(self.vapi.cli("show session verbose 2"))
744 self.logger.debug(self.vapi.cli("show app mq"))
745
746
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000747@unittest.skipIf(
748 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
749)
Florin Corasdc2e2512018-12-03 17:47:26 -0800750class VCLThruHostStackBidirNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200751 """VCL Thru Host Stack Bidir Nsock"""
Florin Corasdc2e2512018-12-03 17:47:26 -0800752
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800753 @classmethod
754 def setUpClass(cls):
755 super(VCLThruHostStackBidirNsock, cls).setUpClass()
756
757 @classmethod
758 def tearDownClass(cls):
759 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
760
Florin Corasdc2e2512018-12-03 17:47:26 -0800761 def setUp(self):
762 super(VCLThruHostStackBidirNsock, self).setUp()
763
764 self.thru_host_stack_setup()
765 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200766 self.client_bi_dir_nsock_test_args = [
767 "-N",
768 "1000",
769 "-B",
770 "-X",
771 "-I",
772 "2",
773 self.loop0.local_ip4,
774 self.server_port,
775 ]
776 self.client_echo_test_args = [
777 "-E",
778 self.echo_phrase,
779 "-X",
780 self.loop0.local_ip4,
781 self.server_port,
782 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500783
784 def tearDown(self):
785 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800786 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500787
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700788 def show_commands_at_teardown(self):
789 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800790 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700791
Dave Wallaced85075e2018-03-02 13:19:30 -0500792 def test_vcl_thru_host_stack_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200793 """run VCL thru host stack bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500794
795 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200796 self.thru_host_stack_test(
797 "vcl_test_server",
798 self.server_args,
799 "vcl_test_client",
800 self.client_bi_dir_nsock_test_args,
801 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500802
803
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000804@unittest.skipIf(
805 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
806)
Florin Corasdc2e2512018-12-03 17:47:26 -0800807class LDPThruHostStackBidirNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200808 """LDP Thru Host Stack Bidir Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500809
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800810 @classmethod
811 def setUpClass(cls):
812 super(LDPThruHostStackBidirNsock, cls).setUpClass()
813
814 @classmethod
815 def tearDownClass(cls):
816 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
817
Dave Wallaced85075e2018-03-02 13:19:30 -0500818 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800819 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500820
821 self.thru_host_stack_setup()
Dave Wallace3102c382020-04-03 19:48:48 -0400822 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200823 self.client_bi_dir_nsock_test_args = [
824 "-N",
825 "1000",
826 "-B",
827 "-X",
828 # OUCH! Host Stack Bug?
829 # Only fails when running
830 # 'make test TEST_JOBS=auto'
831 # or TEST_JOBS > 1
832 # "-I", "2",
833 self.loop0.local_ip4,
834 self.server_port,
835 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500836
837 def tearDown(self):
838 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800839 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500840
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700841 def show_commands_at_teardown(self):
842 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800843 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700844
Dave Wallaced85075e2018-03-02 13:19:30 -0500845 def test_ldp_thru_host_stack_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200846 """run LDP thru host stack bi-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500847
848 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200849 self.thru_host_stack_test(
850 "sock_test_server",
851 self.server_args,
852 "sock_test_client",
853 self.client_bi_dir_nsock_test_args,
854 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500855
856
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000857@unittest.skipIf(
858 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
859)
Florin Corasdc2e2512018-12-03 17:47:26 -0800860class LDPThruHostStackNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200861 """LDP Thru Host Stack Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500862
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800863 @classmethod
864 def setUpClass(cls):
865 super(LDPThruHostStackNsock, cls).setUpClass()
866
867 @classmethod
868 def tearDownClass(cls):
869 super(LDPThruHostStackNsock, cls).tearDownClass()
870
Dave Wallaced85075e2018-03-02 13:19:30 -0500871 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800872 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500873
874 self.thru_host_stack_setup()
875 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800876 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500877 self.numSockets = "2"
878 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800879 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500880 self.numSockets = "5"
881
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200882 self.client_uni_dir_nsock_test_args = [
883 "-N",
884 "1000",
885 "-U",
886 "-X",
887 "-I",
888 self.numSockets,
889 self.loop0.local_ip4,
890 self.server_port,
891 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500892
893 def tearDown(self):
894 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800895 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500896
Dave Wallaced85075e2018-03-02 13:19:30 -0500897 def test_ldp_thru_host_stack_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200898 """run LDP thru host stack uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500899
900 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200901 self.thru_host_stack_test(
902 "sock_test_server",
903 self.server_args,
904 "sock_test_client",
905 self.client_uni_dir_nsock_test_args,
906 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500907
908
Dmitry Valter34fa0ce2024-03-11 10:38:46 +0000909@unittest.skipIf(
910 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
911)
Florin Corasdc2e2512018-12-03 17:47:26 -0800912class VCLThruHostStackNsock(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200913 """VCL Thru Host Stack Nsock"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500914
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800915 @classmethod
916 def setUpClass(cls):
917 super(VCLThruHostStackNsock, cls).setUpClass()
918
919 @classmethod
920 def tearDownClass(cls):
921 super(VCLThruHostStackNsock, cls).tearDownClass()
922
Dave Wallaced85075e2018-03-02 13:19:30 -0500923 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800924 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500925
926 self.thru_host_stack_setup()
927 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800928 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500929 self.numSockets = "2"
930 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800931 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500932 self.numSockets = "5"
933
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200934 self.client_uni_dir_nsock_test_args = [
935 "-N",
936 "1000",
937 "-U",
938 "-X",
939 "-I",
940 self.numSockets,
941 self.loop0.local_ip4,
942 self.server_port,
943 ]
Dave Wallaced85075e2018-03-02 13:19:30 -0500944
945 def tearDown(self):
946 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800947 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500948
Dave Wallaced85075e2018-03-02 13:19:30 -0500949 def test_vcl_thru_host_stack_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200950 """run VCL thru host stack uni-directional (multiple sockets) test"""
Dave Wallaced85075e2018-03-02 13:19:30 -0500951
952 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200953 self.thru_host_stack_test(
954 "vcl_test_server",
955 self.server_args,
956 "vcl_test_client",
957 self.client_uni_dir_nsock_test_args,
958 )
Dave Wallaced85075e2018-03-02 13:19:30 -0500959
960
Florin Corasdc2e2512018-12-03 17:47:26 -0800961class LDPThruHostStackIperf(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200962 """LDP Thru Host Stack Iperf"""
Dave Wallace816833f2018-03-14 20:01:28 -0400963
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800964 @classmethod
965 def setUpClass(cls):
966 super(LDPThruHostStackIperf, cls).setUpClass()
967
968 @classmethod
969 def tearDownClass(cls):
970 super(LDPThruHostStackIperf, cls).tearDownClass()
971
Dave Wallace816833f2018-03-14 20:01:28 -0400972 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800973 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400974
975 self.thru_host_stack_setup()
976 self.client_iperf3_timeout = 20
Florin Coras1d879142021-05-06 00:08:18 -0700977 self.client_iperf3_args = ["-4", "-t 2", "-c", self.loop0.local_ip4]
978 self.server_iperf3_args = ["-4", "-s"]
Dave Wallace816833f2018-03-14 20:01:28 -0400979
980 def tearDown(self):
981 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800982 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400983
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700984 def show_commands_at_teardown(self):
985 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -0800986 self.logger.debug(self.vapi.cli("show app mq"))
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700987
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400988 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -0400989 def test_ldp_thru_host_stack_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200990 """run LDP thru host stack iperf3 test"""
Dave Wallace816833f2018-03-14 20:01:28 -0400991
Dave Wallace816833f2018-03-14 20:01:28 -0400992 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200993 self.thru_host_stack_test(
994 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
995 )
Dave Wallace816833f2018-03-14 20:01:28 -0400996
Liangxing Wang22112772022-05-13 04:24:19 +0000997 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
998 def test_ldp_thru_host_stack_iperf3_mss(self):
999 """run LDP thru host stack iperf3 test with mss option"""
1000
1001 self.timeout = self.client_iperf3_timeout
1002 self.client_iperf3_args.append("-M 1000")
1003 self.thru_host_stack_test(
1004 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1005 )
1006
Dave Wallace816833f2018-03-14 20:01:28 -04001007
Florin Coras57a5a2d2020-04-01 23:16:11 +00001008class LDPThruHostStackIperfUdp(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001009 """LDP Thru Host Stack Iperf UDP"""
Florin Coras57a5a2d2020-04-01 23:16:11 +00001010
1011 @classmethod
1012 def setUpClass(cls):
1013 super(LDPThruHostStackIperfUdp, cls).setUpClass()
1014
1015 @classmethod
1016 def tearDownClass(cls):
1017 super(LDPThruHostStackIperfUdp, cls).tearDownClass()
1018
1019 def setUp(self):
1020 super(LDPThruHostStackIperfUdp, self).setUp()
1021
1022 self.thru_host_stack_setup()
1023 self.client_iperf3_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001024 self.client_iperf3_args = [
1025 "-4",
1026 "-t 2",
1027 "-u",
1028 "-l 1400",
Florin Corasd921b892023-05-25 12:04:53 -07001029 "-P 2",
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001030 "-c",
1031 self.loop0.local_ip4,
1032 ]
Florin Coras1d879142021-05-06 00:08:18 -07001033 self.server_iperf3_args = ["-4", "-s"]
Florin Coras57a5a2d2020-04-01 23:16:11 +00001034
1035 def tearDown(self):
1036 self.thru_host_stack_tear_down()
1037 super(LDPThruHostStackIperfUdp, self).tearDown()
1038
1039 def show_commands_at_teardown(self):
1040 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras41d5f542021-01-15 13:49:33 -08001041 self.logger.debug(self.vapi.cli("show app mq"))
Florin Coras57a5a2d2020-04-01 23:16:11 +00001042
1043 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
1044 def test_ldp_thru_host_stack_iperf3_udp(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001045 """run LDP thru host stack iperf3 UDP test"""
Florin Coras57a5a2d2020-04-01 23:16:11 +00001046
1047 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001048 self.thru_host_stack_test(
1049 iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args
1050 )
Florin Coras57a5a2d2020-04-01 23:16:11 +00001051
1052
Florin Coras0ae445e2018-11-29 18:22:10 -08001053class LDPIpv6CutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001054 """LDP IPv6 Cut Thru Tests"""
Dave Wallacede910062018-03-20 09:22:13 -04001055
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001056 @classmethod
1057 def setUpClass(cls):
1058 super(LDPIpv6CutThruTestCase, cls).setUpClass()
1059
1060 @classmethod
1061 def tearDownClass(cls):
1062 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
1063
Florin Coras41d5f542021-01-15 13:49:33 -08001064 def show_commands_at_teardown(self):
1065 self.logger.debug(self.vapi.cli("show session verbose 2"))
1066 self.logger.debug(self.vapi.cli("show app mq"))
1067
Dave Wallacede910062018-03-20 09:22:13 -04001068 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001069 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -04001070
1071 self.cut_thru_setup()
1072 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -08001073 self.client_uni_dir_nsock_timeout = 20
1074 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001075 self.client_ipv6_echo_test_args = [
1076 "-6",
1077 "-E",
1078 self.echo_phrase,
1079 "-X",
1080 self.server_ipv6_addr,
1081 self.server_port,
1082 ]
1083 self.client_ipv6_iperf3_args = ["-6", "-t 2", "-c", self.server_ipv6_addr]
Florin Coras1d879142021-05-06 00:08:18 -07001084 self.server_ipv6_iperf3_args = ["-6", "-s"]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001085 self.client_ipv6_uni_dir_nsock_test_args = [
1086 "-N",
1087 "1000",
1088 "-U",
1089 "-X",
1090 "-6",
1091 "-I",
1092 "2",
1093 self.server_ipv6_addr,
1094 self.server_port,
1095 ]
1096 self.client_ipv6_bi_dir_nsock_test_args = [
1097 "-N",
1098 "1000",
1099 "-B",
1100 "-X",
1101 "-6",
1102 "-I",
1103 "2",
1104 self.server_ipv6_addr,
1105 self.server_port,
1106 ]
Dave Wallacede910062018-03-20 09:22:13 -04001107
1108 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001109 super(LDPIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -04001110 self.cut_thru_tear_down()
Dave Wallacede910062018-03-20 09:22:13 -04001111
Klement Sekerab23ffd72021-05-31 16:08:53 +02001112 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001113 def test_ldp_ipv6_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001114 """run LDP IPv6 cut thru echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001115
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001116 self.cut_thru_test(
1117 "sock_test_server",
1118 self.server_ipv6_args,
1119 "sock_test_client",
1120 self.client_ipv6_echo_test_args,
1121 )
Dave Wallacede910062018-03-20 09:22:13 -04001122
Paul Vinciguerra063366e2019-06-30 15:38:55 -04001123 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallacede910062018-03-20 09:22:13 -04001124 def test_ldp_ipv6_cut_thru_iperf3(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001125 """run LDP IPv6 cut thru iperf3 test"""
Dave Wallacede910062018-03-20 09:22:13 -04001126
Dave Wallacede910062018-03-20 09:22:13 -04001127 self.timeout = self.client_iperf3_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001128 self.cut_thru_test(
1129 iperf3, self.server_ipv6_iperf3_args, iperf3, self.client_ipv6_iperf3_args
1130 )
Dave Wallacede910062018-03-20 09:22:13 -04001131
Klement Sekerab23ffd72021-05-31 16:08:53 +02001132 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001133 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001134 """run LDP IPv6 cut thru uni-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001135
1136 self.timeout = self.client_uni_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001137 self.cut_thru_test(
1138 "sock_test_server",
1139 self.server_ipv6_args,
1140 "sock_test_client",
1141 self.client_ipv6_uni_dir_nsock_test_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")
Florin Coras0f46e162019-07-02 19:33:15 -07001145 @unittest.skip("sock test apps need to be improved")
Dave Wallacede910062018-03-20 09:22:13 -04001146 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001147 """run LDP IPv6 cut thru bi-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001148
1149 self.timeout = self.client_bi_dir_nsock_timeout
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001150 self.cut_thru_test(
1151 "sock_test_server",
1152 self.server_ipv6_args,
1153 "sock_test_client",
1154 self.client_ipv6_bi_dir_nsock_test_args,
1155 )
Dave Wallacede910062018-03-20 09:22:13 -04001156
Florin Coras0ae445e2018-11-29 18:22:10 -08001157
Dmitry Valter34fa0ce2024-03-11 10:38:46 +00001158@unittest.skipIf(
1159 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
1160)
Florin Coras0ae445e2018-11-29 18:22:10 -08001161class VCLIpv6CutThruTestCase(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001162 """VCL IPv6 Cut Thru Tests"""
Florin Coras0ae445e2018-11-29 18:22:10 -08001163
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001164 @classmethod
1165 def setUpClass(cls):
1166 super(VCLIpv6CutThruTestCase, cls).setUpClass()
1167
1168 @classmethod
1169 def tearDownClass(cls):
1170 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
1171
Florin Coras41d5f542021-01-15 13:49:33 -08001172 def show_commands_at_teardown(self):
1173 self.logger.debug(self.vapi.cli("show session verbose 2"))
1174 self.logger.debug(self.vapi.cli("show app mq"))
1175
Florin Coras0ae445e2018-11-29 18:22:10 -08001176 def setUp(self):
1177 super(VCLIpv6CutThruTestCase, self).setUp()
1178
1179 self.cut_thru_setup()
1180 self.client_uni_dir_nsock_timeout = 20
1181 self.client_bi_dir_nsock_timeout = 20
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001182 self.client_ipv6_echo_test_args = [
1183 "-6",
1184 "-E",
1185 self.echo_phrase,
1186 "-X",
1187 self.server_ipv6_addr,
1188 self.server_port,
1189 ]
1190 self.client_ipv6_uni_dir_nsock_test_args = [
1191 "-N",
1192 "1000",
1193 "-U",
1194 "-X",
1195 "-6",
1196 "-I",
1197 "2",
1198 self.server_ipv6_addr,
1199 self.server_port,
1200 ]
1201 self.client_ipv6_bi_dir_nsock_test_args = [
1202 "-N",
1203 "1000",
1204 "-B",
1205 "-X",
1206 "-6",
1207 "-I",
1208 "2",
1209 self.server_ipv6_addr,
1210 self.server_port,
1211 ]
Florin Coras0ae445e2018-11-29 18:22:10 -08001212
1213 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -08001214 super(VCLIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -04001215 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -08001216
Florin Coras41d5f542021-01-15 13:49:33 -08001217 def show_commands_at_teardown(self):
1218 self.logger.debug(self.vapi.cli("show session verbose 2"))
1219 self.logger.debug(self.vapi.cli("show app mq"))
1220
Dave Wallacede910062018-03-20 09:22:13 -04001221 def test_vcl_ipv6_cut_thru_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001222 """run VCL IPv6 cut thru echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001223
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001224 self.cut_thru_test(
1225 "vcl_test_server",
1226 self.server_ipv6_args,
1227 "vcl_test_client",
1228 self.client_ipv6_echo_test_args,
1229 )
Dave Wallacede910062018-03-20 09:22:13 -04001230
Klement Sekerab23ffd72021-05-31 16:08:53 +02001231 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -04001232 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001233 """run VCL IPv6 cut thru uni-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001234
1235 self.timeout = self.client_uni_dir_nsock_timeout
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_uni_dir_nsock_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_bi_dir_nsock(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001245 """run VCL IPv6 cut thru bi-directional (multiple sockets) test"""
Dave Wallacede910062018-03-20 09:22:13 -04001246
1247 self.timeout = self.client_bi_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_bi_dir_nsock_test_args,
1253 )
Dave Wallacede910062018-03-20 09:22:13 -04001254
1255
Dmitry Valter34fa0ce2024-03-11 10:38:46 +00001256@unittest.skipIf(
1257 "hs_apps" in config.excluded_plugins, "Exclude tests requiring hs_apps plugin"
1258)
Florin Corasdc2e2512018-12-03 17:47:26 -08001259class VCLIpv6ThruHostStackEcho(VCLTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001260 """VCL IPv6 Thru Host Stack Echo"""
Dave Wallacede910062018-03-20 09:22:13 -04001261
Paul Vinciguerra8d991d92019-01-25 14:05:48 -08001262 @classmethod
1263 def setUpClass(cls):
1264 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
1265
1266 @classmethod
1267 def tearDownClass(cls):
1268 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
1269
Dave Wallacede910062018-03-20 09:22:13 -04001270 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -08001271 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -04001272
1273 self.thru_host_stack_ipv6_setup()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001274 self.client_ipv6_echo_test_args = [
1275 "-6",
1276 "-E",
1277 self.echo_phrase,
1278 "-X",
1279 self.loop0.local_ip6,
1280 self.server_port,
1281 ]
Dave Wallacede910062018-03-20 09:22:13 -04001282
1283 def tearDown(self):
1284 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -08001285 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -04001286
1287 def test_vcl_ipv6_thru_host_stack_echo(self):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001288 """run VCL IPv6 thru host stack echo test"""
Dave Wallacede910062018-03-20 09:22:13 -04001289
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001290 self.thru_host_stack_test(
1291 "vcl_test_server",
1292 self.server_ipv6_args,
1293 "vcl_test_client",
1294 self.client_ipv6_echo_test_args,
1295 )
Dave Wallacede910062018-03-20 09:22:13 -04001296
1297
Klement Sekerad9b0c6f2022-04-26 19:02:15 +02001298if __name__ == "__main__":
Dave Wallacecfcf2f42018-02-16 18:31:56 -05001299 unittest.main(testRunner=VppTestRunner)