blob: 18279e9f226e3a5dca6215b23bfed87554ce3b3b [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
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
Dave Wallacede910062018-03-20 09:22:13 -0400130 def thru_host_stack_ipv6_setup(self):
131 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200132 self.create_loopback_interfaces(2)
Dave Wallacede910062018-03-20 09:22:13 -0400133
134 table_id = 1
135
136 for i in self.lo_interfaces:
137 i.admin_up()
138
139 tbl = VppIpTable(self, table_id, is_ip6=1)
140 tbl.add_vpp_config()
141
142 i.set_table_ip6(table_id)
143 i.config_ip6()
144 table_id += 1
145
146 # Configure namespaces
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800147 self.vapi.app_namespace_add_del(namespace_id=b"1", secret=1234,
Ole Troane1ade682019-03-04 23:55:43 +0100148 sw_if_index=self.loop0.sw_if_index)
Paul Vinciguerra22ab6f72019-03-07 17:55:33 -0800149 self.vapi.app_namespace_add_del(namespace_id=b"2", secret=5678,
Ole Troane1ade682019-03-04 23:55:43 +0100150 sw_if_index=self.loop1.sw_if_index)
Dave Wallacede910062018-03-20 09:22:13 -0400151
152 # Add inter-table routes
153 ip_t01 = VppIpRoute(self, self.loop1.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700154 [VppRoutePath("::0", 0xffffffff,
Neale Ranns097fa662018-05-01 05:17:55 -0700155 nh_table_id=2)],
156 table_id=1)
Dave Wallacede910062018-03-20 09:22:13 -0400157 ip_t10 = VppIpRoute(self, self.loop0.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700158 [VppRoutePath("::0", 0xffffffff,
Neale Ranns097fa662018-05-01 05:17:55 -0700159 nh_table_id=1)],
160 table_id=2)
Dave Wallacede910062018-03-20 09:22:13 -0400161 ip_t01.add_vpp_config()
162 ip_t10.add_vpp_config()
163 self.logger.debug(self.vapi.cli("show interface addr"))
164 self.logger.debug(self.vapi.cli("show ip6 fib"))
165
166 def thru_host_stack_ipv6_tear_down(self):
167 for i in self.lo_interfaces:
168 i.unconfig_ip6()
169 i.set_table_ip6(0)
170 i.admin_down()
171
172 self.vapi.session_enable_disable(is_enabled=0)
173
Dave Wallace816833f2018-03-14 20:01:28 -0400174 def thru_host_stack_test(self, server_app, server_args,
175 client_app, client_args):
Dave Wallace9f11c012018-02-28 17:55:23 -0500176 self.env = {'VCL_API_PREFIX': self.shm_prefix,
177 'VCL_APP_SCOPE_GLOBAL': "true",
Florin Coras56b39f62018-03-27 17:29:32 -0700178 'VCL_APP_NAMESPACE_ID': "1",
Dave Wallace9f11c012018-02-28 17:55:23 -0500179 'VCL_APP_NAMESPACE_SECRET': "1234"}
180
Dave Wallace816833f2018-03-14 20:01:28 -0400181 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500182 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500183 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800184 self.sleep(self.pre_test_sleep)
Dave Wallace42996c02018-02-26 14:40:13 -0500185
Florin Coras56b39f62018-03-27 17:29:32 -0700186 self.env.update({'VCL_APP_NAMESPACE_ID': "2",
Dave Wallace42996c02018-02-26 14:40:13 -0500187 'VCL_APP_NAMESPACE_SECRET': "5678"})
Dave Wallace816833f2018-03-14 20:01:28 -0400188 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500189 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500190 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500191 worker_client.join(self.timeout)
192
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500193 try:
194 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200195 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500196 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800197 self.sleep(self.post_test_sleep)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500198
Dave Wallace9f11c012018-02-28 17:55:23 -0500199 def validateResults(self, worker_client, worker_server, timeout):
Dave Wallaced85075e2018-03-02 13:19:30 -0500200 if os.path.isdir('/proc/{}'.format(worker_server.process.pid)):
201 self.logger.info("Killing server worker process (pid %d)" %
202 worker_server.process.pid)
Dave Barachad646872019-05-06 10:49:41 -0400203 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM)
Dave Wallaced85075e2018-03-02 13:19:30 -0500204 worker_server.join()
Dave Wallace9f11c012018-02-28 17:55:23 -0500205 self.logger.info("Client worker result is `%s'" % worker_client.result)
206 error = False
207 if worker_client.result is None:
208 try:
209 error = True
210 self.logger.error(
Dave Wallaced85075e2018-03-02 13:19:30 -0500211 "Timeout: %ss! Killing client worker process (pid %d)" %
212 (timeout, worker_client.process.pid))
Dave Wallace9f11c012018-02-28 17:55:23 -0500213 os.killpg(os.getpgid(worker_client.process.pid),
Florin Corasdc2e2512018-12-03 17:47:26 -0800214 signal.SIGKILL)
Dave Wallace9f11c012018-02-28 17:55:23 -0500215 worker_client.join()
Dave Wallace07c0a9d2019-05-13 19:21:24 -0400216 except OSError:
Dave Wallace9f11c012018-02-28 17:55:23 -0500217 self.logger.debug(
218 "Couldn't kill client worker process")
219 raise
220 if error:
Dave Wallace9f11c012018-02-28 17:55:23 -0500221 raise Exception(
222 "Timeout! Client worker did not finish in %ss" % timeout)
223 self.assert_equal(worker_client.result, 0, "Binary test return code")
224
225
Florin Coras0ae445e2018-11-29 18:22:10 -0800226class LDPCutThruTestCase(VCLTestCase):
227 """ LDP Cut Thru Tests """
Dave Wallace9f11c012018-02-28 17:55:23 -0500228
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800229 @classmethod
230 def setUpClass(cls):
231 super(LDPCutThruTestCase, cls).setUpClass()
232
233 @classmethod
234 def tearDownClass(cls):
235 super(LDPCutThruTestCase, cls).tearDownClass()
236
Dave Wallace9f11c012018-02-28 17:55:23 -0500237 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800238 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500239
240 self.cut_thru_setup()
Dave Wallacede910062018-03-20 09:22:13 -0400241 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
242 self.server_addr, self.server_port]
Dave Wallace816833f2018-03-14 20:01:28 -0400243 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800244 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.server_addr]
Dave Wallace816833f2018-03-14 20:01:28 -0400245 self.server_iperf3_args = ["-V4d", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800246 self.client_uni_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400247 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
248 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400249 self.server_addr,
250 self.server_port]
Florin Coras2eb42e72018-11-29 00:39:53 -0800251 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400252 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
253 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400254 self.server_addr,
255 self.server_port]
Dave Wallace9f11c012018-02-28 17:55:23 -0500256
257 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800258 super(LDPCutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400259 self.cut_thru_tear_down()
Dave Wallace9f11c012018-02-28 17:55:23 -0500260
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700261 def show_commands_at_teardown(self):
262 self.logger.debug(self.vapi.cli("show session verbose 2"))
263
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800264 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500265 def test_ldp_cut_thru_echo(self):
266 """ run LDP cut thru echo test """
267
Florin Corasab2f6db2018-08-31 14:31:41 -0700268 self.cut_thru_test("sock_test_server", self.server_args,
269 "sock_test_client", self.client_echo_test_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400270
271 def test_ldp_cut_thru_iperf3(self):
272 """ run LDP cut thru iperf3 test """
273
274 try:
275 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800276 except subprocess.CalledProcessError:
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800277 self.logger.error(
278 "WARNING: Subprocess returned non-0 running 'iperf3 -v")
Dave Wallace816833f2018-03-14 20:01:28 -0400279 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
280 return
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800281 except OSError as e:
282 self.logger.error(
283 "WARNING: Subprocess returned with OS error (%s) %s\n"
284 " 'iperf3' is likely not installed,",
285 e.errno, e.strerror)
286 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
287 return
288 except Exception:
289 self.logger.exception(
290 "Subprocess returned non-0 running 'iperf3 -v")
Dave Wallace816833f2018-03-14 20:01:28 -0400291
292 self.timeout = self.client_iperf3_timeout
293 self.cut_thru_test("iperf3", self.server_iperf3_args,
294 "iperf3", self.client_iperf3_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500295
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800296 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500297 def test_ldp_cut_thru_uni_dir_nsock(self):
298 """ run LDP cut thru uni-directional (multiple sockets) test """
299
300 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700301 self.cut_thru_test("sock_test_server", self.server_args,
302 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500303 self.client_uni_dir_nsock_test_args)
304
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800305 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500306 def test_ldp_cut_thru_bi_dir_nsock(self):
307 """ run LDP cut thru bi-directional (multiple sockets) test """
308
309 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700310 self.cut_thru_test("sock_test_server", self.server_args,
311 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500312 self.client_bi_dir_nsock_test_args)
313
Florin Coras0ae445e2018-11-29 18:22:10 -0800314
315class VCLCutThruTestCase(VCLTestCase):
316 """ VCL Cut Thru Tests """
317
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800318 @classmethod
319 def setUpClass(cls):
320 super(VCLCutThruTestCase, cls).setUpClass()
321
322 @classmethod
323 def tearDownClass(cls):
324 super(VCLCutThruTestCase, cls).tearDownClass()
325
Florin Coras0ae445e2018-11-29 18:22:10 -0800326 def setUp(self):
327 super(VCLCutThruTestCase, self).setUp()
328
329 self.cut_thru_setup()
330 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
331 self.server_addr, self.server_port]
332
333 self.client_uni_dir_nsock_timeout = 20
334 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
335 "-I", "2",
336 self.server_addr,
337 self.server_port]
338 self.client_bi_dir_nsock_timeout = 20
339 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
340 "-I", "2",
341 self.server_addr,
342 self.server_port]
343
344 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800345 super(VCLCutThruTestCase, self).tearDown()
346
Florin Coras317b8e02019-04-17 09:57:46 -0700347 def show_commands_at_teardown(self):
348 self.logger.debug(self.vapi.cli("show session verbose 2"))
349
Dave Wallace9f11c012018-02-28 17:55:23 -0500350 def test_vcl_cut_thru_echo(self):
351 """ run VCL cut thru echo test """
352
Florin Corasab2f6db2018-08-31 14:31:41 -0700353 self.cut_thru_test("vcl_test_server", self.server_args,
354 "vcl_test_client", self.client_echo_test_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500355
Dave Wallaced85075e2018-03-02 13:19:30 -0500356 def test_vcl_cut_thru_uni_dir_nsock(self):
357 """ run VCL cut thru uni-directional (multiple sockets) test """
358
359 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700360 self.cut_thru_test("vcl_test_server", self.server_args,
361 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500362 self.client_uni_dir_nsock_test_args)
363
Dave Wallaced85075e2018-03-02 13:19:30 -0500364 def test_vcl_cut_thru_bi_dir_nsock(self):
365 """ run VCL cut thru bi-directional (multiple sockets) test """
366
367 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700368 self.cut_thru_test("vcl_test_server", self.server_args,
369 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500370 self.client_bi_dir_nsock_test_args)
371
Dave Wallace9f11c012018-02-28 17:55:23 -0500372
Florin Corasdc2e2512018-12-03 17:47:26 -0800373class VCLThruHostStackEcho(VCLTestCase):
374 """ VCL Thru Host Stack Echo """
Dave Wallaced85075e2018-03-02 13:19:30 -0500375
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800376 @classmethod
377 def setUpClass(cls):
378 super(VCLThruHostStackEcho, cls).setUpClass()
379
380 @classmethod
381 def tearDownClass(cls):
382 super(VCLThruHostStackEcho, cls).tearDownClass()
383
Dave Wallaced85075e2018-03-02 13:19:30 -0500384 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800385 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500386
387 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800388 self.client_bi_dir_nsock_timeout = 20
389 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
390 "-I", "2",
391 self.loop0.local_ip4,
392 self.server_port]
393 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
394 self.loop0.local_ip4,
395 self.server_port]
396
397 def tearDown(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800398 self.thru_host_stack_tear_down()
399 super(VCLThruHostStackEcho, self).tearDown()
400
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700401 def show_commands_at_teardown(self):
402 self.logger.debug(self.vapi.cli("show app server"))
403 self.logger.debug(self.vapi.cli("show session verbose"))
404
Florin Corasdc2e2512018-12-03 17:47:26 -0800405
Florin Coras8a140612019-02-18 22:39:39 -0800406class VCLThruHostStackTLS(VCLTestCase):
407 """ VCL Thru Host Stack TLS """
408
409 @classmethod
410 def setUpClass(cls):
411 super(VCLThruHostStackTLS, cls).setUpClass()
412
413 @classmethod
414 def tearDownClass(cls):
415 super(VCLThruHostStackTLS, cls).tearDownClass()
416
417 def setUp(self):
418 super(VCLThruHostStackTLS, self).setUp()
419
420 self.thru_host_stack_setup()
421 self.client_uni_dir_tls_timeout = 20
Dave Wallace03dd90a2019-03-25 19:34:50 -0400422 self.server_tls_args = ["-L", self.server_port]
423 self.client_uni_dir_tls_test_args = ["-N", "1000", "-U", "-X", "-L",
Florin Coras8a140612019-02-18 22:39:39 -0800424 self.loop0.local_ip4,
425 self.server_port]
426
427 def test_vcl_thru_host_stack_tls_uni_dir(self):
428 """ run VCL thru host stack uni-directional TLS test """
429
430 self.timeout = self.client_uni_dir_tls_timeout
431 self.thru_host_stack_test("vcl_test_server", self.server_tls_args,
432 "vcl_test_client",
433 self.client_uni_dir_tls_test_args)
434
435 def tearDown(self):
Florin Coras8a140612019-02-18 22:39:39 -0800436 self.thru_host_stack_tear_down()
437 super(VCLThruHostStackTLS, self).tearDown()
438
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700439 def show_commands_at_teardown(self):
440 self.logger.debug(self.vapi.cli("show app server"))
441 self.logger.debug(self.vapi.cli("show session verbose 2"))
442
Florin Coras8a140612019-02-18 22:39:39 -0800443
Florin Corasdc2e2512018-12-03 17:47:26 -0800444class VCLThruHostStackBidirNsock(VCLTestCase):
445 """ VCL Thru Host Stack Bidir Nsock """
446
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800447 @classmethod
448 def setUpClass(cls):
449 super(VCLThruHostStackBidirNsock, cls).setUpClass()
450
451 @classmethod
452 def tearDownClass(cls):
453 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
454
Florin Corasdc2e2512018-12-03 17:47:26 -0800455 def setUp(self):
456 super(VCLThruHostStackBidirNsock, self).setUp()
457
458 self.thru_host_stack_setup()
459 self.client_bi_dir_nsock_timeout = 20
460 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
461 "-I", "2",
462 self.loop0.local_ip4,
463 self.server_port]
464 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
465 self.loop0.local_ip4,
466 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500467
468 def tearDown(self):
469 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800470 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500471
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700472 def show_commands_at_teardown(self):
473 self.logger.debug(self.vapi.cli("show session verbose 2"))
474
Dave Wallaced85075e2018-03-02 13:19:30 -0500475 def test_vcl_thru_host_stack_bi_dir_nsock(self):
476 """ run VCL thru host stack bi-directional (multiple sockets) test """
477
478 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700479 self.thru_host_stack_test("vcl_test_server", self.server_args,
480 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500481 self.client_bi_dir_nsock_test_args)
482
483
Florin Corasdc2e2512018-12-03 17:47:26 -0800484class LDPThruHostStackBidirNsock(VCLTestCase):
485 """ LDP Thru Host Stack Bidir Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500486
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800487 @classmethod
488 def setUpClass(cls):
489 super(LDPThruHostStackBidirNsock, cls).setUpClass()
490
491 @classmethod
492 def tearDownClass(cls):
493 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
494
Dave Wallaced85075e2018-03-02 13:19:30 -0500495 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800496 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500497
498 self.thru_host_stack_setup()
499 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800500 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400501 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
502 # OUCH! Host Stack Bug?
503 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400504 self.loop0.local_ip4,
505 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500506 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800507 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400508 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
509 # OUCH! Host Stack Bug?
510 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400511 self.loop0.local_ip4,
512 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500513
514 def tearDown(self):
515 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800516 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500517
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700518 def show_commands_at_teardown(self):
519 self.logger.debug(self.vapi.cli("show session verbose 2"))
520
Dave Wallaced85075e2018-03-02 13:19:30 -0500521 def test_ldp_thru_host_stack_bi_dir_nsock(self):
522 """ run LDP thru host stack bi-directional (multiple sockets) test """
523
524 self.timeout = self.client_bi_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400525 self.thru_host_stack_test("sock_test_server", self.server_args,
526 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500527 self.client_bi_dir_nsock_test_args)
528
529
Florin Corasdc2e2512018-12-03 17:47:26 -0800530class LDPThruHostStackNsock(VCLTestCase):
531 """ LDP Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500532
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800533 @classmethod
534 def setUpClass(cls):
535 super(LDPThruHostStackNsock, cls).setUpClass()
536
537 @classmethod
538 def tearDownClass(cls):
539 super(LDPThruHostStackNsock, cls).tearDownClass()
540
Dave Wallaced85075e2018-03-02 13:19:30 -0500541 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800542 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500543
544 self.thru_host_stack_setup()
545 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800546 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500547 self.numSockets = "2"
548 else:
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 = "5"
551
Dave Wallace45cd3a32018-06-26 01:14:04 -0400552 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
553 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400554 self.loop0.local_ip4,
555 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500556
557 def tearDown(self):
558 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800559 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500560
Dave Wallaced85075e2018-03-02 13:19:30 -0500561 def test_ldp_thru_host_stack_uni_dir_nsock(self):
562 """ run LDP thru host stack uni-directional (multiple sockets) test """
563
564 self.timeout = self.client_uni_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400565 self.thru_host_stack_test("sock_test_server", self.server_args,
566 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500567 self.client_uni_dir_nsock_test_args)
568
569
Florin Corasdc2e2512018-12-03 17:47:26 -0800570class VCLThruHostStackNsock(VCLTestCase):
571 """ VCL Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500572
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800573 @classmethod
574 def setUpClass(cls):
575 super(VCLThruHostStackNsock, cls).setUpClass()
576
577 @classmethod
578 def tearDownClass(cls):
579 super(VCLThruHostStackNsock, cls).tearDownClass()
580
Dave Wallaced85075e2018-03-02 13:19:30 -0500581 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800582 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500583
584 self.thru_host_stack_setup()
585 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800586 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500587 self.numSockets = "2"
588 else:
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 = "5"
591
Dave Wallace45cd3a32018-06-26 01:14:04 -0400592 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
593 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400594 self.loop0.local_ip4,
595 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500596
597 def tearDown(self):
598 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800599 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500600
Dave Wallaced85075e2018-03-02 13:19:30 -0500601 def test_vcl_thru_host_stack_uni_dir_nsock(self):
602 """ run VCL thru host stack uni-directional (multiple sockets) test """
603
604 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700605 self.thru_host_stack_test("vcl_test_server", self.server_args,
606 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500607 self.client_uni_dir_nsock_test_args)
608
609
Florin Corasdc2e2512018-12-03 17:47:26 -0800610class LDPThruHostStackIperf(VCLTestCase):
611 """ LDP Thru Host Stack Iperf """
Dave Wallace816833f2018-03-14 20:01:28 -0400612
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800613 @classmethod
614 def setUpClass(cls):
615 super(LDPThruHostStackIperf, cls).setUpClass()
616
617 @classmethod
618 def tearDownClass(cls):
619 super(LDPThruHostStackIperf, cls).tearDownClass()
620
Dave Wallace816833f2018-03-14 20:01:28 -0400621 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800622 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400623
624 self.thru_host_stack_setup()
625 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800626 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.loop0.local_ip4]
Dave Wallace816833f2018-03-14 20:01:28 -0400627 self.server_iperf3_args = ["-V4d", "-s"]
628
629 def tearDown(self):
630 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800631 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400632
Paul Vinciguerra90cf21b2019-03-13 09:23:05 -0700633 def show_commands_at_teardown(self):
634 self.logger.debug(self.vapi.cli("show session verbose 2"))
635
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
639 try:
640 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800641 except subprocess.CalledProcessError:
Dave Wallace816833f2018-03-14 20:01:28 -0400642 self.logger.error("WARNING: 'iperf3' is not installed,")
643 self.logger.error(
644 " 'test_ldp_thru_host_stack_iperf3' not run!")
645 return
Paul Vinciguerra38a4ec72018-11-28 11:34:21 -0800646 except OSError as e:
647 self.logger.error("WARNING: 'iperf3' is not installed,")
648 self.logger.error(" 'test' not run!")
649 return
650 except Exception as e:
651 self.logger.error("WARNING: 'iperf3' unexpected error,")
652 self.logger.error(" 'test' not run!")
653 return
Dave Wallace816833f2018-03-14 20:01:28 -0400654
655 self.timeout = self.client_iperf3_timeout
656 self.thru_host_stack_test("iperf3", self.server_iperf3_args,
657 "iperf3", self.client_iperf3_args)
658
659
Florin Coras0ae445e2018-11-29 18:22:10 -0800660class LDPIpv6CutThruTestCase(VCLTestCase):
661 """ LDP IPv6 Cut Thru Tests """
Dave Wallacede910062018-03-20 09:22:13 -0400662
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800663 @classmethod
664 def setUpClass(cls):
665 super(LDPIpv6CutThruTestCase, cls).setUpClass()
666
667 @classmethod
668 def tearDownClass(cls):
669 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
670
Dave Wallacede910062018-03-20 09:22:13 -0400671 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800672 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400673
674 self.cut_thru_setup()
675 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -0800676 self.client_uni_dir_nsock_timeout = 20
677 self.client_bi_dir_nsock_timeout = 20
Dave Wallacede910062018-03-20 09:22:13 -0400678 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
679 self.server_ipv6_addr,
680 self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -0800681 self.client_ipv6_iperf3_args = ["-V6d", "-t 2", "-c",
Florin Corasab2f6db2018-08-31 14:31:41 -0700682 self.server_ipv6_addr]
Dave Wallacede910062018-03-20 09:22:13 -0400683 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400684 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
685 "-6",
686 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400687 self.server_ipv6_addr,
688 self.server_port]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400689 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
690 "-6",
691 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400692 self.server_ipv6_addr,
693 self.server_port]
694
695 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800696 super(LDPIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400697 self.cut_thru_tear_down()
Dave Wallacede910062018-03-20 09:22:13 -0400698
699 def test_ldp_ipv6_cut_thru_echo(self):
700 """ run LDP IPv6 cut thru echo test """
701
Florin Corasab2f6db2018-08-31 14:31:41 -0700702 self.cut_thru_test("sock_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400703 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700704 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400705 self.client_ipv6_echo_test_args)
706
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800707 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400708 def test_ldp_ipv6_cut_thru_iperf3(self):
709 """ run LDP IPv6 cut thru iperf3 test """
710
711 try:
712 subprocess.check_output(['iperf3', '-v'])
713 except:
714 self.logger.error("WARNING: 'iperf3' is not installed,")
715 self.logger.error(
716 " 'test_ldp_ipv6_cut_thru_iperf3' not run!")
717 return
718
719 self.timeout = self.client_iperf3_timeout
720 self.cut_thru_test("iperf3", self.server_ipv6_iperf3_args,
721 "iperf3", self.client_ipv6_iperf3_args)
722
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800723 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400724 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
725 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
726
727 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700728 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
729 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400730 self.client_ipv6_uni_dir_nsock_test_args)
731
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800732 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400733 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
734 """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """
735
736 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700737 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
738 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400739 self.client_ipv6_bi_dir_nsock_test_args)
740
Florin Coras0ae445e2018-11-29 18:22:10 -0800741
742class VCLIpv6CutThruTestCase(VCLTestCase):
743 """ VCL IPv6 Cut Thru Tests """
744
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800745 @classmethod
746 def setUpClass(cls):
747 super(VCLIpv6CutThruTestCase, cls).setUpClass()
748
749 @classmethod
750 def tearDownClass(cls):
751 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
752
Florin Coras0ae445e2018-11-29 18:22:10 -0800753 def setUp(self):
754 super(VCLIpv6CutThruTestCase, self).setUp()
755
756 self.cut_thru_setup()
757 self.client_uni_dir_nsock_timeout = 20
758 self.client_bi_dir_nsock_timeout = 20
759 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
760 self.server_ipv6_addr,
761 self.server_port]
762 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
763 "-6",
764 "-I", "2",
765 self.server_ipv6_addr,
766 self.server_port]
767 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
768 "-6",
769 "-I", "2",
770 self.server_ipv6_addr,
771 self.server_port]
772
773 def tearDown(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800774 super(VCLIpv6CutThruTestCase, self).tearDown()
Paul Vinciguerra9673e3e2019-05-10 20:41:08 -0400775 self.cut_thru_tear_down()
Florin Coras0ae445e2018-11-29 18:22:10 -0800776
Dave Wallacede910062018-03-20 09:22:13 -0400777 def test_vcl_ipv6_cut_thru_echo(self):
778 """ run VCL IPv6 cut thru echo test """
779
Florin Corasab2f6db2018-08-31 14:31:41 -0700780 self.cut_thru_test("vcl_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400781 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700782 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400783 self.client_ipv6_echo_test_args)
784
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800785 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400786 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
787 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
788
789 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700790 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
791 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400792 self.client_ipv6_uni_dir_nsock_test_args)
793
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800794 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400795 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
796 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
797
798 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700799 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
800 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400801 self.client_ipv6_bi_dir_nsock_test_args)
802
803
Florin Corasdc2e2512018-12-03 17:47:26 -0800804class VCLIpv6ThruHostStackEcho(VCLTestCase):
805 """ VCL IPv6 Thru Host Stack Echo """
Dave Wallacede910062018-03-20 09:22:13 -0400806
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800807 @classmethod
808 def setUpClass(cls):
809 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
810
811 @classmethod
812 def tearDownClass(cls):
813 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
814
Dave Wallacede910062018-03-20 09:22:13 -0400815 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800816 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400817
818 self.thru_host_stack_ipv6_setup()
819 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
820 self.loop0.local_ip6,
821 self.server_port]
822
823 def tearDown(self):
824 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800825 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400826
827 def test_vcl_ipv6_thru_host_stack_echo(self):
828 """ run VCL IPv6 thru host stack echo test """
829
Florin Corasdc2e2512018-12-03 17:47:26 -0800830 self.thru_host_stack_test("vcl_test_server",
Damjan Marion855e2682018-08-24 13:37:45 +0200831 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700832 "vcl_test_client",
Florin Corasdc2e2512018-12-03 17:47:26 -0800833 self.client_ipv6_echo_test_args)
Dave Wallacede910062018-03-20 09:22:13 -0400834
835
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500836if __name__ == '__main__':
837 unittest.main(testRunner=VppTestRunner)