blob: e49c9d800e06d8dbe2e9f5cc72fab857901516a6 [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):
262 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -0800263 super(LDPCutThruTestCase, self).tearDown()
Dave Wallace9f11c012018-02-28 17:55:23 -0500264
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700265 def show_commands_at_teardown(self):
266 self.logger.debug(self.vapi.cli("show session verbose 2"))
267
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800268 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500269 def test_ldp_cut_thru_echo(self):
270 """ run LDP cut thru echo test """
271
Florin Corasab2f6db2018-08-31 14:31:41 -0700272 self.cut_thru_test("sock_test_server", self.server_args,
273 "sock_test_client", self.client_echo_test_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400274
275 def test_ldp_cut_thru_iperf3(self):
276 """ run LDP cut thru iperf3 test """
277
278 try:
279 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800280 except subprocess.CalledProcessError:
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800281 self.logger.error(
282 "WARNING: Subprocess returned non-0 running 'iperf3 -v")
Dave Wallace816833f2018-03-14 20:01:28 -0400283 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
284 return
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800285 except OSError as e:
286 self.logger.error(
287 "WARNING: Subprocess returned with OS error (%s) %s\n"
288 " 'iperf3' is likely not installed,",
289 e.errno, e.strerror)
290 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
291 return
292 except Exception:
293 self.logger.exception(
294 "Subprocess returned non-0 running 'iperf3 -v")
Dave Wallace816833f2018-03-14 20:01:28 -0400295
296 self.timeout = self.client_iperf3_timeout
297 self.cut_thru_test("iperf3", self.server_iperf3_args,
298 "iperf3", self.client_iperf3_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500299
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800300 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500301 def test_ldp_cut_thru_uni_dir_nsock(self):
302 """ run LDP cut thru uni-directional (multiple sockets) test """
303
304 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700305 self.cut_thru_test("sock_test_server", self.server_args,
306 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500307 self.client_uni_dir_nsock_test_args)
308
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800309 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500310 def test_ldp_cut_thru_bi_dir_nsock(self):
311 """ run LDP cut thru bi-directional (multiple sockets) test """
312
313 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700314 self.cut_thru_test("sock_test_server", self.server_args,
315 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500316 self.client_bi_dir_nsock_test_args)
317
Florin Coras0ae445e2018-11-29 18:22:10 -0800318
319class VCLCutThruTestCase(VCLTestCase):
320 """ VCL Cut Thru Tests """
321
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800322 @classmethod
323 def setUpClass(cls):
324 super(VCLCutThruTestCase, cls).setUpClass()
325
326 @classmethod
327 def tearDownClass(cls):
328 super(VCLCutThruTestCase, cls).tearDownClass()
329
Florin Coras0ae445e2018-11-29 18:22:10 -0800330 def setUp(self):
331 super(VCLCutThruTestCase, self).setUp()
332
333 self.cut_thru_setup()
334 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
335 self.server_addr, self.server_port]
336
337 self.client_uni_dir_nsock_timeout = 20
338 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
339 "-I", "2",
340 self.server_addr,
341 self.server_port]
342 self.client_bi_dir_nsock_timeout = 20
343 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
344 "-I", "2",
345 self.server_addr,
346 self.server_port]
347
348 def tearDown(self):
349 self.cut_thru_tear_down()
350
351 super(VCLCutThruTestCase, self).tearDown()
352
Dave Wallace9f11c012018-02-28 17:55:23 -0500353 def test_vcl_cut_thru_echo(self):
354 """ run VCL cut thru echo test """
355
Florin Corasab2f6db2018-08-31 14:31:41 -0700356 self.cut_thru_test("vcl_test_server", self.server_args,
357 "vcl_test_client", self.client_echo_test_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500358
Dave Wallaced85075e2018-03-02 13:19:30 -0500359 def test_vcl_cut_thru_uni_dir_nsock(self):
360 """ run VCL cut thru uni-directional (multiple sockets) test """
361
362 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700363 self.cut_thru_test("vcl_test_server", self.server_args,
364 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500365 self.client_uni_dir_nsock_test_args)
366
Dave Wallaced85075e2018-03-02 13:19:30 -0500367 def test_vcl_cut_thru_bi_dir_nsock(self):
368 """ run VCL cut thru bi-directional (multiple sockets) test """
369
370 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700371 self.cut_thru_test("vcl_test_server", self.server_args,
372 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500373 self.client_bi_dir_nsock_test_args)
374
Dave Wallace9f11c012018-02-28 17:55:23 -0500375
Florin Corasdc2e2512018-12-03 17:47:26 -0800376class VCLThruHostStackEcho(VCLTestCase):
377 """ VCL Thru Host Stack Echo """
Dave Wallaced85075e2018-03-02 13:19:30 -0500378
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800379 @classmethod
380 def setUpClass(cls):
381 super(VCLThruHostStackEcho, cls).setUpClass()
382
383 @classmethod
384 def tearDownClass(cls):
385 super(VCLThruHostStackEcho, cls).tearDownClass()
386
Dave Wallaced85075e2018-03-02 13:19:30 -0500387 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800388 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500389
390 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800391 self.client_bi_dir_nsock_timeout = 20
392 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
393 "-I", "2",
394 self.loop0.local_ip4,
395 self.server_port]
396 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
397 self.loop0.local_ip4,
398 self.server_port]
399
400 def tearDown(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800401 self.thru_host_stack_tear_down()
402 super(VCLThruHostStackEcho, self).tearDown()
403
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700404 def show_commands_at_teardown(self):
405 self.logger.debug(self.vapi.cli("show app server"))
406 self.logger.debug(self.vapi.cli("show session verbose"))
407
Florin Corasdc2e2512018-12-03 17:47:26 -0800408
Florin Coras8a140612019-02-18 22:39:39 -0800409class VCLThruHostStackTLS(VCLTestCase):
410 """ VCL Thru Host Stack TLS """
411
412 @classmethod
413 def setUpClass(cls):
414 super(VCLThruHostStackTLS, cls).setUpClass()
415
416 @classmethod
417 def tearDownClass(cls):
418 super(VCLThruHostStackTLS, cls).tearDownClass()
419
420 def setUp(self):
421 super(VCLThruHostStackTLS, self).setUp()
422
423 self.thru_host_stack_setup()
424 self.client_uni_dir_tls_timeout = 20
Dave Wallace03dd90a2019-03-25 19:34:50 -0400425 self.server_tls_args = ["-L", self.server_port]
426 self.client_uni_dir_tls_test_args = ["-N", "1000", "-U", "-X", "-L",
Florin Coras8a140612019-02-18 22:39:39 -0800427 self.loop0.local_ip4,
428 self.server_port]
429
430 def test_vcl_thru_host_stack_tls_uni_dir(self):
431 """ run VCL thru host stack uni-directional TLS test """
432
433 self.timeout = self.client_uni_dir_tls_timeout
434 self.thru_host_stack_test("vcl_test_server", self.server_tls_args,
435 "vcl_test_client",
436 self.client_uni_dir_tls_test_args)
437
438 def tearDown(self):
Florin Coras8a140612019-02-18 22:39:39 -0800439 self.thru_host_stack_tear_down()
440 super(VCLThruHostStackTLS, self).tearDown()
441
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700442 def show_commands_at_teardown(self):
443 self.logger.debug(self.vapi.cli("show app server"))
444 self.logger.debug(self.vapi.cli("show session verbose 2"))
445
Florin Coras8a140612019-02-18 22:39:39 -0800446
Florin Corasdc2e2512018-12-03 17:47:26 -0800447class VCLThruHostStackBidirNsock(VCLTestCase):
448 """ VCL Thru Host Stack Bidir Nsock """
449
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800450 @classmethod
451 def setUpClass(cls):
452 super(VCLThruHostStackBidirNsock, cls).setUpClass()
453
454 @classmethod
455 def tearDownClass(cls):
456 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
457
Florin Corasdc2e2512018-12-03 17:47:26 -0800458 def setUp(self):
459 super(VCLThruHostStackBidirNsock, self).setUp()
460
461 self.thru_host_stack_setup()
462 self.client_bi_dir_nsock_timeout = 20
463 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
464 "-I", "2",
465 self.loop0.local_ip4,
466 self.server_port]
467 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
468 self.loop0.local_ip4,
469 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500470
471 def tearDown(self):
472 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800473 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500474
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700475 def show_commands_at_teardown(self):
476 self.logger.debug(self.vapi.cli("show session verbose 2"))
477
Dave Wallaced85075e2018-03-02 13:19:30 -0500478 def test_vcl_thru_host_stack_bi_dir_nsock(self):
479 """ run VCL thru host stack bi-directional (multiple sockets) test """
480
481 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700482 self.thru_host_stack_test("vcl_test_server", self.server_args,
483 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500484 self.client_bi_dir_nsock_test_args)
485
486
Florin Corasdc2e2512018-12-03 17:47:26 -0800487class LDPThruHostStackBidirNsock(VCLTestCase):
488 """ LDP Thru Host Stack Bidir Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500489
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800490 @classmethod
491 def setUpClass(cls):
492 super(LDPThruHostStackBidirNsock, cls).setUpClass()
493
494 @classmethod
495 def tearDownClass(cls):
496 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
497
Dave Wallaced85075e2018-03-02 13:19:30 -0500498 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800499 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500500
501 self.thru_host_stack_setup()
502 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800503 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400504 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
505 # OUCH! Host Stack Bug?
506 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400507 self.loop0.local_ip4,
508 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500509 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800510 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400511 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
512 # OUCH! Host Stack Bug?
513 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400514 self.loop0.local_ip4,
515 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500516
517 def tearDown(self):
518 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800519 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500520
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700521 def show_commands_at_teardown(self):
522 self.logger.debug(self.vapi.cli("show session verbose 2"))
523
Dave Wallaced85075e2018-03-02 13:19:30 -0500524 def test_ldp_thru_host_stack_bi_dir_nsock(self):
525 """ run LDP thru host stack bi-directional (multiple sockets) test """
526
527 self.timeout = self.client_bi_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400528 self.thru_host_stack_test("sock_test_server", self.server_args,
529 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500530 self.client_bi_dir_nsock_test_args)
531
532
Florin Corasdc2e2512018-12-03 17:47:26 -0800533class LDPThruHostStackNsock(VCLTestCase):
534 """ LDP Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500535
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800536 @classmethod
537 def setUpClass(cls):
538 super(LDPThruHostStackNsock, cls).setUpClass()
539
540 @classmethod
541 def tearDownClass(cls):
542 super(LDPThruHostStackNsock, cls).tearDownClass()
543
Dave Wallaced85075e2018-03-02 13:19:30 -0500544 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800545 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500546
547 self.thru_host_stack_setup()
548 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800549 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500550 self.numSockets = "2"
551 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800552 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500553 self.numSockets = "5"
554
Dave Wallace45cd3a32018-06-26 01:14:04 -0400555 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
556 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400557 self.loop0.local_ip4,
558 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500559
560 def tearDown(self):
561 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800562 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500563
Dave Wallaced85075e2018-03-02 13:19:30 -0500564 def test_ldp_thru_host_stack_uni_dir_nsock(self):
565 """ run LDP thru host stack uni-directional (multiple sockets) test """
566
567 self.timeout = self.client_uni_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400568 self.thru_host_stack_test("sock_test_server", self.server_args,
569 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500570 self.client_uni_dir_nsock_test_args)
571
572
Florin Corasdc2e2512018-12-03 17:47:26 -0800573class VCLThruHostStackNsock(VCLTestCase):
574 """ VCL Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500575
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800576 @classmethod
577 def setUpClass(cls):
578 super(VCLThruHostStackNsock, cls).setUpClass()
579
580 @classmethod
581 def tearDownClass(cls):
582 super(VCLThruHostStackNsock, cls).tearDownClass()
583
Dave Wallaced85075e2018-03-02 13:19:30 -0500584 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800585 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500586
587 self.thru_host_stack_setup()
588 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800589 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500590 self.numSockets = "2"
591 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800592 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500593 self.numSockets = "5"
594
Dave Wallace45cd3a32018-06-26 01:14:04 -0400595 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
596 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400597 self.loop0.local_ip4,
598 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500599
600 def tearDown(self):
601 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800602 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500603
Dave Wallaced85075e2018-03-02 13:19:30 -0500604 def test_vcl_thru_host_stack_uni_dir_nsock(self):
605 """ run VCL thru host stack uni-directional (multiple sockets) test """
606
607 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700608 self.thru_host_stack_test("vcl_test_server", self.server_args,
609 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500610 self.client_uni_dir_nsock_test_args)
611
612
Florin Corasdc2e2512018-12-03 17:47:26 -0800613class LDPThruHostStackIperf(VCLTestCase):
614 """ LDP Thru Host Stack Iperf """
Dave Wallace816833f2018-03-14 20:01:28 -0400615
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800616 @classmethod
617 def setUpClass(cls):
618 super(LDPThruHostStackIperf, cls).setUpClass()
619
620 @classmethod
621 def tearDownClass(cls):
622 super(LDPThruHostStackIperf, cls).tearDownClass()
623
Dave Wallace816833f2018-03-14 20:01:28 -0400624 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800625 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400626
627 self.thru_host_stack_setup()
628 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800629 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.loop0.local_ip4]
Dave Wallace816833f2018-03-14 20:01:28 -0400630 self.server_iperf3_args = ["-V4d", "-s"]
631
632 def tearDown(self):
633 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800634 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400635
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700636 def show_commands_at_teardown(self):
637 self.logger.debug(self.vapi.cli("show session verbose 2"))
638
Dave Wallace816833f2018-03-14 20:01:28 -0400639 def test_ldp_thru_host_stack_iperf3(self):
640 """ run LDP thru host stack iperf3 test """
641
642 try:
643 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800644 except subprocess.CalledProcessError:
Dave Wallace816833f2018-03-14 20:01:28 -0400645 self.logger.error("WARNING: 'iperf3' is not installed,")
646 self.logger.error(
647 " 'test_ldp_thru_host_stack_iperf3' not run!")
648 return
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800649 except OSError as e:
650 self.logger.error("WARNING: 'iperf3' is not installed,")
651 self.logger.error(" 'test' not run!")
652 return
653 except Exception as e:
654 self.logger.error("WARNING: 'iperf3' unexpected error,")
655 self.logger.error(" 'test' not run!")
656 return
Dave Wallace816833f2018-03-14 20:01:28 -0400657
658 self.timeout = self.client_iperf3_timeout
659 self.thru_host_stack_test("iperf3", self.server_iperf3_args,
660 "iperf3", self.client_iperf3_args)
661
662
Florin Coras0ae445e2018-11-29 18:22:10 -0800663class LDPIpv6CutThruTestCase(VCLTestCase):
664 """ LDP IPv6 Cut Thru Tests """
Dave Wallacede910062018-03-20 09:22:13 -0400665
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800666 @classmethod
667 def setUpClass(cls):
668 super(LDPIpv6CutThruTestCase, cls).setUpClass()
669
670 @classmethod
671 def tearDownClass(cls):
672 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
673
Dave Wallacede910062018-03-20 09:22:13 -0400674 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800675 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400676
677 self.cut_thru_setup()
678 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -0800679 self.client_uni_dir_nsock_timeout = 20
680 self.client_bi_dir_nsock_timeout = 20
Dave Wallacede910062018-03-20 09:22:13 -0400681 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
682 self.server_ipv6_addr,
683 self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -0800684 self.client_ipv6_iperf3_args = ["-V6d", "-t 2", "-c",
Florin Corasab2f6db2018-08-31 14:31:41 -0700685 self.server_ipv6_addr]
Dave Wallacede910062018-03-20 09:22:13 -0400686 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400687 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
688 "-6",
689 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400690 self.server_ipv6_addr,
691 self.server_port]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400692 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
693 "-6",
694 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400695 self.server_ipv6_addr,
696 self.server_port]
697
698 def tearDown(self):
699 self.cut_thru_tear_down()
700
Florin Coras0ae445e2018-11-29 18:22:10 -0800701 super(LDPIpv6CutThruTestCase, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400702
703 def test_ldp_ipv6_cut_thru_echo(self):
704 """ run LDP IPv6 cut thru echo test """
705
Florin Corasab2f6db2018-08-31 14:31:41 -0700706 self.cut_thru_test("sock_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400707 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700708 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400709 self.client_ipv6_echo_test_args)
710
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800711 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400712 def test_ldp_ipv6_cut_thru_iperf3(self):
713 """ run LDP IPv6 cut thru iperf3 test """
714
715 try:
716 subprocess.check_output(['iperf3', '-v'])
717 except:
718 self.logger.error("WARNING: 'iperf3' is not installed,")
719 self.logger.error(
720 " 'test_ldp_ipv6_cut_thru_iperf3' not run!")
721 return
722
723 self.timeout = self.client_iperf3_timeout
724 self.cut_thru_test("iperf3", self.server_ipv6_iperf3_args,
725 "iperf3", self.client_ipv6_iperf3_args)
726
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800727 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400728 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
729 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
730
731 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700732 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
733 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400734 self.client_ipv6_uni_dir_nsock_test_args)
735
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800736 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400737 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
738 """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """
739
740 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700741 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
742 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400743 self.client_ipv6_bi_dir_nsock_test_args)
744
Florin Coras0ae445e2018-11-29 18:22:10 -0800745
746class VCLIpv6CutThruTestCase(VCLTestCase):
747 """ VCL IPv6 Cut Thru Tests """
748
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800749 @classmethod
750 def setUpClass(cls):
751 super(VCLIpv6CutThruTestCase, cls).setUpClass()
752
753 @classmethod
754 def tearDownClass(cls):
755 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
756
Florin Coras0ae445e2018-11-29 18:22:10 -0800757 def setUp(self):
758 super(VCLIpv6CutThruTestCase, self).setUp()
759
760 self.cut_thru_setup()
761 self.client_uni_dir_nsock_timeout = 20
762 self.client_bi_dir_nsock_timeout = 20
763 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
764 self.server_ipv6_addr,
765 self.server_port]
766 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
767 "-6",
768 "-I", "2",
769 self.server_ipv6_addr,
770 self.server_port]
771 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
772 "-6",
773 "-I", "2",
774 self.server_ipv6_addr,
775 self.server_port]
776
777 def tearDown(self):
778 self.cut_thru_tear_down()
779
780 super(VCLIpv6CutThruTestCase, self).tearDown()
781
Dave Wallacede910062018-03-20 09:22:13 -0400782 def test_vcl_ipv6_cut_thru_echo(self):
783 """ run VCL IPv6 cut thru echo test """
784
Florin Corasab2f6db2018-08-31 14:31:41 -0700785 self.cut_thru_test("vcl_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400786 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700787 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400788 self.client_ipv6_echo_test_args)
789
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800790 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400791 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
792 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
793
794 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700795 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
796 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400797 self.client_ipv6_uni_dir_nsock_test_args)
798
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800799 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400800 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
801 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
802
803 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700804 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
805 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400806 self.client_ipv6_bi_dir_nsock_test_args)
807
808
Florin Corasdc2e2512018-12-03 17:47:26 -0800809class VCLIpv6ThruHostStackEcho(VCLTestCase):
810 """ VCL IPv6 Thru Host Stack Echo """
Dave Wallacede910062018-03-20 09:22:13 -0400811
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800812 @classmethod
813 def setUpClass(cls):
814 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
815
816 @classmethod
817 def tearDownClass(cls):
818 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
819
Dave Wallacede910062018-03-20 09:22:13 -0400820 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800821 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400822
823 self.thru_host_stack_ipv6_setup()
824 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
825 self.loop0.local_ip6,
826 self.server_port]
827
828 def tearDown(self):
829 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800830 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400831
832 def test_vcl_ipv6_thru_host_stack_echo(self):
833 """ run VCL IPv6 thru host stack echo test """
834
Florin Corasdc2e2512018-12-03 17:47:26 -0800835 self.thru_host_stack_test("vcl_test_server",
Damjan Marion855e2682018-08-24 13:37:45 +0200836 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700837 "vcl_test_client",
Florin Corasdc2e2512018-12-03 17:47:26 -0800838 self.client_ipv6_echo_test_args)
Dave Wallacede910062018-03-20 09:22:13 -0400839
840
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500841if __name__ == '__main__':
842 unittest.main(testRunner=VppTestRunner)