blob: 0ef4b5c079e1e1635bfd1c962b96aef80c7d041d [file] [log] [blame]
Dave Wallacecfcf2f42018-02-16 18:31:56 -05001#!/usr/bin/env python
2""" 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
Dave Wallaced85075e2018-03-02 13:19:30 -05008from framework import VppTestCase, VppTestRunner, running_extended_tests, \
9 Worker
Florin Coras56b39f62018-03-27 17:29:32 -070010from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, DpoProto
Dave Wallacecfcf2f42018-02-16 18:31:56 -050011
12
Dave Wallace816833f2018-03-14 20:01:28 -040013class VCLAppWorker(Worker):
Dave Wallace42996c02018-02-26 14:40:13 -050014 """ VCL Test Application Worker """
15
Dave Wallaced85075e2018-03-02 13:19:30 -050016 def __init__(self, build_dir, appname, args, logger, env={}):
Damjan Marion855e2682018-08-24 13:37:45 +020017 vcl_lib_dir = "%s/vpp/lib" % build_dir
Dave Wallace816833f2018-03-14 20:01:28 -040018 if "iperf" in appname:
19 app = appname
Dave Wallace9f11c012018-02-28 17:55:23 -050020 env.update({'LD_PRELOAD':
Damjan Marion855e2682018-08-24 13:37:45 +020021 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Florin Corasab2f6db2018-08-31 14:31:41 -070022 elif "sock" in appname:
23 app = "%s/vpp/bin/%s" % (build_dir, appname)
24 env.update({'LD_PRELOAD':
25 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Dave Wallace816833f2018-03-14 20:01:28 -040026 else:
Florin Corasab2f6db2018-08-31 14:31:41 -070027 app = "%s/vpp/bin/%s" % (build_dir, appname)
Dave Wallace9f11c012018-02-28 17:55:23 -050028 self.args = [app] + args
Dave Wallace816833f2018-03-14 20:01:28 -040029 super(VCLAppWorker, self).__init__(self.args, logger, env)
Dave Wallace42996c02018-02-26 14:40:13 -050030
31
Dave Wallace816833f2018-03-14 20:01:28 -040032class VCLTestCase(VppTestCase):
Dave Wallace42996c02018-02-26 14:40:13 -050033 """ VCL Test Class """
34
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080035 @classmethod
36 def setUpClass(cls):
37 super(VCLTestCase, cls).setUpClass()
38
39 @classmethod
40 def tearDownClass(cls):
41 super(VCLTestCase, cls).tearDownClass()
42
43 def setUp(self):
Klement Sekerab8c72a42018-11-08 11:21:39 +010044 var = "VPP_BUILD_DIR"
Dave Wallaced85075e2018-03-02 13:19:30 -050045 self.build_dir = os.getenv(var, None)
46 if self.build_dir is None:
47 raise Exception("Environment variable `%s' not set" % var)
48 self.vppDebug = 'vpp_debug' in self.build_dir
Dave Wallace9f11c012018-02-28 17:55:23 -050049 self.server_addr = "127.0.0.1"
50 self.server_port = "22000"
Dave Wallace816833f2018-03-14 20:01:28 -040051 self.server_args = [self.server_port]
Dave Wallacede910062018-03-20 09:22:13 -040052 self.server_ipv6_addr = "::1"
53 self.server_ipv6_args = ["-6", self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -080054 self.timeout = 20
Dave Wallace9f11c012018-02-28 17:55:23 -050055 self.echo_phrase = "Hello, world! Jenny is a friend of mine."
Florin Corasdc2e2512018-12-03 17:47:26 -080056 self.pre_test_sleep = 0.3
57 self.post_test_sleep = 0.2
58
59 if os.path.isfile("/tmp/ldp_server_af_unix_socket"):
60 os.remove("/tmp/ldp_server_af_unix_socket")
Dave Wallace42996c02018-02-26 14:40:13 -050061
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080062 super(VCLTestCase, self).setUp()
Dave Wallace42996c02018-02-26 14:40:13 -050063
Dave Wallace9f11c012018-02-28 17:55:23 -050064 def cut_thru_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050065 self.vapi.session_enable_disable(is_enabled=1)
66
Dave Wallace9f11c012018-02-28 17:55:23 -050067 def cut_thru_tear_down(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050068 self.vapi.session_enable_disable(is_enabled=0)
69
Dave Wallace816833f2018-03-14 20:01:28 -040070 def cut_thru_test(self, server_app, server_args, client_app, client_args):
Dave Wallace42996c02018-02-26 14:40:13 -050071 self.env = {'VCL_API_PREFIX': self.shm_prefix,
72 'VCL_APP_SCOPE_LOCAL': "true"}
73
Dave Wallace816833f2018-03-14 20:01:28 -040074 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -050075 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050076 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -080077 self.sleep(self.pre_test_sleep)
Dave Wallace816833f2018-03-14 20:01:28 -040078 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -050079 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050080 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -050081 worker_client.join(self.timeout)
Dave Wallacefef3f7b2018-03-09 12:04:10 -050082 try:
83 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +020084 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -050085 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -080086 self.sleep(self.post_test_sleep)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050087
Dave Wallace9f11c012018-02-28 17:55:23 -050088 def thru_host_stack_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050089 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +020090 self.create_loopback_interfaces(2)
Dave Wallacea67a03e2018-02-20 12:39:37 -050091
Florin Coras56b39f62018-03-27 17:29:32 -070092 table_id = 1
Dave Wallacea67a03e2018-02-20 12:39:37 -050093
94 for i in self.lo_interfaces:
95 i.admin_up()
96
97 if table_id != 0:
98 tbl = VppIpTable(self, table_id)
99 tbl.add_vpp_config()
100
101 i.set_table_ip4(table_id)
102 i.config_ip4()
103 table_id += 1
104
105 # Configure namespaces
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800106 self.vapi.app_namespace_add_del(namespace_id=b"1", secret=1234,
Ole Troane1ade682019-03-04 23:55:43 +0100107 sw_if_index=self.loop0.sw_if_index)
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800108 self.vapi.app_namespace_add_del(namespace_id=b"2", secret=5678,
Ole Troane1ade682019-03-04 23:55:43 +0100109 sw_if_index=self.loop1.sw_if_index)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500110
Dave Wallacea67a03e2018-02-20 12:39:37 -0500111 # Add inter-table routes
112 ip_t01 = VppIpRoute(self, self.loop1.local_ip4, 32,
113 [VppRoutePath("0.0.0.0",
114 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700115 nh_table_id=2)], table_id=1)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500116 ip_t10 = VppIpRoute(self, self.loop0.local_ip4, 32,
117 [VppRoutePath("0.0.0.0",
118 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700119 nh_table_id=1)], table_id=2)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500120 ip_t01.add_vpp_config()
121 ip_t10.add_vpp_config()
Florin Coras56b39f62018-03-27 17:29:32 -0700122 self.logger.debug(self.vapi.cli("show ip fib"))
Dave Wallacea67a03e2018-02-20 12:39:37 -0500123
Dave Wallace9f11c012018-02-28 17:55:23 -0500124 def thru_host_stack_tear_down(self):
125 for i in self.lo_interfaces:
126 i.unconfig_ip4()
127 i.set_table_ip4(0)
128 i.admin_down()
129
130 self.vapi.session_enable_disable(is_enabled=0)
131
Dave Wallacede910062018-03-20 09:22:13 -0400132 def thru_host_stack_ipv6_setup(self):
133 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200134 self.create_loopback_interfaces(2)
Dave Wallacede910062018-03-20 09:22:13 -0400135
136 table_id = 1
137
138 for i in self.lo_interfaces:
139 i.admin_up()
140
141 tbl = VppIpTable(self, table_id, is_ip6=1)
142 tbl.add_vpp_config()
143
144 i.set_table_ip6(table_id)
145 i.config_ip6()
146 table_id += 1
147
148 # Configure namespaces
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800149 self.vapi.app_namespace_add_del(namespace_id=b"1", secret=1234,
Ole Troane1ade682019-03-04 23:55:43 +0100150 sw_if_index=self.loop0.sw_if_index)
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800151 self.vapi.app_namespace_add_del(namespace_id=b"2", secret=5678,
Ole Troane1ade682019-03-04 23:55:43 +0100152 sw_if_index=self.loop1.sw_if_index)
Dave Wallacede910062018-03-20 09:22:13 -0400153
154 # Add inter-table routes
155 ip_t01 = VppIpRoute(self, self.loop1.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700156 [VppRoutePath("::0", 0xffffffff,
157 nh_table_id=2,
158 proto=DpoProto.DPO_PROTO_IP6)],
Dave Wallacede910062018-03-20 09:22:13 -0400159 table_id=1, is_ip6=1)
160 ip_t10 = VppIpRoute(self, self.loop0.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700161 [VppRoutePath("::0", 0xffffffff,
162 nh_table_id=1,
163 proto=DpoProto.DPO_PROTO_IP6)],
Dave Wallacede910062018-03-20 09:22:13 -0400164 table_id=2, is_ip6=1)
165 ip_t01.add_vpp_config()
166 ip_t10.add_vpp_config()
167 self.logger.debug(self.vapi.cli("show interface addr"))
168 self.logger.debug(self.vapi.cli("show ip6 fib"))
169
170 def thru_host_stack_ipv6_tear_down(self):
171 for i in self.lo_interfaces:
172 i.unconfig_ip6()
173 i.set_table_ip6(0)
174 i.admin_down()
175
176 self.vapi.session_enable_disable(is_enabled=0)
177
Dave Wallace816833f2018-03-14 20:01:28 -0400178 def thru_host_stack_test(self, server_app, server_args,
179 client_app, client_args):
Dave Wallace9f11c012018-02-28 17:55:23 -0500180 self.env = {'VCL_API_PREFIX': self.shm_prefix,
181 'VCL_APP_SCOPE_GLOBAL': "true",
Florin Coras56b39f62018-03-27 17:29:32 -0700182 'VCL_APP_NAMESPACE_ID': "1",
Dave Wallace9f11c012018-02-28 17:55:23 -0500183 'VCL_APP_NAMESPACE_SECRET': "1234"}
184
Dave Wallace816833f2018-03-14 20:01:28 -0400185 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500186 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500187 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800188 self.sleep(self.pre_test_sleep)
Dave Wallace42996c02018-02-26 14:40:13 -0500189
Florin Coras56b39f62018-03-27 17:29:32 -0700190 self.env.update({'VCL_APP_NAMESPACE_ID': "2",
Dave Wallace42996c02018-02-26 14:40:13 -0500191 'VCL_APP_NAMESPACE_SECRET': "5678"})
Dave Wallace816833f2018-03-14 20:01:28 -0400192 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500193 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500194 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500195 worker_client.join(self.timeout)
196
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500197 try:
198 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200199 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500200 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800201 self.sleep(self.post_test_sleep)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500202
Dave Wallace9f11c012018-02-28 17:55:23 -0500203 def validateResults(self, worker_client, worker_server, timeout):
Dave Wallaced85075e2018-03-02 13:19:30 -0500204 if os.path.isdir('/proc/{}'.format(worker_server.process.pid)):
205 self.logger.info("Killing server worker process (pid %d)" %
206 worker_server.process.pid)
Florin Corasdc2e2512018-12-03 17:47:26 -0800207 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGKILL)
Dave Wallaced85075e2018-03-02 13:19:30 -0500208 worker_server.join()
Dave Wallace9f11c012018-02-28 17:55:23 -0500209 self.logger.info("Client worker result is `%s'" % worker_client.result)
210 error = False
211 if worker_client.result is None:
212 try:
213 error = True
214 self.logger.error(
Dave Wallaced85075e2018-03-02 13:19:30 -0500215 "Timeout: %ss! Killing client worker process (pid %d)" %
216 (timeout, worker_client.process.pid))
Dave Wallace9f11c012018-02-28 17:55:23 -0500217 os.killpg(os.getpgid(worker_client.process.pid),
Florin Corasdc2e2512018-12-03 17:47:26 -0800218 signal.SIGKILL)
Dave Wallace9f11c012018-02-28 17:55:23 -0500219 worker_client.join()
220 except:
221 self.logger.debug(
222 "Couldn't kill client worker process")
223 raise
224 if error:
Dave Wallace9f11c012018-02-28 17:55:23 -0500225 raise Exception(
226 "Timeout! Client worker did not finish in %ss" % timeout)
227 self.assert_equal(worker_client.result, 0, "Binary test return code")
228
229
Florin Coras0ae445e2018-11-29 18:22:10 -0800230class LDPCutThruTestCase(VCLTestCase):
231 """ LDP Cut Thru Tests """
Dave Wallace9f11c012018-02-28 17:55:23 -0500232
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800233 @classmethod
234 def setUpClass(cls):
235 super(LDPCutThruTestCase, cls).setUpClass()
236
237 @classmethod
238 def tearDownClass(cls):
239 super(LDPCutThruTestCase, cls).tearDownClass()
240
Dave Wallace9f11c012018-02-28 17:55:23 -0500241 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800242 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500243
244 self.cut_thru_setup()
Dave Wallacede910062018-03-20 09:22:13 -0400245 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
246 self.server_addr, self.server_port]
Dave Wallace816833f2018-03-14 20:01:28 -0400247 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800248 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.server_addr]
Dave Wallace816833f2018-03-14 20:01:28 -0400249 self.server_iperf3_args = ["-V4d", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800250 self.client_uni_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400251 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
252 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400253 self.server_addr,
254 self.server_port]
Florin Coras2eb42e72018-11-29 00:39:53 -0800255 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400256 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
257 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400258 self.server_addr,
259 self.server_port]
Dave Wallace9f11c012018-02-28 17:55:23 -0500260
261 def tearDown(self):
Florin Coras653e43f2019-03-04 10:56:23 -0800262 self.logger.debug(self.vapi.cli("show session verbose 2"))
Dave Wallace9f11c012018-02-28 17:55:23 -0500263 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -0800264 super(LDPCutThruTestCase, self).tearDown()
Dave Wallace9f11c012018-02-28 17:55:23 -0500265
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800266 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500267 def test_ldp_cut_thru_echo(self):
268 """ run LDP cut thru echo test """
269
Florin Corasab2f6db2018-08-31 14:31:41 -0700270 self.cut_thru_test("sock_test_server", self.server_args,
271 "sock_test_client", self.client_echo_test_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400272
273 def test_ldp_cut_thru_iperf3(self):
274 """ run LDP cut thru iperf3 test """
275
276 try:
277 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800278 except subprocess.CalledProcessError:
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800279 self.logger.error(
280 "WARNING: Subprocess returned non-0 running 'iperf3 -v")
Dave Wallace816833f2018-03-14 20:01:28 -0400281 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
282 return
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800283 except OSError as e:
284 self.logger.error(
285 "WARNING: Subprocess returned with OS error (%s) %s\n"
286 " 'iperf3' is likely not installed,",
287 e.errno, e.strerror)
288 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
289 return
290 except Exception:
291 self.logger.exception(
292 "Subprocess returned non-0 running 'iperf3 -v")
Dave Wallace816833f2018-03-14 20:01:28 -0400293
294 self.timeout = self.client_iperf3_timeout
295 self.cut_thru_test("iperf3", self.server_iperf3_args,
296 "iperf3", self.client_iperf3_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500297
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800298 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500299 def test_ldp_cut_thru_uni_dir_nsock(self):
300 """ run LDP cut thru uni-directional (multiple sockets) test """
301
302 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700303 self.cut_thru_test("sock_test_server", self.server_args,
304 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500305 self.client_uni_dir_nsock_test_args)
306
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800307 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500308 def test_ldp_cut_thru_bi_dir_nsock(self):
309 """ run LDP cut thru bi-directional (multiple sockets) test """
310
311 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700312 self.cut_thru_test("sock_test_server", self.server_args,
313 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500314 self.client_bi_dir_nsock_test_args)
315
Florin Coras0ae445e2018-11-29 18:22:10 -0800316
317class VCLCutThruTestCase(VCLTestCase):
318 """ VCL Cut Thru Tests """
319
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800320 @classmethod
321 def setUpClass(cls):
322 super(VCLCutThruTestCase, cls).setUpClass()
323
324 @classmethod
325 def tearDownClass(cls):
326 super(VCLCutThruTestCase, cls).tearDownClass()
327
Florin Coras0ae445e2018-11-29 18:22:10 -0800328 def setUp(self):
329 super(VCLCutThruTestCase, self).setUp()
330
331 self.cut_thru_setup()
332 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
333 self.server_addr, self.server_port]
334
335 self.client_uni_dir_nsock_timeout = 20
336 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
337 "-I", "2",
338 self.server_addr,
339 self.server_port]
340 self.client_bi_dir_nsock_timeout = 20
341 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
342 "-I", "2",
343 self.server_addr,
344 self.server_port]
345
346 def tearDown(self):
347 self.cut_thru_tear_down()
348
349 super(VCLCutThruTestCase, self).tearDown()
350
Dave Wallace9f11c012018-02-28 17:55:23 -0500351 def test_vcl_cut_thru_echo(self):
352 """ run VCL cut thru echo test """
353
Florin Corasab2f6db2018-08-31 14:31:41 -0700354 self.cut_thru_test("vcl_test_server", self.server_args,
355 "vcl_test_client", self.client_echo_test_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500356
Dave Wallaced85075e2018-03-02 13:19:30 -0500357 def test_vcl_cut_thru_uni_dir_nsock(self):
358 """ run VCL cut thru uni-directional (multiple sockets) test """
359
360 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700361 self.cut_thru_test("vcl_test_server", self.server_args,
362 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500363 self.client_uni_dir_nsock_test_args)
364
Dave Wallaced85075e2018-03-02 13:19:30 -0500365 def test_vcl_cut_thru_bi_dir_nsock(self):
366 """ run VCL cut thru bi-directional (multiple sockets) test """
367
368 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700369 self.cut_thru_test("vcl_test_server", self.server_args,
370 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500371 self.client_bi_dir_nsock_test_args)
372
Dave Wallace9f11c012018-02-28 17:55:23 -0500373
Florin Corasdc2e2512018-12-03 17:47:26 -0800374class VCLThruHostStackEcho(VCLTestCase):
375 """ VCL Thru Host Stack Echo """
Dave Wallaced85075e2018-03-02 13:19:30 -0500376
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800377 @classmethod
378 def setUpClass(cls):
379 super(VCLThruHostStackEcho, cls).setUpClass()
380
381 @classmethod
382 def tearDownClass(cls):
383 super(VCLThruHostStackEcho, cls).tearDownClass()
384
Dave Wallaced85075e2018-03-02 13:19:30 -0500385 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800386 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500387
388 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800389 self.client_bi_dir_nsock_timeout = 20
390 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
391 "-I", "2",
392 self.loop0.local_ip4,
393 self.server_port]
394 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
395 self.loop0.local_ip4,
396 self.server_port]
397
398 def tearDown(self):
399 self.logger.debug(self.vapi.cli("show app server"))
400 self.logger.debug(self.vapi.cli("show session verbose"))
401 self.thru_host_stack_tear_down()
402 super(VCLThruHostStackEcho, self).tearDown()
403
404
Florin Coras8a140612019-02-18 22:39:39 -0800405class VCLThruHostStackTLS(VCLTestCase):
406 """ VCL Thru Host Stack TLS """
407
408 @classmethod
409 def setUpClass(cls):
410 super(VCLThruHostStackTLS, cls).setUpClass()
411
412 @classmethod
413 def tearDownClass(cls):
414 super(VCLThruHostStackTLS, cls).tearDownClass()
415
416 def setUp(self):
417 super(VCLThruHostStackTLS, self).setUp()
418
419 self.thru_host_stack_setup()
420 self.client_uni_dir_tls_timeout = 20
Dave Wallace03dd90a2019-03-25 19:34:50 -0400421 self.server_tls_args = ["-L", self.server_port]
422 self.client_uni_dir_tls_test_args = ["-N", "1000", "-U", "-X", "-L",
Florin Coras8a140612019-02-18 22:39:39 -0800423 self.loop0.local_ip4,
424 self.server_port]
425
426 def test_vcl_thru_host_stack_tls_uni_dir(self):
427 """ run VCL thru host stack uni-directional TLS test """
428
429 self.timeout = self.client_uni_dir_tls_timeout
430 self.thru_host_stack_test("vcl_test_server", self.server_tls_args,
431 "vcl_test_client",
432 self.client_uni_dir_tls_test_args)
433
434 def tearDown(self):
435 self.logger.debug(self.vapi.cli("show app server"))
Florin Coras51a423d2019-02-19 20:57:06 -0800436 self.logger.debug(self.vapi.cli("show session verbose 2"))
Florin Coras8a140612019-02-18 22:39:39 -0800437 self.thru_host_stack_tear_down()
438 super(VCLThruHostStackTLS, self).tearDown()
439
440
Florin Corasdc2e2512018-12-03 17:47:26 -0800441class VCLThruHostStackBidirNsock(VCLTestCase):
442 """ VCL Thru Host Stack Bidir Nsock """
443
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800444 @classmethod
445 def setUpClass(cls):
446 super(VCLThruHostStackBidirNsock, cls).setUpClass()
447
448 @classmethod
449 def tearDownClass(cls):
450 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
451
Florin Corasdc2e2512018-12-03 17:47:26 -0800452 def setUp(self):
453 super(VCLThruHostStackBidirNsock, self).setUp()
454
455 self.thru_host_stack_setup()
456 self.client_bi_dir_nsock_timeout = 20
457 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
458 "-I", "2",
459 self.loop0.local_ip4,
460 self.server_port]
461 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
462 self.loop0.local_ip4,
463 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500464
465 def tearDown(self):
Florin Corasc0737e92019-03-04 14:19:39 -0800466 self.logger.debug(self.vapi.cli("show session verbose 2"))
Dave Wallaced85075e2018-03-02 13:19:30 -0500467 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800468 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500469
Dave Wallaced85075e2018-03-02 13:19:30 -0500470 def test_vcl_thru_host_stack_bi_dir_nsock(self):
471 """ run VCL thru host stack bi-directional (multiple sockets) test """
472
473 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700474 self.thru_host_stack_test("vcl_test_server", self.server_args,
475 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500476 self.client_bi_dir_nsock_test_args)
477
478
Florin Corasdc2e2512018-12-03 17:47:26 -0800479class LDPThruHostStackBidirNsock(VCLTestCase):
480 """ LDP Thru Host Stack Bidir Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500481
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800482 @classmethod
483 def setUpClass(cls):
484 super(LDPThruHostStackBidirNsock, cls).setUpClass()
485
486 @classmethod
487 def tearDownClass(cls):
488 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
489
Dave Wallaced85075e2018-03-02 13:19:30 -0500490 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800491 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500492
493 self.thru_host_stack_setup()
494 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800495 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400496 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
497 # OUCH! Host Stack Bug?
498 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400499 self.loop0.local_ip4,
500 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500501 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800502 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400503 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
504 # OUCH! Host Stack Bug?
505 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400506 self.loop0.local_ip4,
507 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500508
509 def tearDown(self):
Florin Corasc0737e92019-03-04 14:19:39 -0800510 self.logger.debug(self.vapi.cli("show session verbose 2"))
Dave Wallaced85075e2018-03-02 13:19:30 -0500511 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800512 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500513
Dave Wallaced85075e2018-03-02 13:19:30 -0500514 def test_ldp_thru_host_stack_bi_dir_nsock(self):
515 """ run LDP thru host stack bi-directional (multiple sockets) test """
516
517 self.timeout = self.client_bi_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400518 self.thru_host_stack_test("sock_test_server", self.server_args,
519 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500520 self.client_bi_dir_nsock_test_args)
521
522
Florin Corasdc2e2512018-12-03 17:47:26 -0800523class LDPThruHostStackNsock(VCLTestCase):
524 """ LDP Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500525
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800526 @classmethod
527 def setUpClass(cls):
528 super(LDPThruHostStackNsock, cls).setUpClass()
529
530 @classmethod
531 def tearDownClass(cls):
532 super(LDPThruHostStackNsock, cls).tearDownClass()
533
Dave Wallaced85075e2018-03-02 13:19:30 -0500534 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800535 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500536
537 self.thru_host_stack_setup()
538 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800539 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500540 self.numSockets = "2"
541 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800542 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500543 self.numSockets = "5"
544
Dave Wallace45cd3a32018-06-26 01:14:04 -0400545 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
546 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400547 self.loop0.local_ip4,
548 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500549
550 def tearDown(self):
551 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800552 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500553
Dave Wallaced85075e2018-03-02 13:19:30 -0500554 def test_ldp_thru_host_stack_uni_dir_nsock(self):
555 """ run LDP thru host stack uni-directional (multiple sockets) test """
556
557 self.timeout = self.client_uni_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400558 self.thru_host_stack_test("sock_test_server", self.server_args,
559 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500560 self.client_uni_dir_nsock_test_args)
561
562
Florin Corasdc2e2512018-12-03 17:47:26 -0800563class VCLThruHostStackNsock(VCLTestCase):
564 """ VCL Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500565
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800566 @classmethod
567 def setUpClass(cls):
568 super(VCLThruHostStackNsock, cls).setUpClass()
569
570 @classmethod
571 def tearDownClass(cls):
572 super(VCLThruHostStackNsock, cls).tearDownClass()
573
Dave Wallaced85075e2018-03-02 13:19:30 -0500574 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800575 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500576
577 self.thru_host_stack_setup()
578 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800579 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500580 self.numSockets = "2"
581 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800582 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500583 self.numSockets = "5"
584
Dave Wallace45cd3a32018-06-26 01:14:04 -0400585 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
586 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400587 self.loop0.local_ip4,
588 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500589
590 def tearDown(self):
591 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800592 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500593
Dave Wallaced85075e2018-03-02 13:19:30 -0500594 def test_vcl_thru_host_stack_uni_dir_nsock(self):
595 """ run VCL thru host stack uni-directional (multiple sockets) test """
596
597 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700598 self.thru_host_stack_test("vcl_test_server", self.server_args,
599 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500600 self.client_uni_dir_nsock_test_args)
601
602
Florin Corasdc2e2512018-12-03 17:47:26 -0800603class LDPThruHostStackIperf(VCLTestCase):
604 """ LDP Thru Host Stack Iperf """
Dave Wallace816833f2018-03-14 20:01:28 -0400605
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800606 @classmethod
607 def setUpClass(cls):
608 super(LDPThruHostStackIperf, cls).setUpClass()
609
610 @classmethod
611 def tearDownClass(cls):
612 super(LDPThruHostStackIperf, cls).tearDownClass()
613
Dave Wallace816833f2018-03-14 20:01:28 -0400614 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800615 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400616
617 self.thru_host_stack_setup()
618 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800619 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.loop0.local_ip4]
Dave Wallace816833f2018-03-14 20:01:28 -0400620 self.server_iperf3_args = ["-V4d", "-s"]
621
622 def tearDown(self):
Florin Coras51a423d2019-02-19 20:57:06 -0800623 self.logger.debug(self.vapi.cli("show session verbose 2"))
Dave Wallace816833f2018-03-14 20:01:28 -0400624 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800625 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400626
627 def test_ldp_thru_host_stack_iperf3(self):
628 """ run LDP thru host stack iperf3 test """
629
630 try:
631 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800632 except subprocess.CalledProcessError:
Dave Wallace816833f2018-03-14 20:01:28 -0400633 self.logger.error("WARNING: 'iperf3' is not installed,")
634 self.logger.error(
635 " 'test_ldp_thru_host_stack_iperf3' not run!")
636 return
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800637 except OSError as e:
638 self.logger.error("WARNING: 'iperf3' is not installed,")
639 self.logger.error(" 'test' not run!")
640 return
641 except Exception as e:
642 self.logger.error("WARNING: 'iperf3' unexpected error,")
643 self.logger.error(" 'test' not run!")
644 return
Dave Wallace816833f2018-03-14 20:01:28 -0400645
646 self.timeout = self.client_iperf3_timeout
647 self.thru_host_stack_test("iperf3", self.server_iperf3_args,
648 "iperf3", self.client_iperf3_args)
649
650
Florin Coras0ae445e2018-11-29 18:22:10 -0800651class LDPIpv6CutThruTestCase(VCLTestCase):
652 """ LDP IPv6 Cut Thru Tests """
Dave Wallacede910062018-03-20 09:22:13 -0400653
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800654 @classmethod
655 def setUpClass(cls):
656 super(LDPIpv6CutThruTestCase, cls).setUpClass()
657
658 @classmethod
659 def tearDownClass(cls):
660 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
661
Dave Wallacede910062018-03-20 09:22:13 -0400662 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800663 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400664
665 self.cut_thru_setup()
666 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -0800667 self.client_uni_dir_nsock_timeout = 20
668 self.client_bi_dir_nsock_timeout = 20
Dave Wallacede910062018-03-20 09:22:13 -0400669 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
670 self.server_ipv6_addr,
671 self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -0800672 self.client_ipv6_iperf3_args = ["-V6d", "-t 2", "-c",
Florin Corasab2f6db2018-08-31 14:31:41 -0700673 self.server_ipv6_addr]
Dave Wallacede910062018-03-20 09:22:13 -0400674 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400675 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
676 "-6",
677 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400678 self.server_ipv6_addr,
679 self.server_port]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400680 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
681 "-6",
682 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400683 self.server_ipv6_addr,
684 self.server_port]
685
686 def tearDown(self):
687 self.cut_thru_tear_down()
688
Florin Coras0ae445e2018-11-29 18:22:10 -0800689 super(LDPIpv6CutThruTestCase, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400690
691 def test_ldp_ipv6_cut_thru_echo(self):
692 """ run LDP IPv6 cut thru echo test """
693
Florin Corasab2f6db2018-08-31 14:31:41 -0700694 self.cut_thru_test("sock_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400695 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700696 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400697 self.client_ipv6_echo_test_args)
698
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800699 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400700 def test_ldp_ipv6_cut_thru_iperf3(self):
701 """ run LDP IPv6 cut thru iperf3 test """
702
703 try:
704 subprocess.check_output(['iperf3', '-v'])
705 except:
706 self.logger.error("WARNING: 'iperf3' is not installed,")
707 self.logger.error(
708 " 'test_ldp_ipv6_cut_thru_iperf3' not run!")
709 return
710
711 self.timeout = self.client_iperf3_timeout
712 self.cut_thru_test("iperf3", self.server_ipv6_iperf3_args,
713 "iperf3", self.client_ipv6_iperf3_args)
714
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800715 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400716 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
717 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
718
719 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700720 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
721 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400722 self.client_ipv6_uni_dir_nsock_test_args)
723
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800724 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400725 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
726 """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """
727
728 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700729 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
730 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400731 self.client_ipv6_bi_dir_nsock_test_args)
732
Florin Coras0ae445e2018-11-29 18:22:10 -0800733
734class VCLIpv6CutThruTestCase(VCLTestCase):
735 """ VCL IPv6 Cut Thru Tests """
736
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800737 @classmethod
738 def setUpClass(cls):
739 super(VCLIpv6CutThruTestCase, cls).setUpClass()
740
741 @classmethod
742 def tearDownClass(cls):
743 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
744
Florin Coras0ae445e2018-11-29 18:22:10 -0800745 def setUp(self):
746 super(VCLIpv6CutThruTestCase, self).setUp()
747
748 self.cut_thru_setup()
749 self.client_uni_dir_nsock_timeout = 20
750 self.client_bi_dir_nsock_timeout = 20
751 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
752 self.server_ipv6_addr,
753 self.server_port]
754 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
755 "-6",
756 "-I", "2",
757 self.server_ipv6_addr,
758 self.server_port]
759 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
760 "-6",
761 "-I", "2",
762 self.server_ipv6_addr,
763 self.server_port]
764
765 def tearDown(self):
766 self.cut_thru_tear_down()
767
768 super(VCLIpv6CutThruTestCase, self).tearDown()
769
Dave Wallacede910062018-03-20 09:22:13 -0400770 def test_vcl_ipv6_cut_thru_echo(self):
771 """ run VCL IPv6 cut thru echo test """
772
Florin Corasab2f6db2018-08-31 14:31:41 -0700773 self.cut_thru_test("vcl_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400774 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700775 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400776 self.client_ipv6_echo_test_args)
777
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800778 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400779 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
780 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
781
782 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700783 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
784 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400785 self.client_ipv6_uni_dir_nsock_test_args)
786
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800787 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400788 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
789 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
790
791 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700792 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
793 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400794 self.client_ipv6_bi_dir_nsock_test_args)
795
796
Florin Corasdc2e2512018-12-03 17:47:26 -0800797class VCLIpv6ThruHostStackEcho(VCLTestCase):
798 """ VCL IPv6 Thru Host Stack Echo """
Dave Wallacede910062018-03-20 09:22:13 -0400799
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800800 @classmethod
801 def setUpClass(cls):
802 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
803
804 @classmethod
805 def tearDownClass(cls):
806 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
807
Dave Wallacede910062018-03-20 09:22:13 -0400808 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800809 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400810
811 self.thru_host_stack_ipv6_setup()
812 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
813 self.loop0.local_ip6,
814 self.server_port]
815
816 def tearDown(self):
817 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800818 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400819
820 def test_vcl_ipv6_thru_host_stack_echo(self):
821 """ run VCL IPv6 thru host stack echo test """
822
Florin Corasdc2e2512018-12-03 17:47:26 -0800823 self.thru_host_stack_test("vcl_test_server",
Damjan Marion855e2682018-08-24 13:37:45 +0200824 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700825 "vcl_test_client",
Florin Corasdc2e2512018-12-03 17:47:26 -0800826 self.client_ipv6_echo_test_args)
Dave Wallacede910062018-03-20 09:22:13 -0400827
828
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500829if __name__ == '__main__':
830 unittest.main(testRunner=VppTestRunner)