blob: d9346ba77fafc2558a76b84877d82576e64dd6ce [file] [log] [blame]
Renato Botelho do Coutoead1e532019-10-31 13:31:07 -05001#!/usr/bin/env python3
Dave Wallacecfcf2f42018-02-16 18:31:56 -05002""" Vpp VCL tests """
3
4import unittest
5import os
Dave Wallace816833f2018-03-14 20:01:28 -04006import subprocess
Dave Wallacecfcf2f42018-02-16 18:31:56 -05007import signal
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
Paul Vinciguerra48bdbcd2019-12-04 19:43:53 -050029 def __init__(self, build_dir, appname, executable_args, logger, env=None,
30 *args, **kwargs):
31
32 if env is None:
33 env = {}
Damjan Marion855e2682018-08-24 13:37:45 +020034 vcl_lib_dir = "%s/vpp/lib" % build_dir
Dave Wallace816833f2018-03-14 20:01:28 -040035 if "iperf" in appname:
36 app = appname
Dave Wallace9f11c012018-02-28 17:55:23 -050037 env.update({'LD_PRELOAD':
Damjan Marion855e2682018-08-24 13:37:45 +020038 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Florin Corasab2f6db2018-08-31 14:31:41 -070039 elif "sock" in appname:
40 app = "%s/vpp/bin/%s" % (build_dir, appname)
41 env.update({'LD_PRELOAD':
42 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Dave Wallace816833f2018-03-14 20:01:28 -040043 else:
Florin Corasab2f6db2018-08-31 14:31:41 -070044 app = "%s/vpp/bin/%s" % (build_dir, appname)
Paul Vinciguerra48bdbcd2019-12-04 19:43:53 -050045 self.args = [app] + executable_args
46 super(VCLAppWorker, self).__init__(self.args, logger, env,
47 *args, **kwargs)
Dave Wallace42996c02018-02-26 14:40:13 -050048
49
Dave Wallace816833f2018-03-14 20:01:28 -040050class VCLTestCase(VppTestCase):
Dave Wallace42996c02018-02-26 14:40:13 -050051 """ VCL Test Class """
52
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080053 @classmethod
54 def setUpClass(cls):
55 super(VCLTestCase, cls).setUpClass()
56
57 @classmethod
58 def tearDownClass(cls):
59 super(VCLTestCase, cls).tearDownClass()
60
61 def setUp(self):
Klement Sekerab8c72a42018-11-08 11:21:39 +010062 var = "VPP_BUILD_DIR"
Dave Wallaced85075e2018-03-02 13:19:30 -050063 self.build_dir = os.getenv(var, None)
64 if self.build_dir is None:
Paul Vinciguerra063366e2019-06-30 15:38:55 -040065 raise EnvironmentError("Environment variable `%s' not set" % var)
Dave Wallaced85075e2018-03-02 13:19:30 -050066 self.vppDebug = 'vpp_debug' in self.build_dir
Dave Wallace9f11c012018-02-28 17:55:23 -050067 self.server_addr = "127.0.0.1"
68 self.server_port = "22000"
Dave Wallace816833f2018-03-14 20:01:28 -040069 self.server_args = [self.server_port]
Dave Wallacede910062018-03-20 09:22:13 -040070 self.server_ipv6_addr = "::1"
71 self.server_ipv6_args = ["-6", self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -080072 self.timeout = 20
Dave Wallace9f11c012018-02-28 17:55:23 -050073 self.echo_phrase = "Hello, world! Jenny is a friend of mine."
Florin Corasdc2e2512018-12-03 17:47:26 -080074 self.pre_test_sleep = 0.3
75 self.post_test_sleep = 0.2
76
77 if os.path.isfile("/tmp/ldp_server_af_unix_socket"):
78 os.remove("/tmp/ldp_server_af_unix_socket")
Dave Wallace42996c02018-02-26 14:40:13 -050079
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080080 super(VCLTestCase, self).setUp()
Dave Wallace42996c02018-02-26 14:40:13 -050081
Dave Wallace9f11c012018-02-28 17:55:23 -050082 def cut_thru_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050083 self.vapi.session_enable_disable(is_enabled=1)
84
Dave Wallace9f11c012018-02-28 17:55:23 -050085 def cut_thru_tear_down(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050086 self.vapi.session_enable_disable(is_enabled=0)
87
Dave Wallace816833f2018-03-14 20:01:28 -040088 def cut_thru_test(self, server_app, server_args, client_app, client_args):
Dave Wallace42996c02018-02-26 14:40:13 -050089 self.env = {'VCL_API_PREFIX': self.shm_prefix,
90 'VCL_APP_SCOPE_LOCAL': "true"}
Dave Wallace816833f2018-03-14 20:01:28 -040091 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -050092 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050093 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -080094 self.sleep(self.pre_test_sleep)
Dave Wallace816833f2018-03-14 20:01:28 -040095 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -050096 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050097 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -050098 worker_client.join(self.timeout)
Dave Wallacefef3f7b2018-03-09 12:04:10 -050099 try:
100 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200101 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500102 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800103 self.sleep(self.post_test_sleep)
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500104
Dave Wallace9f11c012018-02-28 17:55:23 -0500105 def thru_host_stack_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -0500106 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200107 self.create_loopback_interfaces(2)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500108
Florin Coras56b39f62018-03-27 17:29:32 -0700109 table_id = 1
Dave Wallacea67a03e2018-02-20 12:39:37 -0500110
111 for i in self.lo_interfaces:
112 i.admin_up()
113
114 if table_id != 0:
115 tbl = VppIpTable(self, table_id)
116 tbl.add_vpp_config()
117
118 i.set_table_ip4(table_id)
119 i.config_ip4()
120 table_id += 1
121
122 # Configure namespaces
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100123 self.vapi.app_namespace_add_del(namespace_id="1", secret=1234,
Ole Troane1ade682019-03-04 23:55:43 +0100124 sw_if_index=self.loop0.sw_if_index)
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100125 self.vapi.app_namespace_add_del(namespace_id="2", secret=5678,
Ole Troane1ade682019-03-04 23:55:43 +0100126 sw_if_index=self.loop1.sw_if_index)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500127
Dave Wallacea67a03e2018-02-20 12:39:37 -0500128 # Add inter-table routes
129 ip_t01 = VppIpRoute(self, self.loop1.local_ip4, 32,
130 [VppRoutePath("0.0.0.0",
131 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700132 nh_table_id=2)], table_id=1)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500133 ip_t10 = VppIpRoute(self, self.loop0.local_ip4, 32,
134 [VppRoutePath("0.0.0.0",
135 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700136 nh_table_id=1)], table_id=2)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500137 ip_t01.add_vpp_config()
138 ip_t10.add_vpp_config()
Florin Coras56b39f62018-03-27 17:29:32 -0700139 self.logger.debug(self.vapi.cli("show ip fib"))
Dave Wallacea67a03e2018-02-20 12:39:37 -0500140
Dave Wallace9f11c012018-02-28 17:55:23 -0500141 def thru_host_stack_tear_down(self):
142 for i in self.lo_interfaces:
143 i.unconfig_ip4()
144 i.set_table_ip4(0)
145 i.admin_down()
146
Dave Wallacede910062018-03-20 09:22:13 -0400147 def thru_host_stack_ipv6_setup(self):
148 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200149 self.create_loopback_interfaces(2)
Dave Wallacede910062018-03-20 09:22:13 -0400150
151 table_id = 1
152
153 for i in self.lo_interfaces:
154 i.admin_up()
155
156 tbl = VppIpTable(self, table_id, is_ip6=1)
157 tbl.add_vpp_config()
158
159 i.set_table_ip6(table_id)
160 i.config_ip6()
161 table_id += 1
162
163 # Configure namespaces
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100164 self.vapi.app_namespace_add_del(namespace_id="1", secret=1234,
Ole Troane1ade682019-03-04 23:55:43 +0100165 sw_if_index=self.loop0.sw_if_index)
Jakub Grajciarb4e5e502020-01-31 09:35:29 +0100166 self.vapi.app_namespace_add_del(namespace_id="2", secret=5678,
Ole Troane1ade682019-03-04 23:55:43 +0100167 sw_if_index=self.loop1.sw_if_index)
Dave Wallacede910062018-03-20 09:22:13 -0400168
169 # Add inter-table routes
170 ip_t01 = VppIpRoute(self, self.loop1.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700171 [VppRoutePath("::0", 0xffffffff,
Neale Ranns097fa662018-05-01 05:17:55 -0700172 nh_table_id=2)],
173 table_id=1)
Dave Wallacede910062018-03-20 09:22:13 -0400174 ip_t10 = VppIpRoute(self, self.loop0.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700175 [VppRoutePath("::0", 0xffffffff,
Neale Ranns097fa662018-05-01 05:17:55 -0700176 nh_table_id=1)],
177 table_id=2)
Dave Wallacede910062018-03-20 09:22:13 -0400178 ip_t01.add_vpp_config()
179 ip_t10.add_vpp_config()
180 self.logger.debug(self.vapi.cli("show interface addr"))
181 self.logger.debug(self.vapi.cli("show ip6 fib"))
182
183 def thru_host_stack_ipv6_tear_down(self):
184 for i in self.lo_interfaces:
185 i.unconfig_ip6()
186 i.set_table_ip6(0)
187 i.admin_down()
188
189 self.vapi.session_enable_disable(is_enabled=0)
190
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400191 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -0400192 def thru_host_stack_test(self, server_app, server_args,
193 client_app, client_args):
Dave Wallace9f11c012018-02-28 17:55:23 -0500194 self.env = {'VCL_API_PREFIX': self.shm_prefix,
195 'VCL_APP_SCOPE_GLOBAL': "true",
Florin Coras56b39f62018-03-27 17:29:32 -0700196 'VCL_APP_NAMESPACE_ID': "1",
Dave Wallace9f11c012018-02-28 17:55:23 -0500197 'VCL_APP_NAMESPACE_SECRET': "1234"}
198
Dave Wallace816833f2018-03-14 20:01:28 -0400199 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500200 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500201 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800202 self.sleep(self.pre_test_sleep)
Dave Wallace42996c02018-02-26 14:40:13 -0500203
Florin Coras56b39f62018-03-27 17:29:32 -0700204 self.env.update({'VCL_APP_NAMESPACE_ID': "2",
Dave Wallace42996c02018-02-26 14:40:13 -0500205 'VCL_APP_NAMESPACE_SECRET': "5678"})
Dave Wallace816833f2018-03-14 20:01:28 -0400206 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500207 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500208 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500209 worker_client.join(self.timeout)
210
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500211 try:
212 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200213 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500214 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800215 self.sleep(self.post_test_sleep)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500216
Dave Wallace9f11c012018-02-28 17:55:23 -0500217 def validateResults(self, worker_client, worker_server, timeout):
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400218 if worker_server.process is None:
219 raise RuntimeError('worker_server is not running.')
Dave Wallaced85075e2018-03-02 13:19:30 -0500220 if os.path.isdir('/proc/{}'.format(worker_server.process.pid)):
221 self.logger.info("Killing server worker process (pid %d)" %
222 worker_server.process.pid)
Dave Barachad646872019-05-06 10:49:41 -0400223 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM)
Dave Wallaced85075e2018-03-02 13:19:30 -0500224 worker_server.join()
Dave Wallace9f11c012018-02-28 17:55:23 -0500225 self.logger.info("Client worker result is `%s'" % worker_client.result)
226 error = False
227 if worker_client.result is None:
228 try:
229 error = True
230 self.logger.error(
Dave Wallaced85075e2018-03-02 13:19:30 -0500231 "Timeout: %ss! Killing client worker process (pid %d)" %
232 (timeout, worker_client.process.pid))
Dave Wallace9f11c012018-02-28 17:55:23 -0500233 os.killpg(os.getpgid(worker_client.process.pid),
Florin Corasdc2e2512018-12-03 17:47:26 -0800234 signal.SIGKILL)
Dave Wallace9f11c012018-02-28 17:55:23 -0500235 worker_client.join()
Dave Wallace07c0a9d2019-05-13 19:21:24 -0400236 except OSError:
Dave Wallace9f11c012018-02-28 17:55:23 -0500237 self.logger.debug(
238 "Couldn't kill client worker process")
239 raise
240 if error:
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400241 raise RuntimeError(
Dave Wallace9f11c012018-02-28 17:55:23 -0500242 "Timeout! Client worker did not finish in %ss" % timeout)
243 self.assert_equal(worker_client.result, 0, "Binary test return code")
244
245
Florin Coras0ae445e2018-11-29 18:22:10 -0800246class LDPCutThruTestCase(VCLTestCase):
247 """ LDP Cut Thru Tests """
Dave Wallace9f11c012018-02-28 17:55:23 -0500248
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800249 @classmethod
250 def setUpClass(cls):
251 super(LDPCutThruTestCase, cls).setUpClass()
252
253 @classmethod
254 def tearDownClass(cls):
255 super(LDPCutThruTestCase, cls).tearDownClass()
256
Dave Wallace9f11c012018-02-28 17:55:23 -0500257 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800258 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500259
260 self.cut_thru_setup()
Dave Wallacede910062018-03-20 09:22:13 -0400261 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
262 self.server_addr, self.server_port]
Dave Wallace816833f2018-03-14 20:01:28 -0400263 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800264 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.server_addr]
Dave Wallace816833f2018-03-14 20:01:28 -0400265 self.server_iperf3_args = ["-V4d", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800266 self.client_uni_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400267 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
268 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400269 self.server_addr,
270 self.server_port]
Florin Coras2eb42e72018-11-29 00:39:53 -0800271 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400272 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
273 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400274 self.server_addr,
275 self.server_port]
Dave Wallace9f11c012018-02-28 17:55:23 -0500276
277 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800278 super(LDPCutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400279 self.cut_thru_tear_down()
Dave Wallace9f11c012018-02-28 17:55:23 -0500280
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700281 def show_commands_at_teardown(self):
282 self.logger.debug(self.vapi.cli("show session verbose 2"))
283
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800284 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500285 def test_ldp_cut_thru_echo(self):
286 """ run LDP cut thru echo test """
287
Florin Corasab2f6db2018-08-31 14:31:41 -0700288 self.cut_thru_test("sock_test_server", self.server_args,
289 "sock_test_client", self.client_echo_test_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400290
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400291 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -0400292 def test_ldp_cut_thru_iperf3(self):
293 """ run LDP cut thru iperf3 test """
294
Dave Wallace816833f2018-03-14 20:01:28 -0400295 self.timeout = self.client_iperf3_timeout
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400296 self.cut_thru_test(iperf3, self.server_iperf3_args,
297 iperf3, self.client_iperf3_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500298
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800299 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500300 def test_ldp_cut_thru_uni_dir_nsock(self):
301 """ run LDP cut thru uni-directional (multiple sockets) test """
302
303 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700304 self.cut_thru_test("sock_test_server", self.server_args,
305 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500306 self.client_uni_dir_nsock_test_args)
307
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800308 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -0700309 @unittest.skip("sock test apps need to be improved")
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):
Florin Coras0ae445e2018-11-29 18:22:10 -0800349 super(VCLCutThruTestCase, self).tearDown()
350
Florin Coras317b8e02019-04-17 09:57:46 -0700351 def show_commands_at_teardown(self):
352 self.logger.debug(self.vapi.cli("show session verbose 2"))
353
Dave Wallace9f11c012018-02-28 17:55:23 -0500354 def test_vcl_cut_thru_echo(self):
355 """ run VCL cut thru echo test """
356
Florin Corasab2f6db2018-08-31 14:31:41 -0700357 self.cut_thru_test("vcl_test_server", self.server_args,
358 "vcl_test_client", self.client_echo_test_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500359
Dave Wallaced85075e2018-03-02 13:19:30 -0500360 def test_vcl_cut_thru_uni_dir_nsock(self):
361 """ run VCL cut thru uni-directional (multiple sockets) test """
362
363 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700364 self.cut_thru_test("vcl_test_server", self.server_args,
365 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500366 self.client_uni_dir_nsock_test_args)
367
Dave Wallaced85075e2018-03-02 13:19:30 -0500368 def test_vcl_cut_thru_bi_dir_nsock(self):
369 """ run VCL cut thru bi-directional (multiple sockets) test """
370
371 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700372 self.cut_thru_test("vcl_test_server", self.server_args,
373 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500374 self.client_bi_dir_nsock_test_args)
375
Dave Wallace9f11c012018-02-28 17:55:23 -0500376
Florin Corasdc2e2512018-12-03 17:47:26 -0800377class VCLThruHostStackEcho(VCLTestCase):
378 """ VCL Thru Host Stack Echo """
Dave Wallaced85075e2018-03-02 13:19:30 -0500379
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800380 @classmethod
381 def setUpClass(cls):
382 super(VCLThruHostStackEcho, cls).setUpClass()
383
384 @classmethod
385 def tearDownClass(cls):
386 super(VCLThruHostStackEcho, cls).tearDownClass()
387
Dave Wallaced85075e2018-03-02 13:19:30 -0500388 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800389 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500390
391 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800392 self.client_bi_dir_nsock_timeout = 20
393 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
394 "-I", "2",
395 self.loop0.local_ip4,
396 self.server_port]
397 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
398 self.loop0.local_ip4,
399 self.server_port]
400
401 def tearDown(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800402 self.thru_host_stack_tear_down()
403 super(VCLThruHostStackEcho, self).tearDown()
404
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700405 def show_commands_at_teardown(self):
406 self.logger.debug(self.vapi.cli("show app server"))
407 self.logger.debug(self.vapi.cli("show session verbose"))
408
Florin Corasdc2e2512018-12-03 17:47:26 -0800409
Florin Coras8a140612019-02-18 22:39:39 -0800410class VCLThruHostStackTLS(VCLTestCase):
411 """ VCL Thru Host Stack TLS """
412
413 @classmethod
414 def setUpClass(cls):
415 super(VCLThruHostStackTLS, cls).setUpClass()
416
417 @classmethod
418 def tearDownClass(cls):
419 super(VCLThruHostStackTLS, cls).tearDownClass()
420
421 def setUp(self):
422 super(VCLThruHostStackTLS, self).setUp()
423
424 self.thru_host_stack_setup()
425 self.client_uni_dir_tls_timeout = 20
Dave Wallace03dd90a2019-03-25 19:34:50 -0400426 self.server_tls_args = ["-L", self.server_port]
427 self.client_uni_dir_tls_test_args = ["-N", "1000", "-U", "-X", "-L",
Florin Coras8a140612019-02-18 22:39:39 -0800428 self.loop0.local_ip4,
429 self.server_port]
430
431 def test_vcl_thru_host_stack_tls_uni_dir(self):
432 """ run VCL thru host stack uni-directional TLS test """
433
434 self.timeout = self.client_uni_dir_tls_timeout
435 self.thru_host_stack_test("vcl_test_server", self.server_tls_args,
436 "vcl_test_client",
437 self.client_uni_dir_tls_test_args)
438
439 def tearDown(self):
Florin Coras8a140612019-02-18 22:39:39 -0800440 self.thru_host_stack_tear_down()
441 super(VCLThruHostStackTLS, self).tearDown()
442
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700443 def show_commands_at_teardown(self):
444 self.logger.debug(self.vapi.cli("show app server"))
445 self.logger.debug(self.vapi.cli("show session verbose 2"))
446
Florin Coras8a140612019-02-18 22:39:39 -0800447
Florin Corasdc2e2512018-12-03 17:47:26 -0800448class VCLThruHostStackBidirNsock(VCLTestCase):
449 """ VCL Thru Host Stack Bidir Nsock """
450
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800451 @classmethod
452 def setUpClass(cls):
453 super(VCLThruHostStackBidirNsock, cls).setUpClass()
454
455 @classmethod
456 def tearDownClass(cls):
457 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
458
Florin Corasdc2e2512018-12-03 17:47:26 -0800459 def setUp(self):
460 super(VCLThruHostStackBidirNsock, self).setUp()
461
462 self.thru_host_stack_setup()
463 self.client_bi_dir_nsock_timeout = 20
464 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
465 "-I", "2",
466 self.loop0.local_ip4,
467 self.server_port]
468 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
469 self.loop0.local_ip4,
470 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500471
472 def tearDown(self):
473 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800474 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500475
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700476 def show_commands_at_teardown(self):
477 self.logger.debug(self.vapi.cli("show session verbose 2"))
478
Dave Wallaced85075e2018-03-02 13:19:30 -0500479 def test_vcl_thru_host_stack_bi_dir_nsock(self):
480 """ run VCL thru host stack bi-directional (multiple sockets) test """
481
482 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700483 self.thru_host_stack_test("vcl_test_server", self.server_args,
484 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500485 self.client_bi_dir_nsock_test_args)
486
487
Florin Corasdc2e2512018-12-03 17:47:26 -0800488class LDPThruHostStackBidirNsock(VCLTestCase):
489 """ LDP Thru Host Stack Bidir Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500490
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800491 @classmethod
492 def setUpClass(cls):
493 super(LDPThruHostStackBidirNsock, cls).setUpClass()
494
495 @classmethod
496 def tearDownClass(cls):
497 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
498
Dave Wallaced85075e2018-03-02 13:19:30 -0500499 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800500 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500501
502 self.thru_host_stack_setup()
503 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800504 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400505 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
506 # OUCH! Host Stack Bug?
507 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400508 self.loop0.local_ip4,
509 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500510 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800511 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400512 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
513 # OUCH! Host Stack Bug?
514 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400515 self.loop0.local_ip4,
516 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500517
518 def tearDown(self):
519 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800520 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500521
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700522 def show_commands_at_teardown(self):
523 self.logger.debug(self.vapi.cli("show session verbose 2"))
524
Dave Wallaced85075e2018-03-02 13:19:30 -0500525 def test_ldp_thru_host_stack_bi_dir_nsock(self):
526 """ run LDP thru host stack bi-directional (multiple sockets) test """
527
528 self.timeout = self.client_bi_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400529 self.thru_host_stack_test("sock_test_server", self.server_args,
530 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500531 self.client_bi_dir_nsock_test_args)
532
533
Florin Corasdc2e2512018-12-03 17:47:26 -0800534class LDPThruHostStackNsock(VCLTestCase):
535 """ LDP Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500536
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800537 @classmethod
538 def setUpClass(cls):
539 super(LDPThruHostStackNsock, cls).setUpClass()
540
541 @classmethod
542 def tearDownClass(cls):
543 super(LDPThruHostStackNsock, cls).tearDownClass()
544
Dave Wallaced85075e2018-03-02 13:19:30 -0500545 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800546 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500547
548 self.thru_host_stack_setup()
549 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800550 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500551 self.numSockets = "2"
552 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800553 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500554 self.numSockets = "5"
555
Dave Wallace45cd3a32018-06-26 01:14:04 -0400556 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
557 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400558 self.loop0.local_ip4,
559 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500560
561 def tearDown(self):
562 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800563 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500564
Dave Wallaced85075e2018-03-02 13:19:30 -0500565 def test_ldp_thru_host_stack_uni_dir_nsock(self):
566 """ run LDP thru host stack uni-directional (multiple sockets) test """
567
568 self.timeout = self.client_uni_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400569 self.thru_host_stack_test("sock_test_server", self.server_args,
570 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500571 self.client_uni_dir_nsock_test_args)
572
573
Florin Corasdc2e2512018-12-03 17:47:26 -0800574class VCLThruHostStackNsock(VCLTestCase):
575 """ VCL Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500576
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800577 @classmethod
578 def setUpClass(cls):
579 super(VCLThruHostStackNsock, cls).setUpClass()
580
581 @classmethod
582 def tearDownClass(cls):
583 super(VCLThruHostStackNsock, cls).tearDownClass()
584
Dave Wallaced85075e2018-03-02 13:19:30 -0500585 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800586 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500587
588 self.thru_host_stack_setup()
589 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800590 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500591 self.numSockets = "2"
592 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800593 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500594 self.numSockets = "5"
595
Dave Wallace45cd3a32018-06-26 01:14:04 -0400596 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
597 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400598 self.loop0.local_ip4,
599 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500600
601 def tearDown(self):
602 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800603 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500604
Dave Wallaced85075e2018-03-02 13:19:30 -0500605 def test_vcl_thru_host_stack_uni_dir_nsock(self):
606 """ run VCL thru host stack uni-directional (multiple sockets) test """
607
608 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700609 self.thru_host_stack_test("vcl_test_server", self.server_args,
610 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500611 self.client_uni_dir_nsock_test_args)
612
613
Florin Corasdc2e2512018-12-03 17:47:26 -0800614class LDPThruHostStackIperf(VCLTestCase):
615 """ LDP Thru Host Stack Iperf """
Dave Wallace816833f2018-03-14 20:01:28 -0400616
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800617 @classmethod
618 def setUpClass(cls):
619 super(LDPThruHostStackIperf, cls).setUpClass()
620
621 @classmethod
622 def tearDownClass(cls):
623 super(LDPThruHostStackIperf, cls).tearDownClass()
624
Dave Wallace816833f2018-03-14 20:01:28 -0400625 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800626 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400627
628 self.thru_host_stack_setup()
629 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800630 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.loop0.local_ip4]
Dave Wallace816833f2018-03-14 20:01:28 -0400631 self.server_iperf3_args = ["-V4d", "-s"]
632
633 def tearDown(self):
634 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800635 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400636
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700637 def show_commands_at_teardown(self):
638 self.logger.debug(self.vapi.cli("show session verbose 2"))
639
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400640 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Dave Wallace816833f2018-03-14 20:01:28 -0400641 def test_ldp_thru_host_stack_iperf3(self):
642 """ run LDP thru host stack iperf3 test """
643
Dave Wallace816833f2018-03-14 20:01:28 -0400644 self.timeout = self.client_iperf3_timeout
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400645 self.thru_host_stack_test(iperf3, self.server_iperf3_args,
646 iperf3, self.client_iperf3_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400647
648
Florin Coras0ae445e2018-11-29 18:22:10 -0800649class LDPIpv6CutThruTestCase(VCLTestCase):
650 """ LDP IPv6 Cut Thru Tests """
Dave Wallacede910062018-03-20 09:22:13 -0400651
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800652 @classmethod
653 def setUpClass(cls):
654 super(LDPIpv6CutThruTestCase, cls).setUpClass()
655
656 @classmethod
657 def tearDownClass(cls):
658 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
659
Dave Wallacede910062018-03-20 09:22:13 -0400660 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800661 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400662
663 self.cut_thru_setup()
664 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -0800665 self.client_uni_dir_nsock_timeout = 20
666 self.client_bi_dir_nsock_timeout = 20
Dave Wallacede910062018-03-20 09:22:13 -0400667 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
668 self.server_ipv6_addr,
669 self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -0800670 self.client_ipv6_iperf3_args = ["-V6d", "-t 2", "-c",
Florin Corasab2f6db2018-08-31 14:31:41 -0700671 self.server_ipv6_addr]
Dave Wallacede910062018-03-20 09:22:13 -0400672 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400673 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
674 "-6",
675 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400676 self.server_ipv6_addr,
677 self.server_port]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400678 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
679 "-6",
680 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400681 self.server_ipv6_addr,
682 self.server_port]
683
684 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800685 super(LDPIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400686 self.cut_thru_tear_down()
Dave Wallacede910062018-03-20 09:22:13 -0400687
688 def test_ldp_ipv6_cut_thru_echo(self):
689 """ run LDP IPv6 cut thru echo test """
690
Florin Corasab2f6db2018-08-31 14:31:41 -0700691 self.cut_thru_test("sock_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400692 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700693 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400694 self.client_ipv6_echo_test_args)
695
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400696 @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.")
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800697 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400698 def test_ldp_ipv6_cut_thru_iperf3(self):
699 """ run LDP IPv6 cut thru iperf3 test """
700
Dave Wallacede910062018-03-20 09:22:13 -0400701 self.timeout = self.client_iperf3_timeout
Paul Vinciguerra063366e2019-06-30 15:38:55 -0400702 self.cut_thru_test(iperf3, self.server_ipv6_iperf3_args,
703 iperf3, self.client_ipv6_iperf3_args)
Dave Wallacede910062018-03-20 09:22:13 -0400704
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800705 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400706 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
707 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
708
709 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700710 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
711 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400712 self.client_ipv6_uni_dir_nsock_test_args)
713
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800714 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Florin Coras0f46e162019-07-02 19:33:15 -0700715 @unittest.skip("sock test apps need to be improved")
Dave Wallacede910062018-03-20 09:22:13 -0400716 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
717 """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """
718
719 self.timeout = self.client_bi_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_bi_dir_nsock_test_args)
723
Florin Coras0ae445e2018-11-29 18:22:10 -0800724
725class VCLIpv6CutThruTestCase(VCLTestCase):
726 """ VCL IPv6 Cut Thru Tests """
727
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800728 @classmethod
729 def setUpClass(cls):
730 super(VCLIpv6CutThruTestCase, cls).setUpClass()
731
732 @classmethod
733 def tearDownClass(cls):
734 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
735
Florin Coras0ae445e2018-11-29 18:22:10 -0800736 def setUp(self):
737 super(VCLIpv6CutThruTestCase, self).setUp()
738
739 self.cut_thru_setup()
740 self.client_uni_dir_nsock_timeout = 20
741 self.client_bi_dir_nsock_timeout = 20
742 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
743 self.server_ipv6_addr,
744 self.server_port]
745 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
746 "-6",
747 "-I", "2",
748 self.server_ipv6_addr,
749 self.server_port]
750 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
751 "-6",
752 "-I", "2",
753 self.server_ipv6_addr,
754 self.server_port]
755
756 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800757 super(VCLIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400758 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -0800759
Dave Wallacede910062018-03-20 09:22:13 -0400760 def test_vcl_ipv6_cut_thru_echo(self):
761 """ run VCL IPv6 cut thru echo test """
762
Florin Corasab2f6db2018-08-31 14:31:41 -0700763 self.cut_thru_test("vcl_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400764 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700765 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400766 self.client_ipv6_echo_test_args)
767
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800768 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400769 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
770 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
771
772 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700773 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
774 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400775 self.client_ipv6_uni_dir_nsock_test_args)
776
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800777 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400778 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
779 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
780
781 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700782 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
783 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400784 self.client_ipv6_bi_dir_nsock_test_args)
785
786
Florin Corasdc2e2512018-12-03 17:47:26 -0800787class VCLIpv6ThruHostStackEcho(VCLTestCase):
788 """ VCL IPv6 Thru Host Stack Echo """
Dave Wallacede910062018-03-20 09:22:13 -0400789
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800790 @classmethod
791 def setUpClass(cls):
792 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
793
794 @classmethod
795 def tearDownClass(cls):
796 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
797
Dave Wallacede910062018-03-20 09:22:13 -0400798 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800799 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400800
801 self.thru_host_stack_ipv6_setup()
802 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
803 self.loop0.local_ip6,
804 self.server_port]
805
806 def tearDown(self):
807 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800808 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400809
810 def test_vcl_ipv6_thru_host_stack_echo(self):
811 """ run VCL IPv6 thru host stack echo test """
812
Florin Corasdc2e2512018-12-03 17:47:26 -0800813 self.thru_host_stack_test("vcl_test_server",
Damjan Marion855e2682018-08-24 13:37:45 +0200814 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700815 "vcl_test_client",
Florin Corasdc2e2512018-12-03 17:47:26 -0800816 self.client_ipv6_echo_test_args)
Dave Wallacede910062018-03-20 09:22:13 -0400817
818
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500819if __name__ == '__main__':
820 unittest.main(testRunner=VppTestRunner)