blob: c25bad99923e325acc6c8654512ff87800733537 [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
Neale Ranns097fa662018-05-01 05:17:55 -070010from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, FibPathProto
Dave Wallacecfcf2f42018-02-16 18:31:56 -050011
Paul Vinciguerra063366e2019-06-30 15:38:55 -040012iperf3 = '/usr/bin/iperf3'
13
14
15def have_app(app):
16 try:
17 subprocess.check_output([app, '-v'])
18 except (subprocess.CalledProcessError, OSError):
19 return False
20 return True
21
22
23_have_iperf3 = have_app(iperf3)
Paul Vinciguerra063366e2019-06-30 15:38:55 -040024
Dave Wallacecfcf2f42018-02-16 18:31:56 -050025
Dave Wallace816833f2018-03-14 20:01:28 -040026class VCLAppWorker(Worker):
Dave Wallace42996c02018-02-26 14:40:13 -050027 """ VCL Test Application Worker """
28
Dave Wallaced85075e2018-03-02 13:19:30 -050029 def __init__(self, build_dir, appname, args, logger, env={}):
Damjan Marion855e2682018-08-24 13:37:45 +020030 vcl_lib_dir = "%s/vpp/lib" % build_dir
Dave Wallace816833f2018-03-14 20:01:28 -040031 if "iperf" in appname:
32 app = appname
Dave Wallace9f11c012018-02-28 17:55:23 -050033 env.update({'LD_PRELOAD':
Damjan Marion855e2682018-08-24 13:37:45 +020034 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Florin Corasab2f6db2018-08-31 14:31:41 -070035 elif "sock" in appname:
36 app = "%s/vpp/bin/%s" % (build_dir, appname)
37 env.update({'LD_PRELOAD':
38 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Dave Wallace816833f2018-03-14 20:01:28 -040039 else:
Florin Corasab2f6db2018-08-31 14:31:41 -070040 app = "%s/vpp/bin/%s" % (build_dir, appname)
Dave Wallace9f11c012018-02-28 17:55:23 -050041 self.args = [app] + args
Dave Wallace816833f2018-03-14 20:01:28 -040042 super(VCLAppWorker, self).__init__(self.args, logger, env)
Dave Wallace42996c02018-02-26 14:40:13 -050043
44
Dave Wallace816833f2018-03-14 20:01:28 -040045class VCLTestCase(VppTestCase):
Dave Wallace42996c02018-02-26 14:40:13 -050046 """ VCL Test Class """
47
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080048 @classmethod
49 def setUpClass(cls):
50 super(VCLTestCase, cls).setUpClass()
51
52 @classmethod
53 def tearDownClass(cls):
54 super(VCLTestCase, cls).tearDownClass()
55
56 def setUp(self):
Klement Sekerab8c72a42018-11-08 11:21:39 +010057 var = "VPP_BUILD_DIR"
Dave Wallaced85075e2018-03-02 13:19:30 -050058 self.build_dir = os.getenv(var, None)
59 if self.build_dir is None:
Paul Vinciguerra063366e2019-06-30 15:38:55 -040060 raise EnvironmentError("Environment variable `%s' not set" % var)
Dave Wallaced85075e2018-03-02 13:19:30 -050061 self.vppDebug = 'vpp_debug' in self.build_dir
Dave Wallace9f11c012018-02-28 17:55:23 -050062 self.server_addr = "127.0.0.1"
63 self.server_port = "22000"
Dave Wallace816833f2018-03-14 20:01:28 -040064 self.server_args = [self.server_port]
Dave Wallacede910062018-03-20 09:22:13 -040065 self.server_ipv6_addr = "::1"
66 self.server_ipv6_args = ["-6", self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -080067 self.timeout = 20
Dave Wallace9f11c012018-02-28 17:55:23 -050068 self.echo_phrase = "Hello, world! Jenny is a friend of mine."
Florin Corasdc2e2512018-12-03 17:47:26 -080069 self.pre_test_sleep = 0.3
70 self.post_test_sleep = 0.2
71
72 if os.path.isfile("/tmp/ldp_server_af_unix_socket"):
73 os.remove("/tmp/ldp_server_af_unix_socket")
Dave Wallace42996c02018-02-26 14:40:13 -050074
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080075 super(VCLTestCase, self).setUp()
Dave Wallace42996c02018-02-26 14:40:13 -050076
Dave Wallace9f11c012018-02-28 17:55:23 -050077 def cut_thru_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050078 self.vapi.session_enable_disable(is_enabled=1)
79
Dave Wallace9f11c012018-02-28 17:55:23 -050080 def cut_thru_tear_down(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050081 self.vapi.session_enable_disable(is_enabled=0)
82
Dave Wallace816833f2018-03-14 20:01:28 -040083 def cut_thru_test(self, server_app, server_args, client_app, client_args):
Dave Wallace42996c02018-02-26 14:40:13 -050084 self.env = {'VCL_API_PREFIX': self.shm_prefix,
85 'VCL_APP_SCOPE_LOCAL': "true"}
Dave Wallace816833f2018-03-14 20:01:28 -040086 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -050087 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050088 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -080089 self.sleep(self.pre_test_sleep)
Dave Wallace816833f2018-03-14 20:01:28 -040090 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -050091 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050092 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -050093 worker_client.join(self.timeout)
Dave Wallacefef3f7b2018-03-09 12:04:10 -050094 try:
95 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +020096 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -050097 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -080098 self.sleep(self.post_test_sleep)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050099
Dave Wallace9f11c012018-02-28 17:55:23 -0500100 def thru_host_stack_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -0500101 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200102 self.create_loopback_interfaces(2)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500103
Florin Coras56b39f62018-03-27 17:29:32 -0700104 table_id = 1
Dave Wallacea67a03e2018-02-20 12:39:37 -0500105
106 for i in self.lo_interfaces:
107 i.admin_up()
108
109 if table_id != 0:
110 tbl = VppIpTable(self, table_id)
111 tbl.add_vpp_config()
112
113 i.set_table_ip4(table_id)
114 i.config_ip4()
115 table_id += 1
116
117 # Configure namespaces
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800118 self.vapi.app_namespace_add_del(namespace_id=b"1", secret=1234,
Ole Troane1ade682019-03-04 23:55:43 +0100119 sw_if_index=self.loop0.sw_if_index)
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800120 self.vapi.app_namespace_add_del(namespace_id=b"2", secret=5678,
Ole Troane1ade682019-03-04 23:55:43 +0100121 sw_if_index=self.loop1.sw_if_index)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500122
Dave Wallacea67a03e2018-02-20 12:39:37 -0500123 # Add inter-table routes
124 ip_t01 = VppIpRoute(self, self.loop1.local_ip4, 32,
125 [VppRoutePath("0.0.0.0",
126 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700127 nh_table_id=2)], table_id=1)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500128 ip_t10 = VppIpRoute(self, self.loop0.local_ip4, 32,
129 [VppRoutePath("0.0.0.0",
130 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700131 nh_table_id=1)], table_id=2)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500132 ip_t01.add_vpp_config()
133 ip_t10.add_vpp_config()
Florin Coras56b39f62018-03-27 17:29:32 -0700134 self.logger.debug(self.vapi.cli("show ip fib"))
Dave Wallacea67a03e2018-02-20 12:39:37 -0500135
Dave Wallace9f11c012018-02-28 17:55:23 -0500136 def thru_host_stack_tear_down(self):
137 for i in self.lo_interfaces:
138 i.unconfig_ip4()
139 i.set_table_ip4(0)
140 i.admin_down()
141
Dave Wallacede910062018-03-20 09:22:13 -0400142 def thru_host_stack_ipv6_setup(self):
143 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200144 self.create_loopback_interfaces(2)
Dave Wallacede910062018-03-20 09:22:13 -0400145
146 table_id = 1
147
148 for i in self.lo_interfaces:
149 i.admin_up()
150
151 tbl = VppIpTable(self, table_id, is_ip6=1)
152 tbl.add_vpp_config()
153
154 i.set_table_ip6(table_id)
155 i.config_ip6()
156 table_id += 1
157
158 # Configure namespaces
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800159 self.vapi.app_namespace_add_del(namespace_id=b"1", secret=1234,
Ole Troane1ade682019-03-04 23:55:43 +0100160 sw_if_index=self.loop0.sw_if_index)
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800161 self.vapi.app_namespace_add_del(namespace_id=b"2", secret=5678,
Ole Troane1ade682019-03-04 23:55:43 +0100162 sw_if_index=self.loop1.sw_if_index)
Dave Wallacede910062018-03-20 09:22:13 -0400163
164 # Add inter-table routes
165 ip_t01 = VppIpRoute(self, self.loop1.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700166 [VppRoutePath("::0", 0xffffffff,
Neale Ranns097fa662018-05-01 05:17:55 -0700167 nh_table_id=2)],
168 table_id=1)
Dave Wallacede910062018-03-20 09:22:13 -0400169 ip_t10 = VppIpRoute(self, self.loop0.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700170 [VppRoutePath("::0", 0xffffffff,
Neale Ranns097fa662018-05-01 05:17:55 -0700171 nh_table_id=1)],
172 table_id=2)
Dave Wallacede910062018-03-20 09:22:13 -0400173 ip_t01.add_vpp_config()
174 ip_t10.add_vpp_config()
175 self.logger.debug(self.vapi.cli("show interface addr"))
176 self.logger.debug(self.vapi.cli("show ip6 fib"))
177
178 def thru_host_stack_ipv6_tear_down(self):
179 for i in self.lo_interfaces:
180 i.unconfig_ip6()
181 i.set_table_ip6(0)
182 i.admin_down()
183
184 self.vapi.session_enable_disable(is_enabled=0)
185
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400186 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -0400187 def thru_host_stack_test(self, server_app, server_args,
188 client_app, client_args):
Dave Wallace9f11c012018-02-28 17:55:23 -0500189 self.env = {'VCL_API_PREFIX': self.shm_prefix,
190 'VCL_APP_SCOPE_GLOBAL': "true",
Florin Coras56b39f62018-03-27 17:29:32 -0700191 'VCL_APP_NAMESPACE_ID': "1",
Dave Wallace9f11c012018-02-28 17:55:23 -0500192 'VCL_APP_NAMESPACE_SECRET': "1234"}
193
Dave Wallace816833f2018-03-14 20:01:28 -0400194 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500195 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500196 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800197 self.sleep(self.pre_test_sleep)
Dave Wallace42996c02018-02-26 14:40:13 -0500198
Florin Coras56b39f62018-03-27 17:29:32 -0700199 self.env.update({'VCL_APP_NAMESPACE_ID': "2",
Dave Wallace42996c02018-02-26 14:40:13 -0500200 'VCL_APP_NAMESPACE_SECRET': "5678"})
Dave Wallace816833f2018-03-14 20:01:28 -0400201 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500202 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500203 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500204 worker_client.join(self.timeout)
205
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500206 try:
207 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200208 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500209 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800210 self.sleep(self.post_test_sleep)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500211
Dave Wallace9f11c012018-02-28 17:55:23 -0500212 def validateResults(self, worker_client, worker_server, timeout):
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400213 if worker_server.process is None:
214 raise RuntimeError('worker_server is not running.')
Dave Wallaced85075e2018-03-02 13:19:30 -0500215 if os.path.isdir('/proc/{}'.format(worker_server.process.pid)):
216 self.logger.info("Killing server worker process (pid %d)" %
217 worker_server.process.pid)
Dave Barachad646872019-05-06 10:49:41 -0400218 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM)
Dave Wallaced85075e2018-03-02 13:19:30 -0500219 worker_server.join()
Dave Wallace9f11c012018-02-28 17:55:23 -0500220 self.logger.info("Client worker result is `%s'" % worker_client.result)
221 error = False
222 if worker_client.result is None:
223 try:
224 error = True
225 self.logger.error(
Dave Wallaced85075e2018-03-02 13:19:30 -0500226 "Timeout: %ss! Killing client worker process (pid %d)" %
227 (timeout, worker_client.process.pid))
Dave Wallace9f11c012018-02-28 17:55:23 -0500228 os.killpg(os.getpgid(worker_client.process.pid),
Florin Corasdc2e2512018-12-03 17:47:26 -0800229 signal.SIGKILL)
Dave Wallace9f11c012018-02-28 17:55:23 -0500230 worker_client.join()
Dave Wallace07c0a9d2019-05-13 19:21:24 -0400231 except OSError:
Dave Wallace9f11c012018-02-28 17:55:23 -0500232 self.logger.debug(
233 "Couldn't kill client worker process")
234 raise
235 if error:
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400236 raise RuntimeError(
Dave Wallace9f11c012018-02-28 17:55:23 -0500237 "Timeout! Client worker did not finish in %ss" % timeout)
238 self.assert_equal(worker_client.result, 0, "Binary test return code")
239
240
Florin Coras0ae445e2018-11-29 18:22:10 -0800241class LDPCutThruTestCase(VCLTestCase):
242 """ LDP Cut Thru Tests """
Dave Wallace9f11c012018-02-28 17:55:23 -0500243
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800244 @classmethod
245 def setUpClass(cls):
246 super(LDPCutThruTestCase, cls).setUpClass()
247
248 @classmethod
249 def tearDownClass(cls):
250 super(LDPCutThruTestCase, cls).tearDownClass()
251
Dave Wallace9f11c012018-02-28 17:55:23 -0500252 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800253 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500254
255 self.cut_thru_setup()
Dave Wallacede910062018-03-20 09:22:13 -0400256 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
257 self.server_addr, self.server_port]
Dave Wallace816833f2018-03-14 20:01:28 -0400258 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800259 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.server_addr]
Dave Wallace816833f2018-03-14 20:01:28 -0400260 self.server_iperf3_args = ["-V4d", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800261 self.client_uni_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400262 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
263 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400264 self.server_addr,
265 self.server_port]
Florin Coras2eb42e72018-11-29 00:39:53 -0800266 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400267 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
268 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400269 self.server_addr,
270 self.server_port]
Dave Wallace9f11c012018-02-28 17:55:23 -0500271
272 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800273 super(LDPCutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400274 self.cut_thru_tear_down()
Dave Wallace9f11c012018-02-28 17:55:23 -0500275
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700276 def show_commands_at_teardown(self):
277 self.logger.debug(self.vapi.cli("show session verbose 2"))
278
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800279 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500280 def test_ldp_cut_thru_echo(self):
281 """ run LDP cut thru echo test """
282
Florin Corasab2f6db2018-08-31 14:31:41 -0700283 self.cut_thru_test("sock_test_server", self.server_args,
284 "sock_test_client", self.client_echo_test_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400285
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400286 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -0400287 def test_ldp_cut_thru_iperf3(self):
288 """ run LDP cut thru iperf3 test """
289
Dave Wallace816833f2018-03-14 20:01:28 -0400290 self.timeout = self.client_iperf3_timeout
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400291 self.cut_thru_test(iperf3, self.server_iperf3_args,
292 iperf3, self.client_iperf3_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500293
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800294 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500295 def test_ldp_cut_thru_uni_dir_nsock(self):
296 """ run LDP cut thru uni-directional (multiple sockets) test """
297
298 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700299 self.cut_thru_test("sock_test_server", self.server_args,
300 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500301 self.client_uni_dir_nsock_test_args)
302
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800303 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -0700304 @unittest.skip("sock test apps need to be improved")
Dave Wallaced85075e2018-03-02 13:19:30 -0500305 def test_ldp_cut_thru_bi_dir_nsock(self):
306 """ run LDP cut thru bi-directional (multiple sockets) test """
307
308 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700309 self.cut_thru_test("sock_test_server", self.server_args,
310 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500311 self.client_bi_dir_nsock_test_args)
312
Florin Coras0ae445e2018-11-29 18:22:10 -0800313
314class VCLCutThruTestCase(VCLTestCase):
315 """ VCL Cut Thru Tests """
316
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800317 @classmethod
318 def setUpClass(cls):
319 super(VCLCutThruTestCase, cls).setUpClass()
320
321 @classmethod
322 def tearDownClass(cls):
323 super(VCLCutThruTestCase, cls).tearDownClass()
324
Florin Coras0ae445e2018-11-29 18:22:10 -0800325 def setUp(self):
326 super(VCLCutThruTestCase, self).setUp()
327
328 self.cut_thru_setup()
329 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
330 self.server_addr, self.server_port]
331
332 self.client_uni_dir_nsock_timeout = 20
333 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
334 "-I", "2",
335 self.server_addr,
336 self.server_port]
337 self.client_bi_dir_nsock_timeout = 20
338 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
339 "-I", "2",
340 self.server_addr,
341 self.server_port]
342
343 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800344 super(VCLCutThruTestCase, self).tearDown()
345
Florin Coras317b8e02019-04-17 09:57:46 -0700346 def show_commands_at_teardown(self):
347 self.logger.debug(self.vapi.cli("show session verbose 2"))
348
Dave Wallace9f11c012018-02-28 17:55:23 -0500349 def test_vcl_cut_thru_echo(self):
350 """ run VCL cut thru echo test """
351
Florin Corasab2f6db2018-08-31 14:31:41 -0700352 self.cut_thru_test("vcl_test_server", self.server_args,
353 "vcl_test_client", self.client_echo_test_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500354
Dave Wallaced85075e2018-03-02 13:19:30 -0500355 def test_vcl_cut_thru_uni_dir_nsock(self):
356 """ run VCL cut thru uni-directional (multiple sockets) test """
357
358 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700359 self.cut_thru_test("vcl_test_server", self.server_args,
360 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500361 self.client_uni_dir_nsock_test_args)
362
Dave Wallaced85075e2018-03-02 13:19:30 -0500363 def test_vcl_cut_thru_bi_dir_nsock(self):
364 """ run VCL cut thru bi-directional (multiple sockets) test """
365
366 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700367 self.cut_thru_test("vcl_test_server", self.server_args,
368 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500369 self.client_bi_dir_nsock_test_args)
370
Dave Wallace9f11c012018-02-28 17:55:23 -0500371
Florin Corasdc2e2512018-12-03 17:47:26 -0800372class VCLThruHostStackEcho(VCLTestCase):
373 """ VCL Thru Host Stack Echo """
Dave Wallaced85075e2018-03-02 13:19:30 -0500374
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800375 @classmethod
376 def setUpClass(cls):
377 super(VCLThruHostStackEcho, cls).setUpClass()
378
379 @classmethod
380 def tearDownClass(cls):
381 super(VCLThruHostStackEcho, cls).tearDownClass()
382
Dave Wallaced85075e2018-03-02 13:19:30 -0500383 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800384 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500385
386 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800387 self.client_bi_dir_nsock_timeout = 20
388 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
389 "-I", "2",
390 self.loop0.local_ip4,
391 self.server_port]
392 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
393 self.loop0.local_ip4,
394 self.server_port]
395
396 def tearDown(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800397 self.thru_host_stack_tear_down()
398 super(VCLThruHostStackEcho, self).tearDown()
399
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700400 def show_commands_at_teardown(self):
401 self.logger.debug(self.vapi.cli("show app server"))
402 self.logger.debug(self.vapi.cli("show session verbose"))
403
Florin Corasdc2e2512018-12-03 17:47:26 -0800404
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):
Florin Coras8a140612019-02-18 22:39:39 -0800435 self.thru_host_stack_tear_down()
436 super(VCLThruHostStackTLS, self).tearDown()
437
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700438 def show_commands_at_teardown(self):
439 self.logger.debug(self.vapi.cli("show app server"))
440 self.logger.debug(self.vapi.cli("show session verbose 2"))
441
Florin Coras8a140612019-02-18 22:39:39 -0800442
Florin Corasdc2e2512018-12-03 17:47:26 -0800443class VCLThruHostStackBidirNsock(VCLTestCase):
444 """ VCL Thru Host Stack Bidir Nsock """
445
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800446 @classmethod
447 def setUpClass(cls):
448 super(VCLThruHostStackBidirNsock, cls).setUpClass()
449
450 @classmethod
451 def tearDownClass(cls):
452 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
453
Florin Corasdc2e2512018-12-03 17:47:26 -0800454 def setUp(self):
455 super(VCLThruHostStackBidirNsock, self).setUp()
456
457 self.thru_host_stack_setup()
458 self.client_bi_dir_nsock_timeout = 20
459 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
460 "-I", "2",
461 self.loop0.local_ip4,
462 self.server_port]
463 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
464 self.loop0.local_ip4,
465 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500466
467 def tearDown(self):
468 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800469 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500470
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700471 def show_commands_at_teardown(self):
472 self.logger.debug(self.vapi.cli("show session verbose 2"))
473
Dave Wallaced85075e2018-03-02 13:19:30 -0500474 def test_vcl_thru_host_stack_bi_dir_nsock(self):
475 """ run VCL thru host stack bi-directional (multiple sockets) test """
476
477 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700478 self.thru_host_stack_test("vcl_test_server", self.server_args,
479 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500480 self.client_bi_dir_nsock_test_args)
481
482
Florin Corasdc2e2512018-12-03 17:47:26 -0800483class LDPThruHostStackBidirNsock(VCLTestCase):
484 """ LDP Thru Host Stack Bidir Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500485
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800486 @classmethod
487 def setUpClass(cls):
488 super(LDPThruHostStackBidirNsock, cls).setUpClass()
489
490 @classmethod
491 def tearDownClass(cls):
492 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
493
Dave Wallaced85075e2018-03-02 13:19:30 -0500494 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800495 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500496
497 self.thru_host_stack_setup()
498 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800499 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400500 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
501 # OUCH! Host Stack Bug?
502 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400503 self.loop0.local_ip4,
504 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500505 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800506 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400507 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
508 # OUCH! Host Stack Bug?
509 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400510 self.loop0.local_ip4,
511 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500512
513 def tearDown(self):
514 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800515 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500516
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700517 def show_commands_at_teardown(self):
518 self.logger.debug(self.vapi.cli("show session verbose 2"))
519
Dave Wallaced85075e2018-03-02 13:19:30 -0500520 def test_ldp_thru_host_stack_bi_dir_nsock(self):
521 """ run LDP thru host stack bi-directional (multiple sockets) test """
522
523 self.timeout = self.client_bi_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400524 self.thru_host_stack_test("sock_test_server", self.server_args,
525 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500526 self.client_bi_dir_nsock_test_args)
527
528
Florin Corasdc2e2512018-12-03 17:47:26 -0800529class LDPThruHostStackNsock(VCLTestCase):
530 """ LDP Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500531
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800532 @classmethod
533 def setUpClass(cls):
534 super(LDPThruHostStackNsock, cls).setUpClass()
535
536 @classmethod
537 def tearDownClass(cls):
538 super(LDPThruHostStackNsock, cls).tearDownClass()
539
Dave Wallaced85075e2018-03-02 13:19:30 -0500540 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800541 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500542
543 self.thru_host_stack_setup()
544 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800545 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500546 self.numSockets = "2"
547 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800548 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500549 self.numSockets = "5"
550
Dave Wallace45cd3a32018-06-26 01:14:04 -0400551 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
552 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400553 self.loop0.local_ip4,
554 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500555
556 def tearDown(self):
557 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800558 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500559
Dave Wallaced85075e2018-03-02 13:19:30 -0500560 def test_ldp_thru_host_stack_uni_dir_nsock(self):
561 """ run LDP thru host stack uni-directional (multiple sockets) test """
562
563 self.timeout = self.client_uni_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400564 self.thru_host_stack_test("sock_test_server", self.server_args,
565 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500566 self.client_uni_dir_nsock_test_args)
567
568
Florin Corasdc2e2512018-12-03 17:47:26 -0800569class VCLThruHostStackNsock(VCLTestCase):
570 """ VCL Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500571
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800572 @classmethod
573 def setUpClass(cls):
574 super(VCLThruHostStackNsock, cls).setUpClass()
575
576 @classmethod
577 def tearDownClass(cls):
578 super(VCLThruHostStackNsock, cls).tearDownClass()
579
Dave Wallaced85075e2018-03-02 13:19:30 -0500580 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800581 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500582
583 self.thru_host_stack_setup()
584 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800585 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500586 self.numSockets = "2"
587 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800588 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500589 self.numSockets = "5"
590
Dave Wallace45cd3a32018-06-26 01:14:04 -0400591 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
592 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400593 self.loop0.local_ip4,
594 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500595
596 def tearDown(self):
597 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800598 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500599
Dave Wallaced85075e2018-03-02 13:19:30 -0500600 def test_vcl_thru_host_stack_uni_dir_nsock(self):
601 """ run VCL thru host stack uni-directional (multiple sockets) test """
602
603 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700604 self.thru_host_stack_test("vcl_test_server", self.server_args,
605 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500606 self.client_uni_dir_nsock_test_args)
607
608
Florin Corasdc2e2512018-12-03 17:47:26 -0800609class LDPThruHostStackIperf(VCLTestCase):
610 """ LDP Thru Host Stack Iperf """
Dave Wallace816833f2018-03-14 20:01:28 -0400611
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800612 @classmethod
613 def setUpClass(cls):
614 super(LDPThruHostStackIperf, cls).setUpClass()
615
616 @classmethod
617 def tearDownClass(cls):
618 super(LDPThruHostStackIperf, cls).tearDownClass()
619
Dave Wallace816833f2018-03-14 20:01:28 -0400620 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800621 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400622
623 self.thru_host_stack_setup()
624 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800625 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.loop0.local_ip4]
Dave Wallace816833f2018-03-14 20:01:28 -0400626 self.server_iperf3_args = ["-V4d", "-s"]
627
628 def tearDown(self):
629 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800630 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400631
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700632 def show_commands_at_teardown(self):
633 self.logger.debug(self.vapi.cli("show session verbose 2"))
634
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400635 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -0400636 def test_ldp_thru_host_stack_iperf3(self):
637 """ run LDP thru host stack iperf3 test """
638
Dave Wallace816833f2018-03-14 20:01:28 -0400639 self.timeout = self.client_iperf3_timeout
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400640 self.thru_host_stack_test(iperf3, self.server_iperf3_args,
641 iperf3, self.client_iperf3_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400642
643
Florin Coras0ae445e2018-11-29 18:22:10 -0800644class LDPIpv6CutThruTestCase(VCLTestCase):
645 """ LDP IPv6 Cut Thru Tests """
Dave Wallacede910062018-03-20 09:22:13 -0400646
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800647 @classmethod
648 def setUpClass(cls):
649 super(LDPIpv6CutThruTestCase, cls).setUpClass()
650
651 @classmethod
652 def tearDownClass(cls):
653 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
654
Dave Wallacede910062018-03-20 09:22:13 -0400655 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800656 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400657
658 self.cut_thru_setup()
659 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -0800660 self.client_uni_dir_nsock_timeout = 20
661 self.client_bi_dir_nsock_timeout = 20
Dave Wallacede910062018-03-20 09:22:13 -0400662 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
663 self.server_ipv6_addr,
664 self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -0800665 self.client_ipv6_iperf3_args = ["-V6d", "-t 2", "-c",
Florin Corasab2f6db2018-08-31 14:31:41 -0700666 self.server_ipv6_addr]
Dave Wallacede910062018-03-20 09:22:13 -0400667 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400668 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
669 "-6",
670 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400671 self.server_ipv6_addr,
672 self.server_port]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400673 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
674 "-6",
675 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400676 self.server_ipv6_addr,
677 self.server_port]
678
679 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800680 super(LDPIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400681 self.cut_thru_tear_down()
Dave Wallacede910062018-03-20 09:22:13 -0400682
683 def test_ldp_ipv6_cut_thru_echo(self):
684 """ run LDP IPv6 cut thru echo test """
685
Florin Corasab2f6db2018-08-31 14:31:41 -0700686 self.cut_thru_test("sock_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400687 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700688 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400689 self.client_ipv6_echo_test_args)
690
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400691 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800692 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400693 def test_ldp_ipv6_cut_thru_iperf3(self):
694 """ run LDP IPv6 cut thru iperf3 test """
695
Dave Wallacede910062018-03-20 09:22:13 -0400696 self.timeout = self.client_iperf3_timeout
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400697 self.cut_thru_test(iperf3, self.server_ipv6_iperf3_args,
698 iperf3, self.client_ipv6_iperf3_args)
Dave Wallacede910062018-03-20 09:22:13 -0400699
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800700 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400701 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
702 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
703
704 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700705 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
706 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400707 self.client_ipv6_uni_dir_nsock_test_args)
708
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800709 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -0700710 @unittest.skip("sock test apps need to be improved")
Dave Wallacede910062018-03-20 09:22:13 -0400711 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
712 """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """
713
714 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700715 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
716 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400717 self.client_ipv6_bi_dir_nsock_test_args)
718
Florin Coras0ae445e2018-11-29 18:22:10 -0800719
720class VCLIpv6CutThruTestCase(VCLTestCase):
721 """ VCL IPv6 Cut Thru Tests """
722
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800723 @classmethod
724 def setUpClass(cls):
725 super(VCLIpv6CutThruTestCase, cls).setUpClass()
726
727 @classmethod
728 def tearDownClass(cls):
729 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
730
Florin Coras0ae445e2018-11-29 18:22:10 -0800731 def setUp(self):
732 super(VCLIpv6CutThruTestCase, self).setUp()
733
734 self.cut_thru_setup()
735 self.client_uni_dir_nsock_timeout = 20
736 self.client_bi_dir_nsock_timeout = 20
737 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
738 self.server_ipv6_addr,
739 self.server_port]
740 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
741 "-6",
742 "-I", "2",
743 self.server_ipv6_addr,
744 self.server_port]
745 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
746 "-6",
747 "-I", "2",
748 self.server_ipv6_addr,
749 self.server_port]
750
751 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800752 super(VCLIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400753 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -0800754
Dave Wallacede910062018-03-20 09:22:13 -0400755 def test_vcl_ipv6_cut_thru_echo(self):
756 """ run VCL IPv6 cut thru echo test """
757
Florin Corasab2f6db2018-08-31 14:31:41 -0700758 self.cut_thru_test("vcl_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400759 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700760 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400761 self.client_ipv6_echo_test_args)
762
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800763 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400764 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
765 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
766
767 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700768 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
769 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400770 self.client_ipv6_uni_dir_nsock_test_args)
771
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800772 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400773 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
774 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
775
776 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700777 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
778 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400779 self.client_ipv6_bi_dir_nsock_test_args)
780
781
Florin Corasdc2e2512018-12-03 17:47:26 -0800782class VCLIpv6ThruHostStackEcho(VCLTestCase):
783 """ VCL IPv6 Thru Host Stack Echo """
Dave Wallacede910062018-03-20 09:22:13 -0400784
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800785 @classmethod
786 def setUpClass(cls):
787 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
788
789 @classmethod
790 def tearDownClass(cls):
791 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
792
Dave Wallacede910062018-03-20 09:22:13 -0400793 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800794 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400795
796 self.thru_host_stack_ipv6_setup()
797 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
798 self.loop0.local_ip6,
799 self.server_port]
800
801 def tearDown(self):
802 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800803 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400804
805 def test_vcl_ipv6_thru_host_stack_echo(self):
806 """ run VCL IPv6 thru host stack echo test """
807
Florin Corasdc2e2512018-12-03 17:47:26 -0800808 self.thru_host_stack_test("vcl_test_server",
Damjan Marion855e2682018-08-24 13:37:45 +0200809 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700810 "vcl_test_client",
Florin Corasdc2e2512018-12-03 17:47:26 -0800811 self.client_ipv6_echo_test_args)
Dave Wallacede910062018-03-20 09:22:13 -0400812
813
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500814if __name__ == '__main__':
815 unittest.main(testRunner=VppTestRunner)