8 from framework import VppTestCase, VppTestRunner, running_extended_tests, \
10 from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, DpoProto
13 class VCLAppWorker(Worker):
14 """ VCL Test Application Worker """
16 def __init__(self, build_dir, appname, args, logger, env={}):
17 vcl_lib_dir = "%s/vpp/lib" % build_dir
18 if "iperf" in appname:
20 env.update({'LD_PRELOAD':
21 "%s/libvcl_ldpreload.so" % vcl_lib_dir})
22 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})
27 app = "%s/vpp/bin/%s" % (build_dir, appname)
28 self.args = [app] + args
29 super(VCLAppWorker, self).__init__(self.args, logger, env)
32 class VCLTestCase(VppTestCase):
33 """ VCL Test Class """
35 def __init__(self, methodName):
36 var = "VPP_TEST_BUILD_DIR"
37 self.build_dir = os.getenv(var, None)
38 if self.build_dir is None:
39 raise Exception("Environment variable `%s' not set" % var)
40 self.vppDebug = 'vpp_debug' in self.build_dir
41 self.server_addr = "127.0.0.1"
42 self.server_port = "22000"
43 self.server_args = [self.server_port]
44 self.server_ipv6_addr = "::1"
45 self.server_ipv6_args = ["-6", self.server_port]
47 self.echo_phrase = "Hello, world! Jenny is a friend of mine."
49 super(VCLTestCase, self).__init__(methodName)
51 def cut_thru_setup(self):
52 self.vapi.session_enable_disable(is_enabled=1)
54 def cut_thru_tear_down(self):
55 self.vapi.session_enable_disable(is_enabled=0)
57 def cut_thru_test(self, server_app, server_args, client_app, client_args):
58 self.env = {'VCL_API_PREFIX': self.shm_prefix,
59 'VCL_APP_SCOPE_LOCAL': "true"}
61 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
62 self.logger, self.env)
65 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
66 self.logger, self.env)
68 worker_client.join(self.timeout)
70 self.validateResults(worker_client, worker_server, self.timeout)
71 except Exception as error:
72 self.fail("Failed with %s" % error)
74 def thru_host_stack_setup(self):
75 self.vapi.session_enable_disable(is_enabled=1)
76 self.create_loopback_interfaces(2)
80 for i in self.lo_interfaces:
84 tbl = VppIpTable(self, table_id)
87 i.set_table_ip4(table_id)
91 # Configure namespaces
92 self.vapi.app_namespace_add(namespace_id="1", secret=1234,
93 sw_if_index=self.loop0.sw_if_index)
94 self.vapi.app_namespace_add(namespace_id="2", secret=5678,
95 sw_if_index=self.loop1.sw_if_index)
97 # Add inter-table routes
98 ip_t01 = VppIpRoute(self, self.loop1.local_ip4, 32,
99 [VppRoutePath("0.0.0.0",
101 nh_table_id=2)], table_id=1)
102 ip_t10 = VppIpRoute(self, self.loop0.local_ip4, 32,
103 [VppRoutePath("0.0.0.0",
105 nh_table_id=1)], table_id=2)
106 ip_t01.add_vpp_config()
107 ip_t10.add_vpp_config()
108 self.logger.debug(self.vapi.cli("show ip fib"))
110 def thru_host_stack_tear_down(self):
111 for i in self.lo_interfaces:
116 self.vapi.session_enable_disable(is_enabled=0)
118 def thru_host_stack_ipv6_setup(self):
119 self.vapi.session_enable_disable(is_enabled=1)
120 self.create_loopback_interfaces(2)
124 for i in self.lo_interfaces:
127 tbl = VppIpTable(self, table_id, is_ip6=1)
130 i.set_table_ip6(table_id)
134 # Configure namespaces
135 self.vapi.app_namespace_add(namespace_id="1", secret=1234,
136 sw_if_index=self.loop0.sw_if_index)
137 self.vapi.app_namespace_add(namespace_id="2", secret=5678,
138 sw_if_index=self.loop1.sw_if_index)
140 # Add inter-table routes
141 ip_t01 = VppIpRoute(self, self.loop1.local_ip6, 128,
142 [VppRoutePath("::0", 0xffffffff,
144 proto=DpoProto.DPO_PROTO_IP6)],
145 table_id=1, is_ip6=1)
146 ip_t10 = VppIpRoute(self, self.loop0.local_ip6, 128,
147 [VppRoutePath("::0", 0xffffffff,
149 proto=DpoProto.DPO_PROTO_IP6)],
150 table_id=2, is_ip6=1)
151 ip_t01.add_vpp_config()
152 ip_t10.add_vpp_config()
153 self.logger.debug(self.vapi.cli("show interface addr"))
154 self.logger.debug(self.vapi.cli("show ip6 fib"))
156 def thru_host_stack_ipv6_tear_down(self):
157 for i in self.lo_interfaces:
162 self.vapi.session_enable_disable(is_enabled=0)
164 def thru_host_stack_test(self, server_app, server_args,
165 client_app, client_args):
166 self.env = {'VCL_API_PREFIX': self.shm_prefix,
167 'VCL_APP_SCOPE_GLOBAL': "true",
168 'VCL_APP_NAMESPACE_ID': "1",
169 'VCL_APP_NAMESPACE_SECRET': "1234"}
171 worker_server = VCLAppWorker(self.build_dir, server_app, server_args,
172 self.logger, self.env)
173 worker_server.start()
176 self.env.update({'VCL_APP_NAMESPACE_ID': "2",
177 'VCL_APP_NAMESPACE_SECRET': "5678"})
178 worker_client = VCLAppWorker(self.build_dir, client_app, client_args,
179 self.logger, self.env)
180 worker_client.start()
181 worker_client.join(self.timeout)
184 self.validateResults(worker_client, worker_server, self.timeout)
185 except Exception as error:
186 self.fail("Failed with %s" % error)
188 def validateResults(self, worker_client, worker_server, timeout):
189 if os.path.isdir('/proc/{}'.format(worker_server.process.pid)):
190 self.logger.info("Killing server worker process (pid %d)" %
191 worker_server.process.pid)
192 os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM)
194 self.logger.info("Client worker result is `%s'" % worker_client.result)
196 if worker_client.result is None:
200 "Timeout: %ss! Killing client worker process (pid %d)" %
201 (timeout, worker_client.process.pid))
202 os.killpg(os.getpgid(worker_client.process.pid),
207 "Couldn't kill client worker process")
211 "Timeout! Client worker did not finish in %ss" % timeout)
212 self.assert_equal(worker_client.result, 0, "Binary test return code")
215 class VCLCutThruTestCase(VCLTestCase):
216 """ VCL Cut Thru Tests """
219 super(VCLCutThruTestCase, self).setUp()
221 self.cut_thru_setup()
222 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
223 self.server_addr, self.server_port]
224 self.client_iperf3_timeout = 20
225 self.client_iperf3_args = ["-V4d", "-t 5", "-c", self.server_addr]
226 self.server_iperf3_args = ["-V4d", "-s"]
227 self.client_uni_dir_nsock_timeout = 60
228 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
232 self.client_bi_dir_nsock_timeout = 120
233 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
239 self.cut_thru_tear_down()
241 super(VCLCutThruTestCase, self).tearDown()
243 def test_ldp_cut_thru_echo(self):
244 """ run LDP cut thru echo test """
246 self.cut_thru_test("sock_test_server", self.server_args,
247 "sock_test_client", self.client_echo_test_args)
249 def test_ldp_cut_thru_iperf3(self):
250 """ run LDP cut thru iperf3 test """
253 subprocess.check_output(['iperf3', '-v'])
254 except subprocess.CalledProcessError:
255 self.logger.error("WARNING: 'iperf3' is not installed,")
256 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
259 self.timeout = self.client_iperf3_timeout
260 self.cut_thru_test("iperf3", self.server_iperf3_args,
261 "iperf3", self.client_iperf3_args)
263 def test_ldp_cut_thru_uni_dir_nsock(self):
264 """ run LDP cut thru uni-directional (multiple sockets) test """
266 self.timeout = self.client_uni_dir_nsock_timeout
267 self.cut_thru_test("sock_test_server", self.server_args,
269 self.client_uni_dir_nsock_test_args)
271 def test_ldp_cut_thru_bi_dir_nsock(self):
272 """ run LDP cut thru bi-directional (multiple sockets) test """
274 self.timeout = self.client_bi_dir_nsock_timeout
275 self.cut_thru_test("sock_test_server", self.server_args,
277 self.client_bi_dir_nsock_test_args)
279 def test_vcl_cut_thru_echo(self):
280 """ run VCL cut thru echo test """
282 self.cut_thru_test("vcl_test_server", self.server_args,
283 "vcl_test_client", self.client_echo_test_args)
285 def test_vcl_cut_thru_uni_dir_nsock(self):
286 """ run VCL cut thru uni-directional (multiple sockets) test """
288 self.timeout = self.client_uni_dir_nsock_timeout
289 self.cut_thru_test("vcl_test_server", self.server_args,
291 self.client_uni_dir_nsock_test_args)
293 def test_vcl_cut_thru_bi_dir_nsock(self):
294 """ run VCL cut thru bi-directional (multiple sockets) test """
296 self.timeout = self.client_bi_dir_nsock_timeout
297 self.cut_thru_test("vcl_test_server", self.server_args,
299 self.client_bi_dir_nsock_test_args)
302 class VCLThruHostStackTestCase(VCLTestCase):
303 """ VCL Thru Host Stack Tests """
306 super(VCLThruHostStackTestCase, self).setUp()
308 self.thru_host_stack_setup()
309 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
310 self.loop0.local_ip4,
314 self.thru_host_stack_tear_down()
316 super(VCLThruHostStackTestCase, self).tearDown()
318 def test_ldp_thru_host_stack_echo(self):
319 """ run LDP thru host stack echo test """
321 self.thru_host_stack_test("sock_test_server", self.server_args,
323 self.client_echo_test_args)
324 # TBD: Remove these when VPP thru host teardown config bug is fixed.
325 self.thru_host_stack_test("vcl_test_server", self.server_args,
327 self.client_echo_test_args)
329 def test_vcl_thru_host_stack_echo(self):
330 """ run VCL thru host stack echo test """
332 # TBD: Enable this when VPP thru host teardown config bug is fixed.
333 # self.thru_host_stack_test("vcl_test_server", self.server_args,
335 # self.client_echo_test_args)
337 # TBD: Remove VCLThruHostStackGroup*TestCase classes and move
338 # tests here when VPP thru host teardown/setup config bug
342 class VCLThruHostStackNSessionBidirTestCase(VCLTestCase):
343 """ VCL Thru Host Stack NSession Bidir Tests """
346 super(VCLThruHostStackNSessionBidirTestCase, self).setUp()
348 self.thru_host_stack_setup()
350 self.client_bi_dir_nsock_timeout = 120
351 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
353 self.loop0.local_ip4,
356 self.client_bi_dir_nsock_timeout = 90
357 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
359 self.loop0.local_ip4,
363 self.thru_host_stack_tear_down()
365 super(VCLThruHostStackNSessionBidirTestCase, self).tearDown()
367 def test_vcl_thru_host_stack_bi_dir_nsock(self):
368 """ run VCL thru host stack bi-directional (multiple sockets) test """
370 self.timeout = self.client_bi_dir_nsock_timeout
371 self.thru_host_stack_test("vcl_test_server", self.server_args,
373 self.client_bi_dir_nsock_test_args)
376 class VCLThruHostStackGroupBTestCase(VCLTestCase):
377 """ VCL Thru Host Stack Group B Tests """
380 super(VCLThruHostStackGroupBTestCase, self).setUp()
382 self.thru_host_stack_setup()
384 self.client_bi_dir_nsock_timeout = 120
385 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
386 # OUCH! Host Stack Bug?
388 self.loop0.local_ip4,
391 self.client_bi_dir_nsock_timeout = 60
392 self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
393 # OUCH! Host Stack Bug?
395 self.loop0.local_ip4,
399 self.thru_host_stack_tear_down()
401 super(VCLThruHostStackGroupBTestCase, self).tearDown()
403 def test_ldp_thru_host_stack_bi_dir_nsock(self):
404 """ run LDP thru host stack bi-directional (multiple sockets) test """
406 self.timeout = self.client_bi_dir_nsock_timeout
407 self.thru_host_stack_test("sock_test_server", self.server_args,
409 self.client_bi_dir_nsock_test_args)
412 class VCLThruHostStackGroupCTestCase(VCLTestCase):
413 """ VCL Thru Host Stack Group C Tests """
416 super(VCLThruHostStackGroupCTestCase, self).setUp()
418 self.thru_host_stack_setup()
420 self.client_uni_dir_nsock_timeout = 120
421 self.numSockets = "2"
423 self.client_uni_dir_nsock_timeout = 120
424 self.numSockets = "5"
426 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
427 "-I", self.numSockets,
428 self.loop0.local_ip4,
432 self.thru_host_stack_tear_down()
434 super(VCLThruHostStackGroupCTestCase, self).tearDown()
436 def test_ldp_thru_host_stack_uni_dir_nsock(self):
437 """ run LDP thru host stack uni-directional (multiple sockets) test """
439 self.timeout = self.client_uni_dir_nsock_timeout
440 self.thru_host_stack_test("sock_test_server", self.server_args,
442 self.client_uni_dir_nsock_test_args)
445 class VCLThruHostStackGroupDTestCase(VCLTestCase):
446 """ VCL Thru Host Stack Group D Tests """
449 super(VCLThruHostStackGroupDTestCase, self).setUp()
451 self.thru_host_stack_setup()
453 self.client_uni_dir_nsock_timeout = 120
454 self.numSockets = "2"
456 self.client_uni_dir_nsock_timeout = 120
457 self.numSockets = "5"
459 self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
460 "-I", self.numSockets,
461 self.loop0.local_ip4,
465 self.thru_host_stack_tear_down()
467 super(VCLThruHostStackGroupDTestCase, self).tearDown()
469 def test_vcl_thru_host_stack_uni_dir_nsock(self):
470 """ run VCL thru host stack uni-directional (multiple sockets) test """
472 self.timeout = self.client_uni_dir_nsock_timeout
473 self.thru_host_stack_test("vcl_test_server", self.server_args,
475 self.client_uni_dir_nsock_test_args)
478 class VCLThruHostStackIperfTestCase(VCLTestCase):
479 """ VCL Thru Host Stack Iperf Tests """
482 super(VCLThruHostStackIperfTestCase, self).setUp()
484 self.thru_host_stack_setup()
485 self.client_iperf3_timeout = 20
486 self.client_iperf3_args = ["-V4d", "-t 5", "-c", self.loop0.local_ip4]
487 self.server_iperf3_args = ["-V4d", "-s"]
490 self.thru_host_stack_tear_down()
492 super(VCLThruHostStackIperfTestCase, self).tearDown()
494 def test_ldp_thru_host_stack_iperf3(self):
495 """ run LDP thru host stack iperf3 test """
498 subprocess.check_output(['iperf3', '-v'])
499 except subprocess.CalledProcessError:
500 self.logger.error("WARNING: 'iperf3' is not installed,")
502 " 'test_ldp_thru_host_stack_iperf3' not run!")
505 self.timeout = self.client_iperf3_timeout
506 self.thru_host_stack_test("iperf3", self.server_iperf3_args,
507 "iperf3", self.client_iperf3_args)
510 class VCLIpv6CutThruTestCase(VCLTestCase):
511 """ VCL IPv6 Cut Thru Tests """
514 super(VCLIpv6CutThruTestCase, self).setUp()
516 self.cut_thru_setup()
517 self.client_iperf3_timeout = 20
518 self.client_uni_dir_nsock_timeout = 60
519 self.client_bi_dir_nsock_timeout = 120
520 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
521 self.server_ipv6_addr,
523 self.client_ipv6_iperf3_args = ["-V6d", "-t 5", "-c",
524 self.server_ipv6_addr]
525 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
526 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
529 self.server_ipv6_addr,
531 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X",
534 self.server_ipv6_addr,
538 self.cut_thru_tear_down()
540 super(VCLIpv6CutThruTestCase, self).tearDown()
542 def test_ldp_ipv6_cut_thru_echo(self):
543 """ run LDP IPv6 cut thru echo test """
545 self.cut_thru_test("sock_test_server",
546 self.server_ipv6_args,
548 self.client_ipv6_echo_test_args)
550 def test_ldp_ipv6_cut_thru_iperf3(self):
551 """ run LDP IPv6 cut thru iperf3 test """
554 subprocess.check_output(['iperf3', '-v'])
556 self.logger.error("WARNING: 'iperf3' is not installed,")
558 " 'test_ldp_ipv6_cut_thru_iperf3' not run!")
561 self.timeout = self.client_iperf3_timeout
562 self.cut_thru_test("iperf3", self.server_ipv6_iperf3_args,
563 "iperf3", self.client_ipv6_iperf3_args)
565 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
566 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
568 self.timeout = self.client_uni_dir_nsock_timeout
569 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
571 self.client_ipv6_uni_dir_nsock_test_args)
573 def test_ldp_ipv6_cut_thru_bi_dir_nsock(self):
574 """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """
576 self.timeout = self.client_bi_dir_nsock_timeout
577 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
579 self.client_ipv6_bi_dir_nsock_test_args)
581 def test_vcl_ipv6_cut_thru_echo(self):
582 """ run VCL IPv6 cut thru echo test """
584 self.cut_thru_test("vcl_test_server",
585 self.server_ipv6_args,
587 self.client_ipv6_echo_test_args)
589 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
590 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
592 self.timeout = self.client_uni_dir_nsock_timeout
593 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
595 self.client_ipv6_uni_dir_nsock_test_args)
597 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
598 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
600 self.timeout = self.client_bi_dir_nsock_timeout
601 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
603 self.client_ipv6_bi_dir_nsock_test_args)
606 class VCLIpv6ThruHostStackTestCase(VCLTestCase):
607 """ VCL IPv6 Thru Host Stack Tests """
610 super(VCLIpv6ThruHostStackTestCase, self).setUp()
612 self.thru_host_stack_ipv6_setup()
613 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
614 self.loop0.local_ip6,
618 self.thru_host_stack_ipv6_tear_down()
620 super(VCLIpv6ThruHostStackTestCase, self).tearDown()
622 def test_ldp_ipv6_thru_host_stack_echo(self):
623 """ run LDP IPv6 thru host stack echo test """
625 self.thru_host_stack_test("sock_test_server",
626 self.server_ipv6_args,
628 self.client_ipv6_echo_test_args)
629 # TBD: Remove these when VPP thru host teardown config bug is fixed.
630 self.thru_host_stack_test("vcl_test_server",
631 self.server_ipv6_args,
633 self.client_ipv6_echo_test_args)
635 def test_vcl_ipv6_thru_host_stack_echo(self):
636 """ run VCL IPv6 thru host stack echo test """
638 # self.thru_host_stack_test("vcl_test_server",
639 # self.server_ipv6_args,
641 # self.client_ipv6_echo_test_args)
643 # TBD: Remove VCLIpv6ThruHostStackGroup*TestCase classes and move
644 # tests here when VPP thru host teardown/setup config bug
648 class VCLIpv6ThruHostStackGroupATestCase(VCLTestCase):
649 """ VCL IPv6 Thru Host Stack Group A Tests """
652 super(VCLIpv6ThruHostStackGroupATestCase, self).setUp()
654 self.thru_host_stack_ipv6_setup()
656 self.client_bi_dir_nsock_timeout = 120
657 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000",
660 self.loop0.local_ip6,
663 self.client_bi_dir_nsock_timeout = 90
664 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000",
667 self.loop0.local_ip6,
671 self.thru_host_stack_ipv6_tear_down()
673 super(VCLIpv6ThruHostStackGroupATestCase, self).tearDown()
675 def test_vcl_thru_host_stack_bi_dir_nsock(self):
676 """ run VCL thru host stack bi-directional (multiple sockets) test """
678 self.timeout = self.client_bi_dir_nsock_timeout
679 self.thru_host_stack_test("vcl_test_server", self.server_ipv6_args,
681 self.client_ipv6_bi_dir_nsock_test_args)
684 class VCLIpv6ThruHostStackGroupBTestCase(VCLTestCase):
685 """ VCL IPv6 Thru Host Stack Group B Tests """
688 super(VCLIpv6ThruHostStackGroupBTestCase, self).setUp()
690 self.thru_host_stack_ipv6_setup()
692 self.client_bi_dir_nsock_timeout = 120
693 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000",
695 # OUCH! Host Stack Bug?
697 self.loop0.local_ip6,
700 self.client_bi_dir_nsock_timeout = 60
701 self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000",
703 # OUCH! Host Stack Bug?
705 self.loop0.local_ip6,
709 self.thru_host_stack_ipv6_tear_down()
711 super(VCLIpv6ThruHostStackGroupBTestCase, self).tearDown()
713 def test_ldp_thru_host_stack_bi_dir_nsock(self):
714 """ run LDP thru host stack bi-directional (multiple sockets) test """
716 self.timeout = self.client_bi_dir_nsock_timeout
717 self.thru_host_stack_test("sock_test_server",
718 self.server_ipv6_args,
720 self.client_ipv6_bi_dir_nsock_test_args)
723 class VCLIpv6ThruHostStackGroupCTestCase(VCLTestCase):
724 """ VCL IPv6 Thru Host Stack Group C Tests """
727 super(VCLIpv6ThruHostStackGroupCTestCase, self).setUp()
729 self.thru_host_stack_ipv6_setup()
731 self.client_uni_dir_nsock_timeout = 120
732 self.numSockets = "2"
734 self.client_uni_dir_nsock_timeout = 120
735 self.numSockets = "5"
737 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
739 "-I", self.numSockets,
740 self.loop0.local_ip6,
744 self.thru_host_stack_ipv6_tear_down()
746 super(VCLIpv6ThruHostStackGroupCTestCase, self).tearDown()
748 def test_ldp_thru_host_stack_uni_dir_nsock(self):
749 """ run LDP thru host stack uni-directional (multiple sockets) test """
751 self.timeout = self.client_uni_dir_nsock_timeout
752 self.thru_host_stack_test("sock_test_server",
753 self.server_ipv6_args,
755 self.client_ipv6_uni_dir_nsock_test_args)
758 class VCLIpv6ThruHostStackGroupDTestCase(VCLTestCase):
759 """ VCL IPv6 Thru Host Stack Group D Tests """
762 super(VCLIpv6ThruHostStackGroupDTestCase, self).setUp()
764 self.thru_host_stack_ipv6_setup()
766 self.client_uni_dir_nsock_timeout = 120
767 self.numSockets = "2"
769 self.client_uni_dir_nsock_timeout = 120
770 self.numSockets = "5"
772 self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X",
774 "-I", self.numSockets,
775 self.loop0.local_ip6,
779 self.thru_host_stack_ipv6_tear_down()
781 super(VCLIpv6ThruHostStackGroupDTestCase, self).tearDown()
783 def test_vcl_thru_host_stack_uni_dir_nsock(self):
784 """ run VCL thru host stack uni-directional (multiple sockets) test """
786 self.timeout = self.client_uni_dir_nsock_timeout
787 self.thru_host_stack_test("vcl_test_server", self.server_ipv6_args,
789 self.client_ipv6_uni_dir_nsock_test_args)
792 class VCLIpv6ThruHostStackIperfTestCase(VCLTestCase):
793 """ VCL IPv6 Thru Host Stack Iperf Tests """
796 super(VCLIpv6ThruHostStackIperfTestCase, self).setUp()
798 self.thru_host_stack_ipv6_setup()
799 self.client_iperf3_timeout = 20
800 self.client_ipv6_iperf3_args = ["-V6d", "-t 5", "-c",
801 self.loop0.local_ip6]
802 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
805 self.thru_host_stack_ipv6_tear_down()
807 super(VCLIpv6ThruHostStackIperfTestCase, self).tearDown()
809 def test_ldp_thru_host_stack_iperf3(self):
810 """ run LDP thru host stack iperf3 test """
813 subprocess.check_output(['iperf3', '-v'])
814 except subprocess.CalledProcessError:
815 self.logger.error("WARNING: 'iperf3' is not installed,")
817 " 'test_ldp_thru_host_stack_iperf3' not run!")
820 self.timeout = self.client_iperf3_timeout
821 self.thru_host_stack_test("iperf3", self.server_ipv6_iperf3_args,
822 "iperf3", self.client_ipv6_iperf3_args)
825 if __name__ == '__main__':
826 unittest.main(testRunner=VppTestRunner)