Renato Botelho do Couto | ead1e53 | 2019-10-31 13:31:07 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 2 | """ Vpp VCL tests """ |
| 3 | |
| 4 | import unittest |
| 5 | import os |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 6 | import subprocess |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 7 | import signal |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 8 | from framework import VppTestCase, VppTestRunner, running_extended_tests, \ |
| 9 | Worker |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 10 | from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, FibPathProto |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 11 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 12 | iperf3 = '/usr/bin/iperf3' |
| 13 | |
| 14 | |
| 15 | def have_app(app): |
| 16 | try: |
| 17 | subprocess.check_output([app, '-v']) |
| 18 | except (subprocess.CalledProcessError, OSError): |
| 19 | return False |
| 20 | return True |
| 21 | |
| 22 | |
| 23 | _have_iperf3 = have_app(iperf3) |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 24 | |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 25 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 26 | class VCLAppWorker(Worker): |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 27 | """ VCL Test Application Worker """ |
| 28 | |
Paul Vinciguerra | 48bdbcd | 2019-12-04 19:43:53 -0500 | [diff] [blame] | 29 | def __init__(self, build_dir, appname, executable_args, logger, env=None, |
| 30 | *args, **kwargs): |
| 31 | |
| 32 | if env is None: |
| 33 | env = {} |
Damjan Marion | 855e268 | 2018-08-24 13:37:45 +0200 | [diff] [blame] | 34 | vcl_lib_dir = "%s/vpp/lib" % build_dir |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 35 | if "iperf" in appname: |
| 36 | app = appname |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 37 | env.update({'LD_PRELOAD': |
Damjan Marion | 855e268 | 2018-08-24 13:37:45 +0200 | [diff] [blame] | 38 | "%s/libvcl_ldpreload.so" % vcl_lib_dir}) |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 39 | elif "sock" in appname: |
| 40 | app = "%s/vpp/bin/%s" % (build_dir, appname) |
| 41 | env.update({'LD_PRELOAD': |
| 42 | "%s/libvcl_ldpreload.so" % vcl_lib_dir}) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 43 | else: |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 44 | app = "%s/vpp/bin/%s" % (build_dir, appname) |
Paul Vinciguerra | 48bdbcd | 2019-12-04 19:43:53 -0500 | [diff] [blame] | 45 | self.args = [app] + executable_args |
| 46 | super(VCLAppWorker, self).__init__(self.args, logger, env, |
| 47 | *args, **kwargs) |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 48 | |
| 49 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 50 | class VCLTestCase(VppTestCase): |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 51 | """ VCL Test Class """ |
Florin Coras | e92c946 | 2020-11-25 08:44:16 -0800 | [diff] [blame] | 52 | extra_vpp_punt_config = ["session", "{", "poll-main", "}"] |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 53 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 54 | @classmethod |
| 55 | def setUpClass(cls): |
| 56 | super(VCLTestCase, cls).setUpClass() |
| 57 | |
| 58 | @classmethod |
| 59 | def tearDownClass(cls): |
| 60 | super(VCLTestCase, cls).tearDownClass() |
| 61 | |
| 62 | def setUp(self): |
Klement Sekera | b8c72a4 | 2018-11-08 11:21:39 +0100 | [diff] [blame] | 63 | var = "VPP_BUILD_DIR" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 64 | self.build_dir = os.getenv(var, None) |
| 65 | if self.build_dir is None: |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 66 | raise EnvironmentError("Environment variable `%s' not set" % var) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 67 | self.vppDebug = 'vpp_debug' in self.build_dir |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 68 | self.server_addr = "127.0.0.1" |
| 69 | self.server_port = "22000" |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 70 | self.server_args = [self.server_port] |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 71 | self.server_ipv6_addr = "::1" |
| 72 | self.server_ipv6_args = ["-6", self.server_port] |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 73 | self.timeout = 20 |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 74 | self.echo_phrase = "Hello, world! Jenny is a friend of mine." |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 75 | self.pre_test_sleep = 0.3 |
| 76 | self.post_test_sleep = 0.2 |
| 77 | |
| 78 | if os.path.isfile("/tmp/ldp_server_af_unix_socket"): |
| 79 | os.remove("/tmp/ldp_server_af_unix_socket") |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 80 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 81 | super(VCLTestCase, self).setUp() |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 82 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 83 | def cut_thru_setup(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 84 | self.vapi.session_enable_disable(is_enable=1) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 85 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 86 | def cut_thru_tear_down(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 87 | self.vapi.session_enable_disable(is_enable=0) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 88 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 89 | def cut_thru_test(self, server_app, server_args, client_app, client_args): |
Florin Coras | 45ab3ec | 2020-11-08 14:36:19 -0800 | [diff] [blame] | 90 | self.env = {'VCL_VPP_API_SOCKET': self.api_sock, |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 91 | 'VCL_APP_SCOPE_LOCAL': "true"} |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 92 | worker_server = VCLAppWorker(self.build_dir, server_app, server_args, |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 93 | self.logger, self.env) |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 94 | worker_server.start() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 95 | self.sleep(self.pre_test_sleep) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 96 | worker_client = VCLAppWorker(self.build_dir, client_app, client_args, |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 97 | self.logger, self.env) |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 98 | worker_client.start() |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 99 | worker_client.join(self.timeout) |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 100 | try: |
| 101 | self.validateResults(worker_client, worker_server, self.timeout) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 102 | except Exception as error: |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 103 | self.fail("Failed with %s" % error) |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 104 | self.sleep(self.post_test_sleep) |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 105 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 106 | def thru_host_stack_setup(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 107 | self.vapi.session_enable_disable(is_enable=1) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 108 | self.create_loopback_interfaces(2) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 109 | |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 110 | table_id = 1 |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 111 | |
| 112 | for i in self.lo_interfaces: |
| 113 | i.admin_up() |
| 114 | |
| 115 | if table_id != 0: |
| 116 | tbl = VppIpTable(self, table_id) |
| 117 | tbl.add_vpp_config() |
| 118 | |
| 119 | i.set_table_ip4(table_id) |
| 120 | i.config_ip4() |
| 121 | table_id += 1 |
| 122 | |
| 123 | # Configure namespaces |
Jakub Grajciar | b4e5e50 | 2020-01-31 09:35:29 +0100 | [diff] [blame] | 124 | self.vapi.app_namespace_add_del(namespace_id="1", secret=1234, |
Ole Troan | e1ade68 | 2019-03-04 23:55:43 +0100 | [diff] [blame] | 125 | sw_if_index=self.loop0.sw_if_index) |
Jakub Grajciar | b4e5e50 | 2020-01-31 09:35:29 +0100 | [diff] [blame] | 126 | self.vapi.app_namespace_add_del(namespace_id="2", secret=5678, |
Ole Troan | e1ade68 | 2019-03-04 23:55:43 +0100 | [diff] [blame] | 127 | sw_if_index=self.loop1.sw_if_index) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 128 | |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 129 | # Add inter-table routes |
| 130 | ip_t01 = VppIpRoute(self, self.loop1.local_ip4, 32, |
| 131 | [VppRoutePath("0.0.0.0", |
| 132 | 0xffffffff, |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 133 | nh_table_id=2)], table_id=1) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 134 | ip_t10 = VppIpRoute(self, self.loop0.local_ip4, 32, |
| 135 | [VppRoutePath("0.0.0.0", |
| 136 | 0xffffffff, |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 137 | nh_table_id=1)], table_id=2) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 138 | ip_t01.add_vpp_config() |
| 139 | ip_t10.add_vpp_config() |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 140 | self.logger.debug(self.vapi.cli("show ip fib")) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 141 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 142 | def thru_host_stack_tear_down(self): |
| 143 | for i in self.lo_interfaces: |
| 144 | i.unconfig_ip4() |
| 145 | i.set_table_ip4(0) |
| 146 | i.admin_down() |
| 147 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 148 | def thru_host_stack_ipv6_setup(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 149 | self.vapi.session_enable_disable(is_enable=1) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 150 | self.create_loopback_interfaces(2) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 151 | |
| 152 | table_id = 1 |
| 153 | |
| 154 | for i in self.lo_interfaces: |
| 155 | i.admin_up() |
| 156 | |
| 157 | tbl = VppIpTable(self, table_id, is_ip6=1) |
| 158 | tbl.add_vpp_config() |
| 159 | |
| 160 | i.set_table_ip6(table_id) |
| 161 | i.config_ip6() |
| 162 | table_id += 1 |
| 163 | |
| 164 | # Configure namespaces |
Jakub Grajciar | b4e5e50 | 2020-01-31 09:35:29 +0100 | [diff] [blame] | 165 | self.vapi.app_namespace_add_del(namespace_id="1", secret=1234, |
Ole Troan | e1ade68 | 2019-03-04 23:55:43 +0100 | [diff] [blame] | 166 | sw_if_index=self.loop0.sw_if_index) |
Jakub Grajciar | b4e5e50 | 2020-01-31 09:35:29 +0100 | [diff] [blame] | 167 | self.vapi.app_namespace_add_del(namespace_id="2", secret=5678, |
Ole Troan | e1ade68 | 2019-03-04 23:55:43 +0100 | [diff] [blame] | 168 | sw_if_index=self.loop1.sw_if_index) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 169 | |
| 170 | # Add inter-table routes |
| 171 | ip_t01 = VppIpRoute(self, self.loop1.local_ip6, 128, |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 172 | [VppRoutePath("::0", 0xffffffff, |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 173 | nh_table_id=2)], |
| 174 | table_id=1) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 175 | ip_t10 = VppIpRoute(self, self.loop0.local_ip6, 128, |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 176 | [VppRoutePath("::0", 0xffffffff, |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 177 | nh_table_id=1)], |
| 178 | table_id=2) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 179 | ip_t01.add_vpp_config() |
| 180 | ip_t10.add_vpp_config() |
| 181 | self.logger.debug(self.vapi.cli("show interface addr")) |
| 182 | self.logger.debug(self.vapi.cli("show ip6 fib")) |
| 183 | |
| 184 | def thru_host_stack_ipv6_tear_down(self): |
| 185 | for i in self.lo_interfaces: |
| 186 | i.unconfig_ip6() |
| 187 | i.set_table_ip6(0) |
| 188 | i.admin_down() |
| 189 | |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 190 | self.vapi.session_enable_disable(is_enable=0) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 191 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 192 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 193 | def thru_host_stack_test(self, server_app, server_args, |
| 194 | client_app, client_args): |
Florin Coras | 45ab3ec | 2020-11-08 14:36:19 -0800 | [diff] [blame] | 195 | self.env = {'VCL_VPP_API_SOCKET': self.api_sock, |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 196 | 'VCL_APP_SCOPE_GLOBAL': "true", |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 197 | 'VCL_APP_NAMESPACE_ID': "1", |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 198 | 'VCL_APP_NAMESPACE_SECRET': "1234"} |
| 199 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 200 | worker_server = VCLAppWorker(self.build_dir, server_app, server_args, |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 201 | self.logger, self.env) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 202 | worker_server.start() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 203 | self.sleep(self.pre_test_sleep) |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 204 | |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 205 | self.env.update({'VCL_APP_NAMESPACE_ID': "2", |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 206 | 'VCL_APP_NAMESPACE_SECRET': "5678"}) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 207 | worker_client = VCLAppWorker(self.build_dir, client_app, client_args, |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 208 | self.logger, self.env) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 209 | worker_client.start() |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 210 | worker_client.join(self.timeout) |
| 211 | |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 212 | try: |
| 213 | self.validateResults(worker_client, worker_server, self.timeout) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 214 | except Exception as error: |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 215 | self.fail("Failed with %s" % error) |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 216 | self.sleep(self.post_test_sleep) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 217 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 218 | def validateResults(self, worker_client, worker_server, timeout): |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 219 | if worker_server.process is None: |
| 220 | raise RuntimeError('worker_server is not running.') |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 221 | if os.path.isdir('/proc/{}'.format(worker_server.process.pid)): |
| 222 | self.logger.info("Killing server worker process (pid %d)" % |
| 223 | worker_server.process.pid) |
Dave Barach | ad64687 | 2019-05-06 10:49:41 -0400 | [diff] [blame] | 224 | os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 225 | worker_server.join() |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 226 | self.logger.info("Client worker result is `%s'" % worker_client.result) |
| 227 | error = False |
| 228 | if worker_client.result is None: |
| 229 | try: |
| 230 | error = True |
| 231 | self.logger.error( |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 232 | "Timeout: %ss! Killing client worker process (pid %d)" % |
| 233 | (timeout, worker_client.process.pid)) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 234 | os.killpg(os.getpgid(worker_client.process.pid), |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 235 | signal.SIGKILL) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 236 | worker_client.join() |
Dave Wallace | 07c0a9d | 2019-05-13 19:21:24 -0400 | [diff] [blame] | 237 | except OSError: |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 238 | self.logger.debug( |
| 239 | "Couldn't kill client worker process") |
| 240 | raise |
| 241 | if error: |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 242 | raise RuntimeError( |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 243 | "Timeout! Client worker did not finish in %ss" % timeout) |
| 244 | self.assert_equal(worker_client.result, 0, "Binary test return code") |
| 245 | |
| 246 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 247 | class LDPCutThruTestCase(VCLTestCase): |
| 248 | """ LDP Cut Thru Tests """ |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 249 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 250 | @classmethod |
| 251 | def setUpClass(cls): |
| 252 | super(LDPCutThruTestCase, cls).setUpClass() |
| 253 | |
| 254 | @classmethod |
| 255 | def tearDownClass(cls): |
| 256 | super(LDPCutThruTestCase, cls).tearDownClass() |
| 257 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 258 | def setUp(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 259 | super(LDPCutThruTestCase, self).setUp() |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 260 | |
| 261 | self.cut_thru_setup() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 262 | self.client_echo_test_args = ["-E", self.echo_phrase, "-X", |
| 263 | self.server_addr, self.server_port] |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 264 | self.client_iperf3_timeout = 20 |
Florin Coras | bad1d35 | 2021-02-01 11:59:49 -0800 | [diff] [blame] | 265 | self.client_iperf3_args = ["-4d", "-t 2", "-c", self.server_addr] |
| 266 | self.server_iperf3_args = ["-4d", "-s"] |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 267 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | 45cd3a3 | 2018-06-26 01:14:04 -0400 | [diff] [blame] | 268 | self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X", |
| 269 | "-I", "2", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 270 | self.server_addr, |
| 271 | self.server_port] |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 272 | self.client_bi_dir_nsock_timeout = 20 |
Dave Wallace | 45cd3a3 | 2018-06-26 01:14:04 -0400 | [diff] [blame] | 273 | self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X", |
| 274 | "-I", "2", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 275 | self.server_addr, |
| 276 | self.server_port] |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 277 | |
| 278 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 279 | super(LDPCutThruTestCase, self).tearDown() |
Paul Vinciguerra | 9673e3e | 2019-05-10 20:41:08 -0400 | [diff] [blame] | 280 | self.cut_thru_tear_down() |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 281 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 282 | def show_commands_at_teardown(self): |
| 283 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 284 | |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 285 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 286 | def test_ldp_cut_thru_echo(self): |
| 287 | """ run LDP cut thru echo test """ |
| 288 | |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 289 | self.cut_thru_test("sock_test_server", self.server_args, |
| 290 | "sock_test_client", self.client_echo_test_args) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 291 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 292 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 293 | def test_ldp_cut_thru_iperf3(self): |
| 294 | """ run LDP cut thru iperf3 test """ |
| 295 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 296 | self.timeout = self.client_iperf3_timeout |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 297 | self.cut_thru_test(iperf3, self.server_iperf3_args, |
| 298 | iperf3, self.client_iperf3_args) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 299 | |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 300 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 301 | def test_ldp_cut_thru_uni_dir_nsock(self): |
| 302 | """ run LDP cut thru uni-directional (multiple sockets) test """ |
| 303 | |
| 304 | self.timeout = self.client_uni_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 305 | self.cut_thru_test("sock_test_server", self.server_args, |
| 306 | "sock_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 307 | self.client_uni_dir_nsock_test_args) |
| 308 | |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 309 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Florin Coras | 0f46e16 | 2019-07-02 19:33:15 -0700 | [diff] [blame] | 310 | @unittest.skip("sock test apps need to be improved") |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 311 | def test_ldp_cut_thru_bi_dir_nsock(self): |
| 312 | """ run LDP cut thru bi-directional (multiple sockets) test """ |
| 313 | |
| 314 | self.timeout = self.client_bi_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 315 | self.cut_thru_test("sock_test_server", self.server_args, |
| 316 | "sock_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 317 | self.client_bi_dir_nsock_test_args) |
| 318 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 319 | |
| 320 | class VCLCutThruTestCase(VCLTestCase): |
| 321 | """ VCL Cut Thru Tests """ |
| 322 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 323 | @classmethod |
| 324 | def setUpClass(cls): |
| 325 | super(VCLCutThruTestCase, cls).setUpClass() |
| 326 | |
| 327 | @classmethod |
| 328 | def tearDownClass(cls): |
| 329 | super(VCLCutThruTestCase, cls).tearDownClass() |
| 330 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 331 | def setUp(self): |
| 332 | super(VCLCutThruTestCase, self).setUp() |
| 333 | |
| 334 | self.cut_thru_setup() |
| 335 | self.client_echo_test_args = ["-E", self.echo_phrase, "-X", |
| 336 | self.server_addr, self.server_port] |
| 337 | |
| 338 | self.client_uni_dir_nsock_timeout = 20 |
| 339 | self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X", |
| 340 | "-I", "2", |
| 341 | self.server_addr, |
| 342 | self.server_port] |
| 343 | self.client_bi_dir_nsock_timeout = 20 |
| 344 | self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X", |
| 345 | "-I", "2", |
| 346 | self.server_addr, |
| 347 | self.server_port] |
| 348 | |
| 349 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 350 | super(VCLCutThruTestCase, self).tearDown() |
| 351 | |
Florin Coras | 317b8e0 | 2019-04-17 09:57:46 -0700 | [diff] [blame] | 352 | def show_commands_at_teardown(self): |
| 353 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 354 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 355 | def test_vcl_cut_thru_echo(self): |
| 356 | """ run VCL cut thru echo test """ |
| 357 | |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 358 | self.cut_thru_test("vcl_test_server", self.server_args, |
| 359 | "vcl_test_client", self.client_echo_test_args) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 360 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 361 | def test_vcl_cut_thru_uni_dir_nsock(self): |
| 362 | """ run VCL cut thru uni-directional (multiple sockets) test """ |
| 363 | |
| 364 | self.timeout = self.client_uni_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 365 | self.cut_thru_test("vcl_test_server", self.server_args, |
| 366 | "vcl_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 367 | self.client_uni_dir_nsock_test_args) |
| 368 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 369 | def test_vcl_cut_thru_bi_dir_nsock(self): |
| 370 | """ run VCL cut thru bi-directional (multiple sockets) test """ |
| 371 | |
| 372 | self.timeout = self.client_bi_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 373 | self.cut_thru_test("vcl_test_server", self.server_args, |
| 374 | "vcl_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 375 | self.client_bi_dir_nsock_test_args) |
| 376 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 377 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 378 | class VCLThruHostStackEcho(VCLTestCase): |
| 379 | """ VCL Thru Host Stack Echo """ |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 380 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 381 | @classmethod |
| 382 | def setUpClass(cls): |
| 383 | super(VCLThruHostStackEcho, cls).setUpClass() |
| 384 | |
| 385 | @classmethod |
| 386 | def tearDownClass(cls): |
| 387 | super(VCLThruHostStackEcho, cls).tearDownClass() |
| 388 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 389 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 390 | super(VCLThruHostStackEcho, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 391 | |
| 392 | self.thru_host_stack_setup() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 393 | self.client_bi_dir_nsock_timeout = 20 |
| 394 | self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X", |
| 395 | "-I", "2", |
| 396 | self.loop0.local_ip4, |
| 397 | self.server_port] |
| 398 | self.client_echo_test_args = ["-E", self.echo_phrase, "-X", |
| 399 | self.loop0.local_ip4, |
| 400 | self.server_port] |
| 401 | |
| 402 | def tearDown(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 403 | self.thru_host_stack_tear_down() |
| 404 | super(VCLThruHostStackEcho, self).tearDown() |
| 405 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 406 | def show_commands_at_teardown(self): |
| 407 | self.logger.debug(self.vapi.cli("show app server")) |
| 408 | self.logger.debug(self.vapi.cli("show session verbose")) |
| 409 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 410 | |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 411 | class VCLThruHostStackTLS(VCLTestCase): |
| 412 | """ VCL Thru Host Stack TLS """ |
| 413 | |
| 414 | @classmethod |
| 415 | def setUpClass(cls): |
| 416 | super(VCLThruHostStackTLS, cls).setUpClass() |
| 417 | |
| 418 | @classmethod |
| 419 | def tearDownClass(cls): |
| 420 | super(VCLThruHostStackTLS, cls).tearDownClass() |
| 421 | |
| 422 | def setUp(self): |
| 423 | super(VCLThruHostStackTLS, self).setUp() |
| 424 | |
| 425 | self.thru_host_stack_setup() |
| 426 | self.client_uni_dir_tls_timeout = 20 |
Dave Wallace | 03dd90a | 2019-03-25 19:34:50 -0400 | [diff] [blame] | 427 | self.server_tls_args = ["-L", self.server_port] |
| 428 | self.client_uni_dir_tls_test_args = ["-N", "1000", "-U", "-X", "-L", |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 429 | self.loop0.local_ip4, |
| 430 | self.server_port] |
| 431 | |
| 432 | def test_vcl_thru_host_stack_tls_uni_dir(self): |
| 433 | """ run VCL thru host stack uni-directional TLS test """ |
| 434 | |
| 435 | self.timeout = self.client_uni_dir_tls_timeout |
| 436 | self.thru_host_stack_test("vcl_test_server", self.server_tls_args, |
| 437 | "vcl_test_client", |
| 438 | self.client_uni_dir_tls_test_args) |
| 439 | |
| 440 | def tearDown(self): |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 441 | self.thru_host_stack_tear_down() |
| 442 | super(VCLThruHostStackTLS, self).tearDown() |
| 443 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 444 | def show_commands_at_teardown(self): |
| 445 | self.logger.debug(self.vapi.cli("show app server")) |
| 446 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 447 | |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 448 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 449 | class VCLThruHostStackBidirNsock(VCLTestCase): |
| 450 | """ VCL Thru Host Stack Bidir Nsock """ |
| 451 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 452 | @classmethod |
| 453 | def setUpClass(cls): |
| 454 | super(VCLThruHostStackBidirNsock, cls).setUpClass() |
| 455 | |
| 456 | @classmethod |
| 457 | def tearDownClass(cls): |
| 458 | super(VCLThruHostStackBidirNsock, cls).tearDownClass() |
| 459 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 460 | def setUp(self): |
| 461 | super(VCLThruHostStackBidirNsock, self).setUp() |
| 462 | |
| 463 | self.thru_host_stack_setup() |
| 464 | self.client_bi_dir_nsock_timeout = 20 |
| 465 | self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X", |
| 466 | "-I", "2", |
| 467 | self.loop0.local_ip4, |
| 468 | self.server_port] |
| 469 | self.client_echo_test_args = ["-E", self.echo_phrase, "-X", |
| 470 | self.loop0.local_ip4, |
| 471 | self.server_port] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 472 | |
| 473 | def tearDown(self): |
| 474 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 475 | super(VCLThruHostStackBidirNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 476 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 477 | def show_commands_at_teardown(self): |
| 478 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 479 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 480 | def test_vcl_thru_host_stack_bi_dir_nsock(self): |
| 481 | """ run VCL thru host stack bi-directional (multiple sockets) test """ |
| 482 | |
| 483 | self.timeout = self.client_bi_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 484 | self.thru_host_stack_test("vcl_test_server", self.server_args, |
| 485 | "vcl_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 486 | self.client_bi_dir_nsock_test_args) |
| 487 | |
| 488 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 489 | class LDPThruHostStackBidirNsock(VCLTestCase): |
| 490 | """ LDP Thru Host Stack Bidir Nsock """ |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 491 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 492 | @classmethod |
| 493 | def setUpClass(cls): |
| 494 | super(LDPThruHostStackBidirNsock, cls).setUpClass() |
| 495 | |
| 496 | @classmethod |
| 497 | def tearDownClass(cls): |
| 498 | super(LDPThruHostStackBidirNsock, cls).tearDownClass() |
| 499 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 500 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 501 | super(LDPThruHostStackBidirNsock, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 502 | |
| 503 | self.thru_host_stack_setup() |
Dave Wallace | 3102c38 | 2020-04-03 19:48:48 -0400 | [diff] [blame] | 504 | self.client_bi_dir_nsock_timeout = 20 |
| 505 | self.client_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X", |
| 506 | # OUCH! Host Stack Bug? |
| 507 | # Only fails when running |
| 508 | # 'make test TEST_JOBS=auto' |
| 509 | # or TEST_JOBS > 1 |
| 510 | # "-I", "2", |
| 511 | self.loop0.local_ip4, |
| 512 | self.server_port] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 513 | |
| 514 | def tearDown(self): |
| 515 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 516 | super(LDPThruHostStackBidirNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 517 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 518 | def show_commands_at_teardown(self): |
| 519 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 520 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 521 | 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 Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 525 | self.thru_host_stack_test("sock_test_server", self.server_args, |
| 526 | "sock_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 527 | self.client_bi_dir_nsock_test_args) |
| 528 | |
| 529 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 530 | class LDPThruHostStackNsock(VCLTestCase): |
| 531 | """ LDP Thru Host Stack Nsock """ |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 532 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 533 | @classmethod |
| 534 | def setUpClass(cls): |
| 535 | super(LDPThruHostStackNsock, cls).setUpClass() |
| 536 | |
| 537 | @classmethod |
| 538 | def tearDownClass(cls): |
| 539 | super(LDPThruHostStackNsock, cls).tearDownClass() |
| 540 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 541 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 542 | super(LDPThruHostStackNsock, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 543 | |
| 544 | self.thru_host_stack_setup() |
| 545 | if self.vppDebug: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 546 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 547 | self.numSockets = "2" |
| 548 | else: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 549 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 550 | self.numSockets = "5" |
| 551 | |
Dave Wallace | 45cd3a3 | 2018-06-26 01:14:04 -0400 | [diff] [blame] | 552 | self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X", |
| 553 | "-I", self.numSockets, |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 554 | self.loop0.local_ip4, |
| 555 | self.server_port] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 556 | |
| 557 | def tearDown(self): |
| 558 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 559 | super(LDPThruHostStackNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 560 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 561 | 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 Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 565 | self.thru_host_stack_test("sock_test_server", self.server_args, |
| 566 | "sock_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 567 | self.client_uni_dir_nsock_test_args) |
| 568 | |
| 569 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 570 | class VCLThruHostStackNsock(VCLTestCase): |
| 571 | """ VCL Thru Host Stack Nsock """ |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 572 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 573 | @classmethod |
| 574 | def setUpClass(cls): |
| 575 | super(VCLThruHostStackNsock, cls).setUpClass() |
| 576 | |
| 577 | @classmethod |
| 578 | def tearDownClass(cls): |
| 579 | super(VCLThruHostStackNsock, cls).tearDownClass() |
| 580 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 581 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 582 | super(VCLThruHostStackNsock, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 583 | |
| 584 | self.thru_host_stack_setup() |
| 585 | if self.vppDebug: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 586 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 587 | self.numSockets = "2" |
| 588 | else: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 589 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 590 | self.numSockets = "5" |
| 591 | |
Dave Wallace | 45cd3a3 | 2018-06-26 01:14:04 -0400 | [diff] [blame] | 592 | self.client_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X", |
| 593 | "-I", self.numSockets, |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 594 | self.loop0.local_ip4, |
| 595 | self.server_port] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 596 | |
| 597 | def tearDown(self): |
| 598 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 599 | super(VCLThruHostStackNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 600 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 601 | 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 Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 605 | self.thru_host_stack_test("vcl_test_server", self.server_args, |
| 606 | "vcl_test_client", |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 607 | self.client_uni_dir_nsock_test_args) |
| 608 | |
| 609 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 610 | class LDPThruHostStackIperf(VCLTestCase): |
| 611 | """ LDP Thru Host Stack Iperf """ |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 612 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 613 | @classmethod |
| 614 | def setUpClass(cls): |
| 615 | super(LDPThruHostStackIperf, cls).setUpClass() |
| 616 | |
| 617 | @classmethod |
| 618 | def tearDownClass(cls): |
| 619 | super(LDPThruHostStackIperf, cls).tearDownClass() |
| 620 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 621 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 622 | super(LDPThruHostStackIperf, self).setUp() |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 623 | |
| 624 | self.thru_host_stack_setup() |
| 625 | self.client_iperf3_timeout = 20 |
Florin Coras | bad1d35 | 2021-02-01 11:59:49 -0800 | [diff] [blame] | 626 | self.client_iperf3_args = ["-4d", "-t 2", "-c", self.loop0.local_ip4] |
| 627 | self.server_iperf3_args = ["-4d", "-s"] |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 628 | |
| 629 | def tearDown(self): |
| 630 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 631 | super(LDPThruHostStackIperf, self).tearDown() |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 632 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 633 | def show_commands_at_teardown(self): |
| 634 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 635 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 636 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 637 | def test_ldp_thru_host_stack_iperf3(self): |
| 638 | """ run LDP thru host stack iperf3 test """ |
| 639 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 640 | self.timeout = self.client_iperf3_timeout |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 641 | self.thru_host_stack_test(iperf3, self.server_iperf3_args, |
| 642 | iperf3, self.client_iperf3_args) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 643 | |
| 644 | |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 645 | class LDPThruHostStackIperfUdp(VCLTestCase): |
| 646 | """ LDP Thru Host Stack Iperf UDP """ |
| 647 | |
| 648 | @classmethod |
| 649 | def setUpClass(cls): |
| 650 | super(LDPThruHostStackIperfUdp, cls).setUpClass() |
| 651 | |
| 652 | @classmethod |
| 653 | def tearDownClass(cls): |
| 654 | super(LDPThruHostStackIperfUdp, cls).tearDownClass() |
| 655 | |
| 656 | def setUp(self): |
| 657 | super(LDPThruHostStackIperfUdp, self).setUp() |
| 658 | |
| 659 | self.thru_host_stack_setup() |
| 660 | self.client_iperf3_timeout = 20 |
Florin Coras | bad1d35 | 2021-02-01 11:59:49 -0800 | [diff] [blame] | 661 | self.client_iperf3_args = ["-4d", "-t 2", "-u", "-l 1400", |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 662 | "-c", self.loop0.local_ip4] |
Florin Coras | bad1d35 | 2021-02-01 11:59:49 -0800 | [diff] [blame] | 663 | self.server_iperf3_args = ["-4d", "-s"] |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 664 | |
| 665 | def tearDown(self): |
| 666 | self.thru_host_stack_tear_down() |
| 667 | super(LDPThruHostStackIperfUdp, self).tearDown() |
| 668 | |
| 669 | def show_commands_at_teardown(self): |
| 670 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 671 | |
| 672 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
| 673 | def test_ldp_thru_host_stack_iperf3_udp(self): |
| 674 | """ run LDP thru host stack iperf3 UDP test """ |
| 675 | |
| 676 | self.timeout = self.client_iperf3_timeout |
| 677 | self.thru_host_stack_test(iperf3, self.server_iperf3_args, |
| 678 | iperf3, self.client_iperf3_args) |
| 679 | |
| 680 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 681 | class LDPIpv6CutThruTestCase(VCLTestCase): |
| 682 | """ LDP IPv6 Cut Thru Tests """ |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 683 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 684 | @classmethod |
| 685 | def setUpClass(cls): |
| 686 | super(LDPIpv6CutThruTestCase, cls).setUpClass() |
| 687 | |
| 688 | @classmethod |
| 689 | def tearDownClass(cls): |
| 690 | super(LDPIpv6CutThruTestCase, cls).tearDownClass() |
| 691 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 692 | def setUp(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 693 | super(LDPIpv6CutThruTestCase, self).setUp() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 694 | |
| 695 | self.cut_thru_setup() |
| 696 | self.client_iperf3_timeout = 20 |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 697 | self.client_uni_dir_nsock_timeout = 20 |
| 698 | self.client_bi_dir_nsock_timeout = 20 |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 699 | self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X", |
| 700 | self.server_ipv6_addr, |
| 701 | self.server_port] |
Florin Coras | bad1d35 | 2021-02-01 11:59:49 -0800 | [diff] [blame] | 702 | self.client_ipv6_iperf3_args = ["-6d", "-t 2", "-c", |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 703 | self.server_ipv6_addr] |
Florin Coras | bad1d35 | 2021-02-01 11:59:49 -0800 | [diff] [blame] | 704 | self.server_ipv6_iperf3_args = ["-6d", "-s"] |
Dave Wallace | 45cd3a3 | 2018-06-26 01:14:04 -0400 | [diff] [blame] | 705 | self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X", |
| 706 | "-6", |
| 707 | "-I", "2", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 708 | self.server_ipv6_addr, |
| 709 | self.server_port] |
Dave Wallace | 45cd3a3 | 2018-06-26 01:14:04 -0400 | [diff] [blame] | 710 | self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X", |
| 711 | "-6", |
| 712 | "-I", "2", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 713 | self.server_ipv6_addr, |
| 714 | self.server_port] |
| 715 | |
| 716 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 717 | super(LDPIpv6CutThruTestCase, self).tearDown() |
Paul Vinciguerra | 9673e3e | 2019-05-10 20:41:08 -0400 | [diff] [blame] | 718 | self.cut_thru_tear_down() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 719 | |
| 720 | def test_ldp_ipv6_cut_thru_echo(self): |
| 721 | """ run LDP IPv6 cut thru echo test """ |
| 722 | |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 723 | self.cut_thru_test("sock_test_server", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 724 | self.server_ipv6_args, |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 725 | "sock_test_client", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 726 | self.client_ipv6_echo_test_args) |
| 727 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 728 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 729 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 730 | def test_ldp_ipv6_cut_thru_iperf3(self): |
| 731 | """ run LDP IPv6 cut thru iperf3 test """ |
| 732 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 733 | self.timeout = self.client_iperf3_timeout |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 734 | self.cut_thru_test(iperf3, self.server_ipv6_iperf3_args, |
| 735 | iperf3, self.client_ipv6_iperf3_args) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 736 | |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 737 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 738 | def test_ldp_ipv6_cut_thru_uni_dir_nsock(self): |
| 739 | """ run LDP IPv6 cut thru uni-directional (multiple sockets) test """ |
| 740 | |
| 741 | self.timeout = self.client_uni_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 742 | self.cut_thru_test("sock_test_server", self.server_ipv6_args, |
| 743 | "sock_test_client", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 744 | self.client_ipv6_uni_dir_nsock_test_args) |
| 745 | |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 746 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Florin Coras | 0f46e16 | 2019-07-02 19:33:15 -0700 | [diff] [blame] | 747 | @unittest.skip("sock test apps need to be improved") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 748 | def test_ldp_ipv6_cut_thru_bi_dir_nsock(self): |
| 749 | """ run LDP IPv6 cut thru bi-directional (multiple sockets) test """ |
| 750 | |
| 751 | self.timeout = self.client_bi_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 752 | self.cut_thru_test("sock_test_server", self.server_ipv6_args, |
| 753 | "sock_test_client", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 754 | self.client_ipv6_bi_dir_nsock_test_args) |
| 755 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 756 | |
| 757 | class VCLIpv6CutThruTestCase(VCLTestCase): |
| 758 | """ VCL IPv6 Cut Thru Tests """ |
| 759 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 760 | @classmethod |
| 761 | def setUpClass(cls): |
| 762 | super(VCLIpv6CutThruTestCase, cls).setUpClass() |
| 763 | |
| 764 | @classmethod |
| 765 | def tearDownClass(cls): |
| 766 | super(VCLIpv6CutThruTestCase, cls).tearDownClass() |
| 767 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 768 | def setUp(self): |
| 769 | super(VCLIpv6CutThruTestCase, self).setUp() |
| 770 | |
| 771 | self.cut_thru_setup() |
| 772 | self.client_uni_dir_nsock_timeout = 20 |
| 773 | self.client_bi_dir_nsock_timeout = 20 |
| 774 | self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X", |
| 775 | self.server_ipv6_addr, |
| 776 | self.server_port] |
| 777 | self.client_ipv6_uni_dir_nsock_test_args = ["-N", "1000", "-U", "-X", |
| 778 | "-6", |
| 779 | "-I", "2", |
| 780 | self.server_ipv6_addr, |
| 781 | self.server_port] |
| 782 | self.client_ipv6_bi_dir_nsock_test_args = ["-N", "1000", "-B", "-X", |
| 783 | "-6", |
| 784 | "-I", "2", |
| 785 | self.server_ipv6_addr, |
| 786 | self.server_port] |
| 787 | |
| 788 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 789 | super(VCLIpv6CutThruTestCase, self).tearDown() |
Paul Vinciguerra | 9673e3e | 2019-05-10 20:41:08 -0400 | [diff] [blame] | 790 | self.cut_thru_tear_down() |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 791 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 792 | def test_vcl_ipv6_cut_thru_echo(self): |
| 793 | """ run VCL IPv6 cut thru echo test """ |
| 794 | |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 795 | self.cut_thru_test("vcl_test_server", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 796 | self.server_ipv6_args, |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 797 | "vcl_test_client", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 798 | self.client_ipv6_echo_test_args) |
| 799 | |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 800 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 801 | def test_vcl_ipv6_cut_thru_uni_dir_nsock(self): |
| 802 | """ run VCL IPv6 cut thru uni-directional (multiple sockets) test """ |
| 803 | |
| 804 | self.timeout = self.client_uni_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 805 | self.cut_thru_test("vcl_test_server", self.server_ipv6_args, |
| 806 | "vcl_test_client", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 807 | self.client_ipv6_uni_dir_nsock_test_args) |
| 808 | |
Paul Vinciguerra | defde0f | 2018-12-06 07:46:13 -0800 | [diff] [blame] | 809 | @unittest.skipUnless(running_extended_tests, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 810 | def test_vcl_ipv6_cut_thru_bi_dir_nsock(self): |
| 811 | """ run VCL IPv6 cut thru bi-directional (multiple sockets) test """ |
| 812 | |
| 813 | self.timeout = self.client_bi_dir_nsock_timeout |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 814 | self.cut_thru_test("vcl_test_server", self.server_ipv6_args, |
| 815 | "vcl_test_client", |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 816 | self.client_ipv6_bi_dir_nsock_test_args) |
| 817 | |
| 818 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 819 | class VCLIpv6ThruHostStackEcho(VCLTestCase): |
| 820 | """ VCL IPv6 Thru Host Stack Echo """ |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 821 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 822 | @classmethod |
| 823 | def setUpClass(cls): |
| 824 | super(VCLIpv6ThruHostStackEcho, cls).setUpClass() |
| 825 | |
| 826 | @classmethod |
| 827 | def tearDownClass(cls): |
| 828 | super(VCLIpv6ThruHostStackEcho, cls).tearDownClass() |
| 829 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 830 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 831 | super(VCLIpv6ThruHostStackEcho, self).setUp() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 832 | |
| 833 | self.thru_host_stack_ipv6_setup() |
| 834 | self.client_ipv6_echo_test_args = ["-6", "-E", self.echo_phrase, "-X", |
| 835 | self.loop0.local_ip6, |
| 836 | self.server_port] |
| 837 | |
| 838 | def tearDown(self): |
| 839 | self.thru_host_stack_ipv6_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 840 | super(VCLIpv6ThruHostStackEcho, self).tearDown() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 841 | |
| 842 | def test_vcl_ipv6_thru_host_stack_echo(self): |
| 843 | """ run VCL IPv6 thru host stack echo test """ |
| 844 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 845 | self.thru_host_stack_test("vcl_test_server", |
Damjan Marion | 855e268 | 2018-08-24 13:37:45 +0200 | [diff] [blame] | 846 | self.server_ipv6_args, |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 847 | "vcl_test_client", |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 848 | self.client_ipv6_echo_test_args) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 849 | |
| 850 | |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 851 | if __name__ == '__main__': |
| 852 | unittest.main(testRunner=VppTestRunner) |