blob: bd7eb76f07e499b1bb87a9b499767d191dd09ab2 [file] [log] [blame]
Dave Wallacecfcf2f42018-02-16 18:31:56 -05001#!/usr/bin/env python
2""" Vpp VCL tests """
3
4import unittest
5import os
Dave Wallace816833f2018-03-14 20:01:28 -04006import subprocess
Dave Wallacecfcf2f42018-02-16 18:31:56 -05007import signal
Dave Wallaced85075e2018-03-02 13:19:30 -05008from framework import VppTestCase, VppTestRunner, running_extended_tests, \
9 Worker
Florin Coras56b39f62018-03-27 17:29:32 -070010from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, DpoProto
Dave Wallacecfcf2f42018-02-16 18:31:56 -050011
12
Dave Wallace816833f2018-03-14 20:01:28 -040013class VCLAppWorker(Worker):
Dave Wallace42996c02018-02-26 14:40:13 -050014 """ VCL Test Application Worker """
15
Dave Wallaced85075e2018-03-02 13:19:30 -050016 def __init__(self, build_dir, appname, args, logger, env={}):
Damjan Marion855e2682018-08-24 13:37:45 +020017 vcl_lib_dir = "%s/vpp/lib" % build_dir
Dave Wallace816833f2018-03-14 20:01:28 -040018 if "iperf" in appname:
19 app = appname
Dave Wallace9f11c012018-02-28 17:55:23 -050020 env.update({'LD_PRELOAD':
Damjan Marion855e2682018-08-24 13:37:45 +020021 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Florin Corasab2f6db2018-08-31 14:31:41 -070022 elif "sock" in appname:
23 app = "%s/vpp/bin/%s" % (build_dir, appname)
24 env.update({'LD_PRELOAD':
25 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
Dave Wallace816833f2018-03-14 20:01:28 -040026 else:
Florin Corasab2f6db2018-08-31 14:31:41 -070027 app = "%s/vpp/bin/%s" % (build_dir, appname)
Dave Wallace9f11c012018-02-28 17:55:23 -050028 self.args = [app] + args
Dave Wallace816833f2018-03-14 20:01:28 -040029 super(VCLAppWorker, self).__init__(self.args, logger, env)
Dave Wallace42996c02018-02-26 14:40:13 -050030
31
Dave Wallace816833f2018-03-14 20:01:28 -040032class VCLTestCase(VppTestCase):
Dave Wallace42996c02018-02-26 14:40:13 -050033 """ VCL Test Class """
34
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080035 @classmethod
36 def setUpClass(cls):
37 super(VCLTestCase, cls).setUpClass()
38
39 @classmethod
40 def tearDownClass(cls):
41 super(VCLTestCase, cls).tearDownClass()
42
43 def setUp(self):
Klement Sekerab8c72a42018-11-08 11:21:39 +010044 var = "VPP_BUILD_DIR"
Dave Wallaced85075e2018-03-02 13:19:30 -050045 self.build_dir = os.getenv(var, None)
46 if self.build_dir is None:
47 raise Exception("Environment variable `%s' not set" % var)
48 self.vppDebug = 'vpp_debug' in self.build_dir
Dave Wallace9f11c012018-02-28 17:55:23 -050049 self.server_addr = "127.0.0.1"
50 self.server_port = "22000"
Dave Wallace816833f2018-03-14 20:01:28 -040051 self.server_args = [self.server_port]
Dave Wallacede910062018-03-20 09:22:13 -040052 self.server_ipv6_addr = "::1"
53 self.server_ipv6_args = ["-6", self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -080054 self.timeout = 20
Dave Wallace9f11c012018-02-28 17:55:23 -050055 self.echo_phrase = "Hello, world! Jenny is a friend of mine."
Florin Corasdc2e2512018-12-03 17:47:26 -080056 self.pre_test_sleep = 0.3
57 self.post_test_sleep = 0.2
58
59 if os.path.isfile("/tmp/ldp_server_af_unix_socket"):
60 os.remove("/tmp/ldp_server_af_unix_socket")
Dave Wallace42996c02018-02-26 14:40:13 -050061
Paul Vinciguerra8d991d92019-01-25 14:05:48 -080062 super(VCLTestCase, self).setUp()
Dave Wallace42996c02018-02-26 14:40:13 -050063
Dave Wallace9f11c012018-02-28 17:55:23 -050064 def cut_thru_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050065 self.vapi.session_enable_disable(is_enabled=1)
66
Dave Wallace9f11c012018-02-28 17:55:23 -050067 def cut_thru_tear_down(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050068 self.vapi.session_enable_disable(is_enabled=0)
69
Dave Wallace816833f2018-03-14 20:01:28 -040070 def cut_thru_test(self, server_app, server_args, client_app, client_args):
Dave Wallace42996c02018-02-26 14:40:13 -050071 self.env = {'VCL_API_PREFIX': self.shm_prefix,
72 'VCL_APP_SCOPE_LOCAL': "true"}
73
Dave Wallace816833f2018-03-14 20:01:28 -040074 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -050075 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050076 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -080077 self.sleep(self.pre_test_sleep)
Dave Wallace816833f2018-03-14 20:01:28 -040078 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -050079 self.logger, self.env)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050080 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -050081 worker_client.join(self.timeout)
Dave Wallacefef3f7b2018-03-09 12:04:10 -050082 try:
83 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +020084 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -050085 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -080086 self.sleep(self.post_test_sleep)
Dave Wallacecfcf2f42018-02-16 18:31:56 -050087
Dave Wallace9f11c012018-02-28 17:55:23 -050088 def thru_host_stack_setup(self):
Dave Wallacea67a03e2018-02-20 12:39:37 -050089 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +020090 self.create_loopback_interfaces(2)
Dave Wallacea67a03e2018-02-20 12:39:37 -050091
Florin Coras56b39f62018-03-27 17:29:32 -070092 table_id = 1
Dave Wallacea67a03e2018-02-20 12:39:37 -050093
94 for i in self.lo_interfaces:
95 i.admin_up()
96
97 if table_id != 0:
98 tbl = VppIpTable(self, table_id)
99 tbl.add_vpp_config()
100
101 i.set_table_ip4(table_id)
102 i.config_ip4()
103 table_id += 1
104
105 # Configure namespaces
Florin Coras56b39f62018-03-27 17:29:32 -0700106 self.vapi.app_namespace_add(namespace_id="1", secret=1234,
Dave Wallacea67a03e2018-02-20 12:39:37 -0500107 sw_if_index=self.loop0.sw_if_index)
Florin Coras56b39f62018-03-27 17:29:32 -0700108 self.vapi.app_namespace_add(namespace_id="2", secret=5678,
Dave Wallacea67a03e2018-02-20 12:39:37 -0500109 sw_if_index=self.loop1.sw_if_index)
110
Dave Wallacea67a03e2018-02-20 12:39:37 -0500111 # Add inter-table routes
112 ip_t01 = VppIpRoute(self, self.loop1.local_ip4, 32,
113 [VppRoutePath("0.0.0.0",
114 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700115 nh_table_id=2)], table_id=1)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500116 ip_t10 = VppIpRoute(self, self.loop0.local_ip4, 32,
117 [VppRoutePath("0.0.0.0",
118 0xffffffff,
Florin Coras56b39f62018-03-27 17:29:32 -0700119 nh_table_id=1)], table_id=2)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500120 ip_t01.add_vpp_config()
121 ip_t10.add_vpp_config()
Florin Coras56b39f62018-03-27 17:29:32 -0700122 self.logger.debug(self.vapi.cli("show ip fib"))
Dave Wallacea67a03e2018-02-20 12:39:37 -0500123
Dave Wallace9f11c012018-02-28 17:55:23 -0500124 def thru_host_stack_tear_down(self):
125 for i in self.lo_interfaces:
126 i.unconfig_ip4()
127 i.set_table_ip4(0)
128 i.admin_down()
129
130 self.vapi.session_enable_disable(is_enabled=0)
131
Dave Wallacede910062018-03-20 09:22:13 -0400132 def thru_host_stack_ipv6_setup(self):
133 self.vapi.session_enable_disable(is_enabled=1)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200134 self.create_loopback_interfaces(2)
Dave Wallacede910062018-03-20 09:22:13 -0400135
136 table_id = 1
137
138 for i in self.lo_interfaces:
139 i.admin_up()
140
141 tbl = VppIpTable(self, table_id, is_ip6=1)
142 tbl.add_vpp_config()
143
144 i.set_table_ip6(table_id)
145 i.config_ip6()
146 table_id += 1
147
148 # Configure namespaces
Florin Coras56b39f62018-03-27 17:29:32 -0700149 self.vapi.app_namespace_add(namespace_id="1", secret=1234,
Dave Wallacede910062018-03-20 09:22:13 -0400150 sw_if_index=self.loop0.sw_if_index)
Florin Coras56b39f62018-03-27 17:29:32 -0700151 self.vapi.app_namespace_add(namespace_id="2", secret=5678,
Dave Wallacede910062018-03-20 09:22:13 -0400152 sw_if_index=self.loop1.sw_if_index)
153
154 # Add inter-table routes
155 ip_t01 = VppIpRoute(self, self.loop1.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700156 [VppRoutePath("::0", 0xffffffff,
157 nh_table_id=2,
158 proto=DpoProto.DPO_PROTO_IP6)],
Dave Wallacede910062018-03-20 09:22:13 -0400159 table_id=1, is_ip6=1)
160 ip_t10 = VppIpRoute(self, self.loop0.local_ip6, 128,
Florin Coras56b39f62018-03-27 17:29:32 -0700161 [VppRoutePath("::0", 0xffffffff,
162 nh_table_id=1,
163 proto=DpoProto.DPO_PROTO_IP6)],
Dave Wallacede910062018-03-20 09:22:13 -0400164 table_id=2, is_ip6=1)
165 ip_t01.add_vpp_config()
166 ip_t10.add_vpp_config()
167 self.logger.debug(self.vapi.cli("show interface addr"))
168 self.logger.debug(self.vapi.cli("show ip6 fib"))
169
170 def thru_host_stack_ipv6_tear_down(self):
171 for i in self.lo_interfaces:
172 i.unconfig_ip6()
173 i.set_table_ip6(0)
174 i.admin_down()
175
176 self.vapi.session_enable_disable(is_enabled=0)
177
Dave Wallace816833f2018-03-14 20:01:28 -0400178 def thru_host_stack_test(self, server_app, server_args,
179 client_app, client_args):
Dave Wallace9f11c012018-02-28 17:55:23 -0500180 self.env = {'VCL_API_PREFIX': self.shm_prefix,
181 'VCL_APP_SCOPE_GLOBAL': "true",
Florin Coras56b39f62018-03-27 17:29:32 -0700182 'VCL_APP_NAMESPACE_ID': "1",
Dave Wallace9f11c012018-02-28 17:55:23 -0500183 'VCL_APP_NAMESPACE_SECRET': "1234"}
184
Dave Wallace816833f2018-03-14 20:01:28 -0400185 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500186 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500187 worker_server.start()
Florin Corasdc2e2512018-12-03 17:47:26 -0800188 self.sleep(self.pre_test_sleep)
Dave Wallace42996c02018-02-26 14:40:13 -0500189
Florin Coras56b39f62018-03-27 17:29:32 -0700190 self.env.update({'VCL_APP_NAMESPACE_ID': "2",
Dave Wallace42996c02018-02-26 14:40:13 -0500191 'VCL_APP_NAMESPACE_SECRET': "5678"})
Dave Wallace816833f2018-03-14 20:01:28 -0400192 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
Dave Wallace42996c02018-02-26 14:40:13 -0500193 self.logger, self.env)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500194 worker_client.start()
Dave Wallace42996c02018-02-26 14:40:13 -0500195 worker_client.join(self.timeout)
196
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500197 try:
198 self.validateResults(worker_client, worker_server, self.timeout)
Klement Sekerab9ef2732018-06-24 22:49:33 +0200199 except Exception as error:
Dave Wallacefef3f7b2018-03-09 12:04:10 -0500200 self.fail("Failed with %s" % error)
Florin Corasdc2e2512018-12-03 17:47:26 -0800201 self.sleep(self.post_test_sleep)
Dave Wallacea67a03e2018-02-20 12:39:37 -0500202
Dave Wallace9f11c012018-02-28 17:55:23 -0500203 def validateResults(self, worker_client, worker_server, timeout):
Dave Wallaced85075e2018-03-02 13:19:30 -0500204 if os.path.isdir('/proc/{}'.format(worker_server.process.pid)):
205 self.logger.info("Killing server worker process (pid %d)" %
206 worker_server.process.pid)
Florin Corasdc2e2512018-12-03 17:47:26 -0800207 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGKILL)
Dave Wallaced85075e2018-03-02 13:19:30 -0500208 worker_server.join()
Dave Wallace9f11c012018-02-28 17:55:23 -0500209 self.logger.info("Client worker result is `%s'" % worker_client.result)
210 error = False
211 if worker_client.result is None:
212 try:
213 error = True
214 self.logger.error(
Dave Wallaced85075e2018-03-02 13:19:30 -0500215 "Timeout: %ss! Killing client worker process (pid %d)" %
216 (timeout, worker_client.process.pid))
Dave Wallace9f11c012018-02-28 17:55:23 -0500217 os.killpg(os.getpgid(worker_client.process.pid),
Florin Corasdc2e2512018-12-03 17:47:26 -0800218 signal.SIGKILL)
Dave Wallace9f11c012018-02-28 17:55:23 -0500219 worker_client.join()
220 except:
221 self.logger.debug(
222 "Couldn't kill client worker process")
223 raise
224 if error:
Dave Wallace9f11c012018-02-28 17:55:23 -0500225 raise Exception(
226 "Timeout! Client worker did not finish in %ss" % timeout)
227 self.assert_equal(worker_client.result, 0, "Binary test return code")
228
229
Florin Coras0ae445e2018-11-29 18:22:10 -0800230class LDPCutThruTestCase(VCLTestCase):
231 """ LDP Cut Thru Tests """
Dave Wallace9f11c012018-02-28 17:55:23 -0500232
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800233 @classmethod
234 def setUpClass(cls):
235 super(LDPCutThruTestCase, cls).setUpClass()
236
237 @classmethod
238 def tearDownClass(cls):
239 super(LDPCutThruTestCase, cls).tearDownClass()
240
Dave Wallace9f11c012018-02-28 17:55:23 -0500241 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800242 super(LDPCutThruTestCase, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500243
244 self.cut_thru_setup()
Dave Wallacede910062018-03-20 09:22:13 -0400245 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
246 self.server_addr, self.server_port]
Dave Wallace816833f2018-03-14 20:01:28 -0400247 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800248 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.server_addr]
Dave Wallace816833f2018-03-14 20:01:28 -0400249 self.server_iperf3_args = ["-V4d", "-s"]
Florin Coras2eb42e72018-11-29 00:39:53 -0800250 self.client_uni_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400251 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
252 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400253 self.server_addr,
254 self.server_port]
Florin Coras2eb42e72018-11-29 00:39:53 -0800255 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400256 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
257 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400258 self.server_addr,
259 self.server_port]
Dave Wallace9f11c012018-02-28 17:55:23 -0500260
261 def tearDown(self):
262 self.cut_thru_tear_down()
263
Florin Coras0ae445e2018-11-29 18:22:10 -0800264 super(LDPCutThruTestCase, self).tearDown()
Dave Wallace9f11c012018-02-28 17:55:23 -0500265
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800266 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallace9f11c012018-02-28 17:55:23 -0500267 def test_ldp_cut_thru_echo(self):
268 """ run LDP cut thru echo test """
269
Florin Corasab2f6db2018-08-31 14:31:41 -0700270 self.cut_thru_test("sock_test_server", self.server_args,
271 "sock_test_client", self.client_echo_test_args)
Dave Wallace816833f2018-03-14 20:01:28 -0400272
273 def test_ldp_cut_thru_iperf3(self):
274 """ run LDP cut thru iperf3 test """
275
276 try:
277 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800278 except subprocess.CalledProcessError:
Dave Wallace816833f2018-03-14 20:01:28 -0400279 self.logger.error("WARNING: 'iperf3' is not installed,")
280 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
281 return
282
283 self.timeout = self.client_iperf3_timeout
284 self.cut_thru_test("iperf3", self.server_iperf3_args,
285 "iperf3", self.client_iperf3_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500286
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800287 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallaced85075e2018-03-02 13:19:30 -0500288 def test_ldp_cut_thru_uni_dir_nsock(self):
289 """ run LDP cut thru uni-directional (multiple sockets) test """
290
291 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700292 self.cut_thru_test("sock_test_server", self.server_args,
293 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500294 self.client_uni_dir_nsock_test_args)
295
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_bi_dir_nsock(self):
298 """ run LDP cut thru bi-directional (multiple sockets) test """
299
300 self.timeout = self.client_bi_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_bi_dir_nsock_test_args)
304
Florin Coras0ae445e2018-11-29 18:22:10 -0800305
306class VCLCutThruTestCase(VCLTestCase):
307 """ VCL Cut Thru Tests """
308
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800309 @classmethod
310 def setUpClass(cls):
311 super(VCLCutThruTestCase, cls).setUpClass()
312
313 @classmethod
314 def tearDownClass(cls):
315 super(VCLCutThruTestCase, cls).tearDownClass()
316
Florin Coras0ae445e2018-11-29 18:22:10 -0800317 def setUp(self):
318 super(VCLCutThruTestCase, self).setUp()
319
320 self.cut_thru_setup()
321 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
322 self.server_addr, self.server_port]
323
324 self.client_uni_dir_nsock_timeout = 20
325 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
326 "-I", "2",
327 self.server_addr,
328 self.server_port]
329 self.client_bi_dir_nsock_timeout = 20
330 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
331 "-I", "2",
332 self.server_addr,
333 self.server_port]
334
335 def tearDown(self):
336 self.cut_thru_tear_down()
337
338 super(VCLCutThruTestCase, self).tearDown()
339
Dave Wallace9f11c012018-02-28 17:55:23 -0500340 def test_vcl_cut_thru_echo(self):
341 """ run VCL cut thru echo test """
342
Florin Corasab2f6db2018-08-31 14:31:41 -0700343 self.cut_thru_test("vcl_test_server", self.server_args,
344 "vcl_test_client", self.client_echo_test_args)
Dave Wallace9f11c012018-02-28 17:55:23 -0500345
Dave Wallaced85075e2018-03-02 13:19:30 -0500346 def test_vcl_cut_thru_uni_dir_nsock(self):
347 """ run VCL cut thru uni-directional (multiple sockets) test """
348
349 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700350 self.cut_thru_test("vcl_test_server", self.server_args,
351 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500352 self.client_uni_dir_nsock_test_args)
353
Dave Wallaced85075e2018-03-02 13:19:30 -0500354 def test_vcl_cut_thru_bi_dir_nsock(self):
355 """ run VCL cut thru bi-directional (multiple sockets) test """
356
357 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700358 self.cut_thru_test("vcl_test_server", self.server_args,
359 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500360 self.client_bi_dir_nsock_test_args)
361
Dave Wallace9f11c012018-02-28 17:55:23 -0500362
Florin Corasdc2e2512018-12-03 17:47:26 -0800363class LDPThruHostStackEcho(VCLTestCase):
364 """ LDP Thru Host Stack Echo """
Dave Wallace9f11c012018-02-28 17:55:23 -0500365
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800366 @classmethod
367 def setUpClass(cls):
368 super(LDPThruHostStackEcho, cls).setUpClass()
369
370 @classmethod
371 def tearDownClass(cls):
372 super(LDPThruHostStackEcho, cls).tearDownClass()
373
Dave Wallace9f11c012018-02-28 17:55:23 -0500374 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800375 super(LDPThruHostStackEcho, self).setUp()
Dave Wallace9f11c012018-02-28 17:55:23 -0500376
377 self.thru_host_stack_setup()
Dave Wallacede910062018-03-20 09:22:13 -0400378 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
379 self.loop0.local_ip4,
380 self.server_port]
Dave Wallace9f11c012018-02-28 17:55:23 -0500381
382 def tearDown(self):
383 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800384 super(LDPThruHostStackEcho, self).tearDown()
Dave Wallace9f11c012018-02-28 17:55:23 -0500385
386 def test_ldp_thru_host_stack_echo(self):
387 """ run LDP thru host stack echo test """
388
Florin Corasab2f6db2018-08-31 14:31:41 -0700389 self.thru_host_stack_test("sock_test_server", self.server_args,
390 "sock_test_client",
Dave Wallace9f11c012018-02-28 17:55:23 -0500391 self.client_echo_test_args)
Dave Wallaced85075e2018-03-02 13:19:30 -0500392
393
Florin Corasdc2e2512018-12-03 17:47:26 -0800394class VCLThruHostStackEcho(VCLTestCase):
395 """ VCL Thru Host Stack Echo """
Dave Wallaced85075e2018-03-02 13:19:30 -0500396
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800397 @classmethod
398 def setUpClass(cls):
399 super(VCLThruHostStackEcho, cls).setUpClass()
400
401 @classmethod
402 def tearDownClass(cls):
403 super(VCLThruHostStackEcho, cls).tearDownClass()
404
Dave Wallaced85075e2018-03-02 13:19:30 -0500405 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800406 super(VCLThruHostStackEcho, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500407
408 self.thru_host_stack_setup()
Florin Corasdc2e2512018-12-03 17:47:26 -0800409 self.client_bi_dir_nsock_timeout = 20
410 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
411 "-I", "2",
412 self.loop0.local_ip4,
413 self.server_port]
414 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
415 self.loop0.local_ip4,
416 self.server_port]
417
418 def tearDown(self):
419 self.logger.debug(self.vapi.cli("show app server"))
420 self.logger.debug(self.vapi.cli("show session verbose"))
421 self.thru_host_stack_tear_down()
422 super(VCLThruHostStackEcho, self).tearDown()
423
424
425class VCLThruHostStackBidirNsock(VCLTestCase):
426 """ VCL Thru Host Stack Bidir Nsock """
427
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800428 @classmethod
429 def setUpClass(cls):
430 super(VCLThruHostStackBidirNsock, cls).setUpClass()
431
432 @classmethod
433 def tearDownClass(cls):
434 super(VCLThruHostStackBidirNsock, cls).tearDownClass()
435
Florin Corasdc2e2512018-12-03 17:47:26 -0800436 def setUp(self):
437 super(VCLThruHostStackBidirNsock, self).setUp()
438
439 self.thru_host_stack_setup()
440 self.client_bi_dir_nsock_timeout = 20
441 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
442 "-I", "2",
443 self.loop0.local_ip4,
444 self.server_port]
445 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
446 self.loop0.local_ip4,
447 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500448
449 def tearDown(self):
450 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800451 super(VCLThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500452
Dave Wallaced85075e2018-03-02 13:19:30 -0500453 def test_vcl_thru_host_stack_bi_dir_nsock(self):
454 """ run VCL thru host stack bi-directional (multiple sockets) test """
455
456 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700457 self.thru_host_stack_test("vcl_test_server", self.server_args,
458 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500459 self.client_bi_dir_nsock_test_args)
460
461
Florin Corasdc2e2512018-12-03 17:47:26 -0800462class LDPThruHostStackBidirNsock(VCLTestCase):
463 """ LDP Thru Host Stack Bidir Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500464
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800465 @classmethod
466 def setUpClass(cls):
467 super(LDPThruHostStackBidirNsock, cls).setUpClass()
468
469 @classmethod
470 def tearDownClass(cls):
471 super(LDPThruHostStackBidirNsock, cls).tearDownClass()
472
Dave Wallaced85075e2018-03-02 13:19:30 -0500473 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800474 super(LDPThruHostStackBidirNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500475
476 self.thru_host_stack_setup()
477 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800478 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400479 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
480 # OUCH! Host Stack Bug?
481 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400482 self.loop0.local_ip4,
483 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500484 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800485 self.client_bi_dir_nsock_timeout = 20
Dave Wallace45cd3a32018-06-26 01:14:04 -0400486 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
487 # OUCH! Host Stack Bug?
488 # "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400489 self.loop0.local_ip4,
490 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500491
492 def tearDown(self):
493 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800494 super(LDPThruHostStackBidirNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500495
Dave Wallaced85075e2018-03-02 13:19:30 -0500496 def test_ldp_thru_host_stack_bi_dir_nsock(self):
497 """ run LDP thru host stack bi-directional (multiple sockets) test """
498
499 self.timeout = self.client_bi_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400500 self.thru_host_stack_test("sock_test_server", self.server_args,
501 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500502 self.client_bi_dir_nsock_test_args)
503
504
Florin Corasdc2e2512018-12-03 17:47:26 -0800505class LDPThruHostStackNsock(VCLTestCase):
506 """ LDP Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500507
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800508 @classmethod
509 def setUpClass(cls):
510 super(LDPThruHostStackNsock, cls).setUpClass()
511
512 @classmethod
513 def tearDownClass(cls):
514 super(LDPThruHostStackNsock, cls).tearDownClass()
515
Dave Wallaced85075e2018-03-02 13:19:30 -0500516 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800517 super(LDPThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500518
519 self.thru_host_stack_setup()
520 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800521 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500522 self.numSockets = "2"
523 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800524 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500525 self.numSockets = "5"
526
Dave Wallace45cd3a32018-06-26 01:14:04 -0400527 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
528 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400529 self.loop0.local_ip4,
530 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500531
532 def tearDown(self):
533 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800534 super(LDPThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500535
Dave Wallaced85075e2018-03-02 13:19:30 -0500536 def test_ldp_thru_host_stack_uni_dir_nsock(self):
537 """ run LDP thru host stack uni-directional (multiple sockets) test """
538
539 self.timeout = self.client_uni_dir_nsock_timeout
Dave Wallace816833f2018-03-14 20:01:28 -0400540 self.thru_host_stack_test("sock_test_server", self.server_args,
541 "sock_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500542 self.client_uni_dir_nsock_test_args)
543
544
Florin Corasdc2e2512018-12-03 17:47:26 -0800545class VCLThruHostStackNsock(VCLTestCase):
546 """ VCL Thru Host Stack Nsock """
Dave Wallaced85075e2018-03-02 13:19:30 -0500547
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800548 @classmethod
549 def setUpClass(cls):
550 super(VCLThruHostStackNsock, cls).setUpClass()
551
552 @classmethod
553 def tearDownClass(cls):
554 super(VCLThruHostStackNsock, cls).tearDownClass()
555
Dave Wallaced85075e2018-03-02 13:19:30 -0500556 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800557 super(VCLThruHostStackNsock, self).setUp()
Dave Wallaced85075e2018-03-02 13:19:30 -0500558
559 self.thru_host_stack_setup()
560 if self.vppDebug:
Florin Coras2eb42e72018-11-29 00:39:53 -0800561 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500562 self.numSockets = "2"
563 else:
Florin Coras2eb42e72018-11-29 00:39:53 -0800564 self.client_uni_dir_nsock_timeout = 20
Dave Wallaced85075e2018-03-02 13:19:30 -0500565 self.numSockets = "5"
566
Dave Wallace45cd3a32018-06-26 01:14:04 -0400567 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
568 "-I", self.numSockets,
Dave Wallacede910062018-03-20 09:22:13 -0400569 self.loop0.local_ip4,
570 self.server_port]
Dave Wallaced85075e2018-03-02 13:19:30 -0500571
572 def tearDown(self):
573 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800574 super(VCLThruHostStackNsock, self).tearDown()
Dave Wallaced85075e2018-03-02 13:19:30 -0500575
Dave Wallaced85075e2018-03-02 13:19:30 -0500576 def test_vcl_thru_host_stack_uni_dir_nsock(self):
577 """ run VCL thru host stack uni-directional (multiple sockets) test """
578
579 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700580 self.thru_host_stack_test("vcl_test_server", self.server_args,
581 "vcl_test_client",
Dave Wallaced85075e2018-03-02 13:19:30 -0500582 self.client_uni_dir_nsock_test_args)
583
584
Florin Corasdc2e2512018-12-03 17:47:26 -0800585class LDPThruHostStackIperf(VCLTestCase):
586 """ LDP Thru Host Stack Iperf """
Dave Wallace816833f2018-03-14 20:01:28 -0400587
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800588 @classmethod
589 def setUpClass(cls):
590 super(LDPThruHostStackIperf, cls).setUpClass()
591
592 @classmethod
593 def tearDownClass(cls):
594 super(LDPThruHostStackIperf, cls).tearDownClass()
595
Dave Wallace816833f2018-03-14 20:01:28 -0400596 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800597 super(LDPThruHostStackIperf, self).setUp()
Dave Wallace816833f2018-03-14 20:01:28 -0400598
599 self.thru_host_stack_setup()
600 self.client_iperf3_timeout = 20
Florin Corasdc2e2512018-12-03 17:47:26 -0800601 self.client_iperf3_args = ["-V4d", "-t 2", "-c", self.loop0.local_ip4]
Dave Wallace816833f2018-03-14 20:01:28 -0400602 self.server_iperf3_args = ["-V4d", "-s"]
603
604 def tearDown(self):
605 self.thru_host_stack_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800606 super(LDPThruHostStackIperf, self).tearDown()
Dave Wallace816833f2018-03-14 20:01:28 -0400607
608 def test_ldp_thru_host_stack_iperf3(self):
609 """ run LDP thru host stack iperf3 test """
610
611 try:
612 subprocess.check_output(['iperf3', '-v'])
Paul Vinciguerra61e63bf2018-11-24 21:19:38 -0800613 except subprocess.CalledProcessError:
Dave Wallace816833f2018-03-14 20:01:28 -0400614 self.logger.error("WARNING: 'iperf3' is not installed,")
615 self.logger.error(
616 " 'test_ldp_thru_host_stack_iperf3' not run!")
617 return
618
619 self.timeout = self.client_iperf3_timeout
620 self.thru_host_stack_test("iperf3", self.server_iperf3_args,
621 "iperf3", self.client_iperf3_args)
622
623
Florin Coras0ae445e2018-11-29 18:22:10 -0800624class LDPIpv6CutThruTestCase(VCLTestCase):
625 """ LDP IPv6 Cut Thru Tests """
Dave Wallacede910062018-03-20 09:22:13 -0400626
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800627 @classmethod
628 def setUpClass(cls):
629 super(LDPIpv6CutThruTestCase, cls).setUpClass()
630
631 @classmethod
632 def tearDownClass(cls):
633 super(LDPIpv6CutThruTestCase, cls).tearDownClass()
634
Dave Wallacede910062018-03-20 09:22:13 -0400635 def setUp(self):
Florin Coras0ae445e2018-11-29 18:22:10 -0800636 super(LDPIpv6CutThruTestCase, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400637
638 self.cut_thru_setup()
639 self.client_iperf3_timeout = 20
Florin Coras2eb42e72018-11-29 00:39:53 -0800640 self.client_uni_dir_nsock_timeout = 20
641 self.client_bi_dir_nsock_timeout = 20
Dave Wallacede910062018-03-20 09:22:13 -0400642 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
643 self.server_ipv6_addr,
644 self.server_port]
Florin Corasdc2e2512018-12-03 17:47:26 -0800645 self.client_ipv6_iperf3_args = ["-V6d", "-t 2", "-c",
Florin Corasab2f6db2018-08-31 14:31:41 -0700646 self.server_ipv6_addr]
Dave Wallacede910062018-03-20 09:22:13 -0400647 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400648 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
649 "-6",
650 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400651 self.server_ipv6_addr,
652 self.server_port]
Dave Wallace45cd3a32018-06-26 01:14:04 -0400653 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
654 "-6",
655 "-I", "2",
Dave Wallacede910062018-03-20 09:22:13 -0400656 self.server_ipv6_addr,
657 self.server_port]
658
659 def tearDown(self):
660 self.cut_thru_tear_down()
661
Florin Coras0ae445e2018-11-29 18:22:10 -0800662 super(LDPIpv6CutThruTestCase, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400663
664 def test_ldp_ipv6_cut_thru_echo(self):
665 """ run LDP IPv6 cut thru echo test """
666
Florin Corasab2f6db2018-08-31 14:31:41 -0700667 self.cut_thru_test("sock_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400668 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700669 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400670 self.client_ipv6_echo_test_args)
671
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800672 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400673 def test_ldp_ipv6_cut_thru_iperf3(self):
674 """ run LDP IPv6 cut thru iperf3 test """
675
676 try:
677 subprocess.check_output(['iperf3', '-v'])
678 except:
679 self.logger.error("WARNING: 'iperf3' is not installed,")
680 self.logger.error(
681 " 'test_ldp_ipv6_cut_thru_iperf3' not run!")
682 return
683
684 self.timeout = self.client_iperf3_timeout
685 self.cut_thru_test("iperf3", self.server_ipv6_iperf3_args,
686 "iperf3", self.client_ipv6_iperf3_args)
687
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800688 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400689 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
690 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
691
692 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700693 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
694 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400695 self.client_ipv6_uni_dir_nsock_test_args)
696
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_bi_dir_nsock(self):
699 """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """
700
701 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700702 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
703 "sock_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400704 self.client_ipv6_bi_dir_nsock_test_args)
705
Florin Coras0ae445e2018-11-29 18:22:10 -0800706
707class VCLIpv6CutThruTestCase(VCLTestCase):
708 """ VCL IPv6 Cut Thru Tests """
709
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800710 @classmethod
711 def setUpClass(cls):
712 super(VCLIpv6CutThruTestCase, cls).setUpClass()
713
714 @classmethod
715 def tearDownClass(cls):
716 super(VCLIpv6CutThruTestCase, cls).tearDownClass()
717
Florin Coras0ae445e2018-11-29 18:22:10 -0800718 def setUp(self):
719 super(VCLIpv6CutThruTestCase, self).setUp()
720
721 self.cut_thru_setup()
722 self.client_uni_dir_nsock_timeout = 20
723 self.client_bi_dir_nsock_timeout = 20
724 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
725 self.server_ipv6_addr,
726 self.server_port]
727 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
728 "-6",
729 "-I", "2",
730 self.server_ipv6_addr,
731 self.server_port]
732 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
733 "-6",
734 "-I", "2",
735 self.server_ipv6_addr,
736 self.server_port]
737
738 def tearDown(self):
739 self.cut_thru_tear_down()
740
741 super(VCLIpv6CutThruTestCase, self).tearDown()
742
Dave Wallacede910062018-03-20 09:22:13 -0400743 def test_vcl_ipv6_cut_thru_echo(self):
744 """ run VCL IPv6 cut thru echo test """
745
Florin Corasab2f6db2018-08-31 14:31:41 -0700746 self.cut_thru_test("vcl_test_server",
Dave Wallacede910062018-03-20 09:22:13 -0400747 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700748 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400749 self.client_ipv6_echo_test_args)
750
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800751 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400752 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
753 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
754
755 self.timeout = self.client_uni_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700756 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
757 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400758 self.client_ipv6_uni_dir_nsock_test_args)
759
Paul Vinciguerradefde0f2018-12-06 07:46:13 -0800760 @unittest.skipUnless(running_extended_tests, "part of extended tests")
Dave Wallacede910062018-03-20 09:22:13 -0400761 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
762 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
763
764 self.timeout = self.client_bi_dir_nsock_timeout
Florin Corasab2f6db2018-08-31 14:31:41 -0700765 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
766 "vcl_test_client",
Dave Wallacede910062018-03-20 09:22:13 -0400767 self.client_ipv6_bi_dir_nsock_test_args)
768
769
Florin Corasdc2e2512018-12-03 17:47:26 -0800770class VCLIpv6ThruHostStackEcho(VCLTestCase):
771 """ VCL IPv6 Thru Host Stack Echo """
Dave Wallacede910062018-03-20 09:22:13 -0400772
Paul Vinciguerra8d991d92019-01-25 14:05:48 -0800773 @classmethod
774 def setUpClass(cls):
775 super(VCLIpv6ThruHostStackEcho, cls).setUpClass()
776
777 @classmethod
778 def tearDownClass(cls):
779 super(VCLIpv6ThruHostStackEcho, cls).tearDownClass()
780
Dave Wallacede910062018-03-20 09:22:13 -0400781 def setUp(self):
Florin Corasdc2e2512018-12-03 17:47:26 -0800782 super(VCLIpv6ThruHostStackEcho, self).setUp()
Dave Wallacede910062018-03-20 09:22:13 -0400783
784 self.thru_host_stack_ipv6_setup()
785 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
786 self.loop0.local_ip6,
787 self.server_port]
788
789 def tearDown(self):
790 self.thru_host_stack_ipv6_tear_down()
Florin Corasdc2e2512018-12-03 17:47:26 -0800791 super(VCLIpv6ThruHostStackEcho, self).tearDown()
Dave Wallacede910062018-03-20 09:22:13 -0400792
793 def test_vcl_ipv6_thru_host_stack_echo(self):
794 """ run VCL IPv6 thru host stack echo test """
795
Florin Corasdc2e2512018-12-03 17:47:26 -0800796 self.thru_host_stack_test("vcl_test_server",
Damjan Marion855e2682018-08-24 13:37:45 +0200797 self.server_ipv6_args,
Florin Corasab2f6db2018-08-31 14:31:41 -0700798 "vcl_test_client",
Florin Corasdc2e2512018-12-03 17:47:26 -0800799 self.client_ipv6_echo_test_args)
Dave Wallacede910062018-03-20 09:22:13 -0400800
801
Dave Wallacecfcf2f42018-02-16 18:31:56 -0500802if __name__ == '__main__':
803 unittest.main(testRunner=VppTestRunner)