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/.libs" % build_dir
18 if "iperf" in appname:
20 env.update({'LD_PRELOAD':
21 "%s/libvcl_ldpreload.so.0.0.0" % vcl_lib_dir})
23 app = "%s/%s" % (vcl_lib_dir, appname)
24 if not os.path.isfile(app):
25 app = "%s/vpp/%s" % (build_dir, appname)
26 env.update({'LD_PRELOAD':
27 "%s/libvcl_ldpreload.so.0.0.0" % vcl_lib_dir})
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, 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(range(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(range(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, 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", "-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 = ["-I", "5", "-U", "-X",
231 self.client_bi_dir_nsock_timeout = 120
232 self.client_bi_dir_nsock_test_args = ["-I", "2", "-B", "-X",
237 self.cut_thru_tear_down()
239 super(VCLCutThruTestCase, self).tearDown()
241 def test_ldp_cut_thru_echo(self):
242 """ run LDP cut thru echo test """
244 self.cut_thru_test("sock_test_server", self.server_args,
245 "sock_test_client", self.client_echo_test_args)
247 def test_ldp_cut_thru_iperf3(self):
248 """ run LDP cut thru iperf3 test """
251 subprocess.check_output(['iperf3', '-v'])
253 self.logger.error("WARNING: 'iperf3' is not installed,")
254 self.logger.error(" 'test_ldp_cut_thru_iperf3' not run!")
257 self.timeout = self.client_iperf3_timeout
258 self.cut_thru_test("iperf3", self.server_iperf3_args,
259 "iperf3", self.client_iperf3_args)
261 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
262 def test_ldp_cut_thru_uni_dir_nsock(self):
263 """ run LDP cut thru uni-directional (multiple sockets) test """
265 self.timeout = self.client_uni_dir_nsock_timeout
266 self.cut_thru_test("sock_test_server", self.server_args,
268 self.client_uni_dir_nsock_test_args)
270 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
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 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
286 def test_vcl_cut_thru_uni_dir_nsock(self):
287 """ run VCL cut thru uni-directional (multiple sockets) test """
289 self.timeout = self.client_uni_dir_nsock_timeout
290 self.cut_thru_test("vcl_test_server", self.server_args,
292 self.client_uni_dir_nsock_test_args)
294 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
295 def test_vcl_cut_thru_bi_dir_nsock(self):
296 """ run VCL cut thru bi-directional (multiple sockets) test """
298 self.timeout = self.client_bi_dir_nsock_timeout
299 self.cut_thru_test("vcl_test_server", self.server_args,
301 self.client_bi_dir_nsock_test_args)
304 class VCLThruHostStackTestCase(VCLTestCase):
305 """ VCL Thru Host Stack Tests """
308 super(VCLThruHostStackTestCase, self).setUp()
310 self.thru_host_stack_setup()
311 self.client_echo_test_args = ["-E", self.echo_phrase, "-X",
312 self.loop0.local_ip4,
316 self.thru_host_stack_tear_down()
318 super(VCLThruHostStackTestCase, self).tearDown()
320 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
321 def test_ldp_thru_host_stack_echo(self):
322 """ run LDP thru host stack echo test """
324 self.thru_host_stack_test("sock_test_server", self.server_args,
326 self.client_echo_test_args)
327 # TBD: Remove these when VPP thru host teardown config bug is fixed.
328 self.thru_host_stack_test("vcl_test_server", self.server_args,
330 self.client_echo_test_args)
332 def test_vcl_thru_host_stack_echo(self):
333 """ run VCL thru host stack echo test """
335 # TBD: Enable this when VPP thru host teardown config bug is fixed.
336 self.thru_host_stack_test("vcl_test_server", self.server_args,
338 self.client_echo_test_args)
340 # TBD: Remove VCLThruHostStackExtended*TestCase classes and move
341 # tests here when VPP thru host teardown/setup config bug
345 class VCLThruHostStackExtendedATestCase(VCLTestCase):
346 """ VCL Thru Host Stack Extended Tests """
349 super(VCLThruHostStackExtendedATestCase, self).setUp()
351 self.thru_host_stack_setup()
353 self.client_bi_dir_nsock_timeout = 120
354 self.client_bi_dir_nsock_test_args = ["-B", "-X",
355 self.loop0.local_ip4,
358 self.client_bi_dir_nsock_timeout = 90
359 self.client_bi_dir_nsock_test_args = ["-I", "2", "-B", "-X",
360 self.loop0.local_ip4,
364 self.thru_host_stack_tear_down()
366 super(VCLThruHostStackExtendedATestCase, self).tearDown()
368 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
369 def test_vcl_thru_host_stack_bi_dir_nsock(self):
370 """ run VCL thru host stack bi-directional (multiple sockets) test """
372 self.timeout = self.client_bi_dir_nsock_timeout
373 self.thru_host_stack_test("vcl_test_server", self.server_args,
375 self.client_bi_dir_nsock_test_args)
378 class VCLThruHostStackExtendedBTestCase(VCLTestCase):
379 """ VCL Thru Host Stack Extended Tests """
382 super(VCLThruHostStackExtendedBTestCase, self).setUp()
384 self.thru_host_stack_setup()
386 self.client_bi_dir_nsock_timeout = 120
387 self.client_bi_dir_nsock_test_args = ["-B", "-X",
388 self.loop0.local_ip4,
391 self.client_bi_dir_nsock_timeout = 60
392 self.client_bi_dir_nsock_test_args = ["-I", "2", "-B", "-X",
393 self.loop0.local_ip4,
397 self.thru_host_stack_tear_down()
399 super(VCLThruHostStackExtendedBTestCase, self).tearDown()
401 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
402 def test_ldp_thru_host_stack_bi_dir_nsock(self):
403 """ run LDP thru host stack bi-directional (multiple sockets) test """
405 self.timeout = self.client_bi_dir_nsock_timeout
406 self.thru_host_stack_test("sock_test_server", self.server_args,
408 self.client_bi_dir_nsock_test_args)
411 class VCLThruHostStackExtendedCTestCase(VCLTestCase):
412 """ VCL Thru Host Stack Extended Tests """
415 super(VCLThruHostStackExtendedCTestCase, self).setUp()
417 self.thru_host_stack_setup()
419 self.client_uni_dir_nsock_timeout = 120
420 self.numSockets = "2"
422 self.client_uni_dir_nsock_timeout = 120
423 self.numSockets = "5"
425 self.client_uni_dir_nsock_test_args = ["-I", self.numSockets,
427 self.loop0.local_ip4,
431 self.thru_host_stack_tear_down()
433 super(VCLThruHostStackExtendedCTestCase, self).tearDown()
435 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
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 VCLThruHostStackExtendedDTestCase(VCLTestCase):
446 """ VCL Thru Host Stack Extended Tests """
449 super(VCLThruHostStackExtendedDTestCase, 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 = ["-I", self.numSockets,
461 self.loop0.local_ip4,
465 self.thru_host_stack_tear_down()
467 super(VCLThruHostStackExtendedDTestCase, self).tearDown()
469 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
470 def test_vcl_thru_host_stack_uni_dir_nsock(self):
471 """ run VCL thru host stack uni-directional (multiple sockets) test """
473 self.timeout = self.client_uni_dir_nsock_timeout
474 self.thru_host_stack_test("vcl_test_server", self.server_args,
476 self.client_uni_dir_nsock_test_args)
479 class VCLThruHostStackIperfTestCase(VCLTestCase):
480 """ VCL Thru Host Stack Iperf Tests """
483 super(VCLThruHostStackIperfTestCase, self).setUp()
485 self.thru_host_stack_setup()
486 self.client_iperf3_timeout = 20
487 self.client_iperf3_args = ["-V4d", "-c", self.loop0.local_ip4]
488 self.server_iperf3_args = ["-V4d", "-s"]
491 self.thru_host_stack_tear_down()
493 super(VCLThruHostStackIperfTestCase, self).tearDown()
495 def test_ldp_thru_host_stack_iperf3(self):
496 """ run LDP thru host stack iperf3 test """
499 subprocess.check_output(['iperf3', '-v'])
501 self.logger.error("WARNING: 'iperf3' is not installed,")
503 " 'test_ldp_thru_host_stack_iperf3' not run!")
506 self.timeout = self.client_iperf3_timeout
507 self.thru_host_stack_test("iperf3", self.server_iperf3_args,
508 "iperf3", self.client_iperf3_args)
511 class VCLIpv6CutThruTestCase(VCLTestCase):
512 """ VCL IPv6 Cut Thru Tests """
515 super(VCLIpv6CutThruTestCase, self).setUp()
517 self.cut_thru_setup()
518 self.client_iperf3_timeout = 20
519 self.client_uni_dir_nsock_timeout = 60
520 self.client_bi_dir_nsock_timeout = 120
521 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
522 self.server_ipv6_addr,
524 self.client_ipv6_iperf3_args = ["-V6d", "-c", self.server_ipv6_addr]
525 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
526 self.client_ipv6_uni_dir_nsock_test_args = ["-6", "-I", "5",
528 self.server_ipv6_addr,
530 self.client_ipv6_bi_dir_nsock_test_args = ["-6", "-I", "2",
532 self.server_ipv6_addr,
536 self.cut_thru_tear_down()
538 super(VCLIpv6CutThruTestCase, self).tearDown()
540 def test_ldp_ipv6_cut_thru_echo(self):
541 """ run LDP IPv6 cut thru echo test """
543 self.cut_thru_test("sock_test_server",
544 self.server_ipv6_args,
546 self.client_ipv6_echo_test_args)
548 def test_ldp_ipv6_cut_thru_iperf3(self):
549 """ run LDP IPv6 cut thru iperf3 test """
552 subprocess.check_output(['iperf3', '-v'])
554 self.logger.error("WARNING: 'iperf3' is not installed,")
556 " 'test_ldp_ipv6_cut_thru_iperf3' not run!")
559 self.timeout = self.client_iperf3_timeout
560 self.cut_thru_test("iperf3", self.server_ipv6_iperf3_args,
561 "iperf3", self.client_ipv6_iperf3_args)
563 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
564 def test_ldp_ipv6_cut_thru_uni_dir_nsock(self):
565 """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """
567 self.timeout = self.client_uni_dir_nsock_timeout
568 self.cut_thru_test("sock_test_server", self.server_ipv6_args,
570 self.client_ipv6_uni_dir_nsock_test_args)
572 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
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 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
590 def test_vcl_ipv6_cut_thru_uni_dir_nsock(self):
591 """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """
593 self.timeout = self.client_uni_dir_nsock_timeout
594 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
596 self.client_ipv6_uni_dir_nsock_test_args)
598 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
599 def test_vcl_ipv6_cut_thru_bi_dir_nsock(self):
600 """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """
602 self.timeout = self.client_bi_dir_nsock_timeout
603 self.cut_thru_test("vcl_test_server", self.server_ipv6_args,
605 self.client_ipv6_bi_dir_nsock_test_args)
608 class VCLIpv6ThruHostStackTestCase(VCLTestCase):
609 """ VCL IPv6 Thru Host Stack Tests """
612 super(VCLIpv6ThruHostStackTestCase, self).setUp()
614 self.thru_host_stack_ipv6_setup()
615 self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X",
616 self.loop0.local_ip6,
620 self.thru_host_stack_ipv6_tear_down()
622 super(VCLIpv6ThruHostStackTestCase, self).tearDown()
624 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
625 def test_ldp_ipv6_thru_host_stack_echo(self):
626 """ run LDP IPv6 thru host stack echo test """
628 self.thru_host_stack_test("sock_test_server", self.server_ipv6_args,
630 self.client_ipv6_echo_test_args)
631 # TBD: Remove these when VPP thru host teardown config bug is fixed.
632 self.thru_host_stack_test("vcl_test_server", self.server_ipv6_args,
634 self.client_ipv6_echo_test_args)
636 def test_vcl_ipv6_thru_host_stack_echo(self):
637 """ run VCL IPv6 thru host stack echo test """
639 # TBD: Enable this when VPP IPv6 thru host teardown
640 # config bug is fixed.
641 # self.thru_host_stack_test("vcl_test_server", self.server_ipv6_args,
643 # self.client_ipv6_echo_test_args)
645 # TBD: Remove VCLIpv6ThruHostStackExtended*TestCase classes and move
646 # tests here when VPP thru host teardown/setup config bug
650 class VCLIpv6ThruHostStackExtendedATestCase(VCLTestCase):
651 """ VCL IPv6 Thru Host Stack Extended Tests """
654 super(VCLIpv6ThruHostStackExtendedATestCase, self).setUp()
656 self.thru_host_stack_ipv6_setup()
658 self.client_bi_dir_nsock_timeout = 120
659 self.client_ipv6_bi_dir_nsock_test_args = ["-6", "-B", "-X",
660 self.loop0.local_ip6,
663 self.client_bi_dir_nsock_timeout = 90
664 self.client_ipv6_bi_dir_nsock_test_args = ["-6", "-I",
666 self.loop0.local_ip6,
670 self.thru_host_stack_ipv6_tear_down()
672 super(VCLIpv6ThruHostStackExtendedATestCase, self).tearDown()
674 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
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 VCLIpv6ThruHostStackExtendedBTestCase(VCLTestCase):
685 """ VCL IPv6 Thru Host Stack Extended Tests """
688 super(VCLIpv6ThruHostStackExtendedBTestCase, 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 = ["-6", "-B", "-X",
694 self.loop0.local_ip6,
697 self.client_bi_dir_nsock_timeout = 60
698 self.client_ipv6_bi_dir_nsock_test_args = ["-6", "-I", "2",
700 self.loop0.local_ip6,
704 self.thru_host_stack_ipv6_tear_down()
706 super(VCLIpv6ThruHostStackExtendedBTestCase, self).tearDown()
708 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
709 def test_ldp_thru_host_stack_bi_dir_nsock(self):
710 """ run LDP thru host stack bi-directional (multiple sockets) test """
712 self.timeout = self.client_bi_dir_nsock_timeout
713 self.thru_host_stack_test("sock_test_server", self.server_ipv6_args,
715 self.client_ipv6_bi_dir_nsock_test_args)
718 class VCLIpv6ThruHostStackExtendedCTestCase(VCLTestCase):
719 """ VCL IPv6 Thru Host Stack Extended Tests """
722 super(VCLIpv6ThruHostStackExtendedCTestCase, self).setUp()
724 self.thru_host_stack_ipv6_setup()
726 self.client_uni_dir_nsock_timeout = 120
727 self.numSockets = "2"
729 self.client_uni_dir_nsock_timeout = 120
730 self.numSockets = "5"
732 self.client_ipv6_uni_dir_nsock_test_args = ["-6",
733 "-I", self.numSockets,
735 self.loop0.local_ip6,
739 self.thru_host_stack_ipv6_tear_down()
741 super(VCLIpv6ThruHostStackExtendedCTestCase, self).tearDown()
743 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
744 def test_ldp_thru_host_stack_uni_dir_nsock(self):
745 """ run LDP thru host stack uni-directional (multiple sockets) test """
747 self.timeout = self.client_uni_dir_nsock_timeout
748 self.thru_host_stack_test("sock_test_server", self.server_ipv6_args,
750 self.client_ipv6_uni_dir_nsock_test_args)
753 class VCLIpv6ThruHostStackExtendedDTestCase(VCLTestCase):
754 """ VCL IPv6 Thru Host Stack Extended Tests """
757 super(VCLIpv6ThruHostStackExtendedDTestCase, self).setUp()
759 self.thru_host_stack_ipv6_setup()
761 self.client_uni_dir_nsock_timeout = 120
762 self.numSockets = "2"
764 self.client_uni_dir_nsock_timeout = 120
765 self.numSockets = "5"
767 self.client_ipv6_uni_dir_nsock_test_args = ["-6",
768 "-I", self.numSockets,
770 self.loop0.local_ip6,
774 self.thru_host_stack_ipv6_tear_down()
776 super(VCLIpv6ThruHostStackExtendedDTestCase, self).tearDown()
778 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
779 def test_vcl_thru_host_stack_uni_dir_nsock(self):
780 """ run VCL thru host stack uni-directional (multiple sockets) test """
782 self.timeout = self.client_uni_dir_nsock_timeout
783 self.thru_host_stack_test("vcl_test_server", self.server_ipv6_args,
785 self.client_ipv6_uni_dir_nsock_test_args)
788 class VCLIpv6ThruHostStackIperfTestCase(VCLTestCase):
789 """ VCL IPv6 Thru Host Stack Iperf Tests """
792 super(VCLIpv6ThruHostStackIperfTestCase, self).setUp()
794 self.thru_host_stack_ipv6_setup()
795 self.client_iperf3_timeout = 20
796 self.client_ipv6_iperf3_args = ["-V6d", "-c", self.loop0.local_ip6]
797 self.server_ipv6_iperf3_args = ["-V6d", "-s"]
800 self.thru_host_stack_ipv6_tear_down()
802 super(VCLIpv6ThruHostStackIperfTestCase, self).tearDown()
804 @unittest.skipUnless(running_extended_tests(), "part of extended tests")
805 def test_ldp_thru_host_stack_iperf3(self):
806 """ run LDP thru host stack iperf3 test """
809 subprocess.check_output(['iperf3', '-v'])
811 self.logger.error("WARNING: 'iperf3' is not installed,")
813 " 'test_ldp_thru_host_stack_iperf3' not run!")
816 self.timeout = self.client_iperf3_timeout
817 self.thru_host_stack_test("iperf3", self.server_ipv6_iperf3_args,
818 "iperf3", self.client_ipv6_iperf3_args)
821 if __name__ == '__main__':
822 unittest.main(testRunner=VppTestRunner)