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 |
Damjan Marion | 5546e43 | 2021-09-30 20:04:14 +0200 | [diff] [blame] | 8 | import glob |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 9 | from config import config |
| 10 | from framework import VppTestCase, VppTestRunner, Worker |
Neale Ranns | 097fa66 | 2018-05-01 05:17:55 -0700 | [diff] [blame] | 11 | from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath, FibPathProto |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 12 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 13 | iperf3 = "/usr/bin/iperf3" |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 14 | |
| 15 | |
| 16 | def have_app(app): |
| 17 | try: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 18 | subprocess.check_output([app, "-v"]) |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 19 | except (subprocess.CalledProcessError, OSError): |
| 20 | return False |
| 21 | return True |
| 22 | |
| 23 | |
| 24 | _have_iperf3 = have_app(iperf3) |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 25 | |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 26 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 27 | class VCLAppWorker(Worker): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 28 | """VCL Test Application Worker""" |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 29 | |
Damjan Marion | 5546e43 | 2021-09-30 20:04:14 +0200 | [diff] [blame] | 30 | libname = "libvcl_ldpreload.so" |
| 31 | |
| 32 | class LibraryNotFound(Exception): |
| 33 | pass |
| 34 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 35 | def __init__( |
| 36 | self, appname, executable_args, logger, env=None, role=None, *args, **kwargs |
| 37 | ): |
Dave Wallace | 4ee17d8 | 2021-05-20 14:01:51 -0400 | [diff] [blame] | 38 | self.role = role |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 39 | vcl_ldpreload_glob = f"{config.vpp_install_dir}/**/{self.libname}" |
Damjan Marion | 5546e43 | 2021-09-30 20:04:14 +0200 | [diff] [blame] | 40 | vcl_ldpreload_so = glob.glob(vcl_ldpreload_glob, recursive=True) |
| 41 | |
| 42 | if len(vcl_ldpreload_so) < 1: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 43 | raise LibraryNotFound("cannot locate library: {}".format(self.libname)) |
Damjan Marion | 5546e43 | 2021-09-30 20:04:14 +0200 | [diff] [blame] | 44 | |
| 45 | vcl_ldpreload_so = vcl_ldpreload_so[0] |
| 46 | |
Paul Vinciguerra | 48bdbcd | 2019-12-04 19:43:53 -0500 | [diff] [blame] | 47 | if env is None: |
| 48 | env = {} |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 49 | if "iperf" in appname: |
| 50 | app = appname |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 51 | env.update({"LD_PRELOAD": vcl_ldpreload_so}) |
Florin Coras | ab2f6db | 2018-08-31 14:31:41 -0700 | [diff] [blame] | 52 | elif "sock" in appname: |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 53 | app = f"{config.vpp_build_dir}/vpp/bin/{appname}" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 54 | env.update({"LD_PRELOAD": vcl_ldpreload_so}) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 55 | else: |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 56 | app = f"{config.vpp_build_dir}/vpp/bin/{appname}" |
Paul Vinciguerra | 48bdbcd | 2019-12-04 19:43:53 -0500 | [diff] [blame] | 57 | self.args = [app] + executable_args |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 58 | super(VCLAppWorker, self).__init__(self.args, logger, env, *args, **kwargs) |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 59 | |
| 60 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 61 | class VCLTestCase(VppTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 62 | """VCL Test Class""" |
| 63 | |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 64 | session_startup = ["poll-main"] |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 65 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 66 | @classmethod |
| 67 | def setUpClass(cls): |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 68 | if cls.session_startup: |
| 69 | conf = "session {" + " ".join(cls.session_startup) + "}" |
| 70 | cls.extra_vpp_punt_config = [conf] |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 71 | super(VCLTestCase, cls).setUpClass() |
| 72 | |
| 73 | @classmethod |
| 74 | def tearDownClass(cls): |
| 75 | super(VCLTestCase, cls).tearDownClass() |
| 76 | |
| 77 | def setUp(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 78 | self.vppDebug = "vpp_debug" in config.vpp_install_dir |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 79 | self.server_addr = "127.0.0.1" |
| 80 | self.server_port = "22000" |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 81 | self.server_args = [self.server_port] |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 82 | self.server_ipv6_addr = "::1" |
| 83 | self.server_ipv6_args = ["-6", self.server_port] |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 84 | self.timeout = 20 |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 85 | self.echo_phrase = "Hello, world! Jenny is a friend of mine." |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 86 | self.pre_test_sleep = 0.3 |
| 87 | self.post_test_sleep = 0.2 |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 88 | self.sapi_client_sock = "" |
| 89 | self.sapi_server_sock = "" |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 90 | |
| 91 | if os.path.isfile("/tmp/ldp_server_af_unix_socket"): |
| 92 | os.remove("/tmp/ldp_server_af_unix_socket") |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 93 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 94 | super(VCLTestCase, self).setUp() |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 95 | |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 96 | def update_vcl_app_env(self, ns_id, ns_secret, attach_sock): |
| 97 | if not ns_id: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 98 | if "VCL_APP_NAMESPACE_ID" in self.vcl_app_env: |
| 99 | del self.vcl_app_env["VCL_APP_NAMESPACE_ID"] |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 100 | else: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 101 | self.vcl_app_env["VCL_APP_NAMESPACE_ID"] = ns_id |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 102 | |
| 103 | if not ns_secret: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 104 | if "VCL_APP_NAMESPACE_SECRET" in self.vcl_app_env: |
| 105 | del self.vcl_app_env["VCL_APP_NAMESPACE_SECRET"] |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 106 | else: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 107 | self.vcl_app_env["VCL_APP_NAMESPACE_SECRET"] = ns_secret |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 108 | |
| 109 | if not attach_sock: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 110 | self.vcl_app_env["VCL_VPP_API_SOCKET"] = self.get_api_sock_path() |
| 111 | if "VCL_VPP_SAPI_SOCKET" in self.vcl_app_env: |
| 112 | del self.vcl_app_env["VCL_VPP_SAPI_SOCKET"] |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 113 | else: |
| 114 | sapi_sock = "%s/app_ns_sockets/%s" % (self.tempdir, attach_sock) |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 115 | self.vcl_app_env["VCL_VPP_SAPI_SOCKET"] = sapi_sock |
| 116 | if "VCL_VPP_API_SOCKET" in self.vcl_app_env: |
| 117 | del self.vcl_app_env["VCL_VPP_API_SOCKET"] |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 118 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 119 | def cut_thru_setup(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 120 | self.vapi.session_enable_disable(is_enable=1) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 121 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 122 | def cut_thru_tear_down(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 123 | self.vapi.session_enable_disable(is_enable=0) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 124 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 125 | def cut_thru_test(self, server_app, server_args, client_app, client_args): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 126 | self.vcl_app_env = {"VCL_APP_SCOPE_LOCAL": "true"} |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 127 | |
| 128 | self.update_vcl_app_env("", "", self.sapi_server_sock) |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 129 | worker_server = VCLAppWorker( |
| 130 | server_app, server_args, self.logger, self.vcl_app_env, "server" |
| 131 | ) |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 132 | worker_server.start() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 133 | self.sleep(self.pre_test_sleep) |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 134 | |
| 135 | self.update_vcl_app_env("", "", self.sapi_client_sock) |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 136 | worker_client = VCLAppWorker( |
| 137 | client_app, client_args, self.logger, self.vcl_app_env, "client" |
| 138 | ) |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 139 | worker_client.start() |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 140 | worker_client.join(self.timeout) |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 141 | try: |
| 142 | self.validateResults(worker_client, worker_server, self.timeout) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 143 | except Exception as error: |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 144 | self.fail("Failed with %s" % error) |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 145 | self.sleep(self.post_test_sleep) |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 146 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 147 | def thru_host_stack_setup(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 148 | self.vapi.session_enable_disable(is_enable=1) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 149 | self.create_loopback_interfaces(2) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 150 | |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 151 | table_id = 1 |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 152 | |
| 153 | for i in self.lo_interfaces: |
| 154 | i.admin_up() |
| 155 | |
| 156 | if table_id != 0: |
| 157 | tbl = VppIpTable(self, table_id) |
| 158 | tbl.add_vpp_config() |
| 159 | |
| 160 | i.set_table_ip4(table_id) |
| 161 | i.config_ip4() |
| 162 | table_id += 1 |
| 163 | |
| 164 | # Configure namespaces |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 165 | self.vapi.app_namespace_add_del( |
| 166 | namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index |
| 167 | ) |
| 168 | self.vapi.app_namespace_add_del( |
| 169 | namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index |
| 170 | ) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 171 | |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 172 | # Add inter-table routes |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 173 | ip_t01 = VppIpRoute( |
| 174 | self, |
| 175 | self.loop1.local_ip4, |
| 176 | 32, |
| 177 | [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=2)], |
| 178 | table_id=1, |
| 179 | ) |
| 180 | ip_t10 = VppIpRoute( |
| 181 | self, |
| 182 | self.loop0.local_ip4, |
| 183 | 32, |
| 184 | [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=1)], |
| 185 | table_id=2, |
| 186 | ) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 187 | ip_t01.add_vpp_config() |
| 188 | ip_t10.add_vpp_config() |
Florin Coras | 56b39f6 | 2018-03-27 17:29:32 -0700 | [diff] [blame] | 189 | self.logger.debug(self.vapi.cli("show ip fib")) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 190 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 191 | def thru_host_stack_tear_down(self): |
| 192 | for i in self.lo_interfaces: |
| 193 | i.unconfig_ip4() |
| 194 | i.set_table_ip4(0) |
| 195 | i.admin_down() |
| 196 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 197 | def thru_host_stack_ipv6_setup(self): |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 198 | self.vapi.session_enable_disable(is_enable=1) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 199 | self.create_loopback_interfaces(2) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 200 | |
| 201 | table_id = 1 |
| 202 | |
| 203 | for i in self.lo_interfaces: |
| 204 | i.admin_up() |
| 205 | |
| 206 | tbl = VppIpTable(self, table_id, is_ip6=1) |
| 207 | tbl.add_vpp_config() |
| 208 | |
| 209 | i.set_table_ip6(table_id) |
| 210 | i.config_ip6() |
| 211 | table_id += 1 |
| 212 | |
| 213 | # Configure namespaces |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 214 | self.vapi.app_namespace_add_del( |
| 215 | namespace_id="1", secret=1234, sw_if_index=self.loop0.sw_if_index |
| 216 | ) |
| 217 | self.vapi.app_namespace_add_del( |
| 218 | namespace_id="2", secret=5678, sw_if_index=self.loop1.sw_if_index |
| 219 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 220 | |
| 221 | # Add inter-table routes |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 222 | ip_t01 = VppIpRoute( |
| 223 | self, |
| 224 | self.loop1.local_ip6, |
| 225 | 128, |
| 226 | [VppRoutePath("::0", 0xFFFFFFFF, nh_table_id=2)], |
| 227 | table_id=1, |
| 228 | ) |
| 229 | ip_t10 = VppIpRoute( |
| 230 | self, |
| 231 | self.loop0.local_ip6, |
| 232 | 128, |
| 233 | [VppRoutePath("::0", 0xFFFFFFFF, nh_table_id=1)], |
| 234 | table_id=2, |
| 235 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 236 | ip_t01.add_vpp_config() |
| 237 | ip_t10.add_vpp_config() |
| 238 | self.logger.debug(self.vapi.cli("show interface addr")) |
| 239 | self.logger.debug(self.vapi.cli("show ip6 fib")) |
| 240 | |
| 241 | def thru_host_stack_ipv6_tear_down(self): |
| 242 | for i in self.lo_interfaces: |
| 243 | i.unconfig_ip6() |
| 244 | i.set_table_ip6(0) |
| 245 | i.admin_down() |
| 246 | |
Jakub Grajciar | 6a2794e | 2020-11-24 11:22:01 +0100 | [diff] [blame] | 247 | self.vapi.session_enable_disable(is_enable=0) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 248 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 249 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 250 | def thru_host_stack_test(self, server_app, server_args, client_app, client_args): |
| 251 | self.vcl_app_env = {"VCL_APP_SCOPE_GLOBAL": "true"} |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 252 | |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 253 | self.update_vcl_app_env("1", "1234", self.sapi_server_sock) |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 254 | worker_server = VCLAppWorker( |
| 255 | server_app, server_args, self.logger, self.vcl_app_env, "server" |
| 256 | ) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 257 | worker_server.start() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 258 | self.sleep(self.pre_test_sleep) |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 259 | |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 260 | self.update_vcl_app_env("2", "5678", self.sapi_client_sock) |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 261 | worker_client = VCLAppWorker( |
| 262 | client_app, client_args, self.logger, self.vcl_app_env, "client" |
| 263 | ) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 264 | worker_client.start() |
Dave Wallace | 42996c0 | 2018-02-26 14:40:13 -0500 | [diff] [blame] | 265 | worker_client.join(self.timeout) |
| 266 | |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 267 | try: |
| 268 | self.validateResults(worker_client, worker_server, self.timeout) |
Klement Sekera | b9ef273 | 2018-06-24 22:49:33 +0200 | [diff] [blame] | 269 | except Exception as error: |
Dave Wallace | fef3f7b | 2018-03-09 12:04:10 -0500 | [diff] [blame] | 270 | self.fail("Failed with %s" % error) |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 271 | self.sleep(self.post_test_sleep) |
Dave Wallace | a67a03e | 2018-02-20 12:39:37 -0500 | [diff] [blame] | 272 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 273 | def validateResults(self, worker_client, worker_server, timeout): |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 274 | if worker_server.process is None: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 275 | raise RuntimeError("worker_server is not running.") |
| 276 | if os.path.isdir("/proc/{}".format(worker_server.process.pid)): |
| 277 | self.logger.info( |
| 278 | "Killing server worker process (pid %d)" % worker_server.process.pid |
| 279 | ) |
Dave Barach | ad64687 | 2019-05-06 10:49:41 -0400 | [diff] [blame] | 280 | os.killpg(os.getpgid(worker_server.process.pid), signal.SIGTERM) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 281 | worker_server.join() |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 282 | self.logger.info("Client worker result is `%s'" % worker_client.result) |
| 283 | error = False |
| 284 | if worker_client.result is None: |
| 285 | try: |
| 286 | error = True |
| 287 | self.logger.error( |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 288 | "Timeout: %ss! Killing client worker process (pid %d)" |
| 289 | % (timeout, worker_client.process.pid) |
| 290 | ) |
| 291 | os.killpg(os.getpgid(worker_client.process.pid), signal.SIGKILL) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 292 | worker_client.join() |
Dave Wallace | 07c0a9d | 2019-05-13 19:21:24 -0400 | [diff] [blame] | 293 | except OSError: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 294 | self.logger.debug("Couldn't kill client worker process") |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 295 | raise |
| 296 | if error: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 297 | raise RuntimeError("Timeout! Client worker did not finish in %ss" % timeout) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 298 | self.assert_equal(worker_client.result, 0, "Binary test return code") |
| 299 | |
| 300 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 301 | class LDPCutThruTestCase(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 302 | """LDP Cut Thru Tests""" |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 303 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 304 | @classmethod |
| 305 | def setUpClass(cls): |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 306 | cls.session_startup = ["poll-main", "use-app-socket-api"] |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 307 | super(LDPCutThruTestCase, cls).setUpClass() |
| 308 | |
| 309 | @classmethod |
| 310 | def tearDownClass(cls): |
| 311 | super(LDPCutThruTestCase, cls).tearDownClass() |
| 312 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 313 | def setUp(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 314 | super(LDPCutThruTestCase, self).setUp() |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 315 | |
| 316 | self.cut_thru_setup() |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 317 | self.client_echo_test_args = [ |
| 318 | "-E", |
| 319 | self.echo_phrase, |
| 320 | "-X", |
| 321 | self.server_addr, |
| 322 | self.server_port, |
| 323 | ] |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 324 | self.client_iperf3_timeout = 20 |
Florin Coras | 1d87914 | 2021-05-06 00:08:18 -0700 | [diff] [blame] | 325 | self.client_iperf3_args = ["-4", "-t 2", "-c", self.server_addr] |
| 326 | self.server_iperf3_args = ["-4", "-s"] |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 327 | self.client_uni_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 328 | self.client_uni_dir_nsock_test_args = [ |
| 329 | "-N", |
| 330 | "1000", |
| 331 | "-U", |
| 332 | "-X", |
| 333 | "-I", |
| 334 | "2", |
| 335 | self.server_addr, |
| 336 | self.server_port, |
| 337 | ] |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 338 | self.client_bi_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 339 | self.client_bi_dir_nsock_test_args = [ |
| 340 | "-N", |
| 341 | "1000", |
| 342 | "-B", |
| 343 | "-X", |
| 344 | "-I", |
| 345 | "2", |
| 346 | self.server_addr, |
| 347 | self.server_port, |
| 348 | ] |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 349 | self.sapi_client_sock = "default" |
| 350 | self.sapi_server_sock = "default" |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 351 | |
| 352 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 353 | super(LDPCutThruTestCase, self).tearDown() |
Paul Vinciguerra | 9673e3e | 2019-05-10 20:41:08 -0400 | [diff] [blame] | 354 | self.cut_thru_tear_down() |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 355 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 356 | def show_commands_at_teardown(self): |
| 357 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 358 | self.logger.debug(self.vapi.cli("show app mq")) |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 359 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 360 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 361 | def test_ldp_cut_thru_echo(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 362 | """run LDP cut thru echo test""" |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 363 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 364 | self.cut_thru_test( |
| 365 | "sock_test_server", |
| 366 | self.server_args, |
| 367 | "sock_test_client", |
| 368 | self.client_echo_test_args, |
| 369 | ) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 370 | |
| 371 | def test_ldp_cut_thru_iperf3(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 372 | """run LDP cut thru iperf3 test""" |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 373 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 374 | self.timeout = self.client_iperf3_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 375 | self.cut_thru_test( |
| 376 | iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args |
| 377 | ) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 378 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 379 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 380 | def test_ldp_cut_thru_uni_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 381 | """run LDP cut thru uni-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 382 | |
| 383 | self.timeout = self.client_uni_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 384 | self.cut_thru_test( |
| 385 | "sock_test_server", |
| 386 | self.server_args, |
| 387 | "sock_test_client", |
| 388 | self.client_uni_dir_nsock_test_args, |
| 389 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 390 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 391 | @unittest.skipUnless(config.extended, "part of extended tests") |
Florin Coras | 0f46e16 | 2019-07-02 19:33:15 -0700 | [diff] [blame] | 392 | @unittest.skip("sock test apps need to be improved") |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 393 | def test_ldp_cut_thru_bi_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 394 | """run LDP cut thru bi-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 395 | |
| 396 | self.timeout = self.client_bi_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 397 | self.cut_thru_test( |
| 398 | "sock_test_server", |
| 399 | self.server_args, |
| 400 | "sock_test_client", |
| 401 | self.client_bi_dir_nsock_test_args, |
| 402 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 403 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 404 | |
| 405 | class VCLCutThruTestCase(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 406 | """VCL Cut Thru Tests""" |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 407 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 408 | @classmethod |
| 409 | def setUpClass(cls): |
| 410 | super(VCLCutThruTestCase, cls).setUpClass() |
| 411 | |
| 412 | @classmethod |
| 413 | def tearDownClass(cls): |
| 414 | super(VCLCutThruTestCase, cls).tearDownClass() |
| 415 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 416 | def setUp(self): |
| 417 | super(VCLCutThruTestCase, self).setUp() |
| 418 | |
| 419 | self.cut_thru_setup() |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 420 | self.client_echo_test_args = [ |
| 421 | "-E", |
| 422 | self.echo_phrase, |
| 423 | "-X", |
| 424 | self.server_addr, |
| 425 | self.server_port, |
| 426 | ] |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 427 | |
| 428 | self.client_uni_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 429 | self.client_uni_dir_nsock_test_args = [ |
| 430 | "-N", |
| 431 | "1000", |
| 432 | "-U", |
| 433 | "-X", |
| 434 | "-I", |
| 435 | "2", |
| 436 | self.server_addr, |
| 437 | self.server_port, |
| 438 | ] |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 439 | self.client_bi_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 440 | self.client_bi_dir_nsock_test_args = [ |
| 441 | "-N", |
| 442 | "1000", |
| 443 | "-B", |
| 444 | "-X", |
| 445 | "-I", |
| 446 | "2", |
| 447 | self.server_addr, |
| 448 | self.server_port, |
| 449 | ] |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 450 | |
| 451 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 452 | super(VCLCutThruTestCase, self).tearDown() |
| 453 | |
Florin Coras | 317b8e0 | 2019-04-17 09:57:46 -0700 | [diff] [blame] | 454 | def show_commands_at_teardown(self): |
| 455 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 456 | self.logger.debug(self.vapi.cli("show app mq")) |
Florin Coras | 317b8e0 | 2019-04-17 09:57:46 -0700 | [diff] [blame] | 457 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 458 | def test_vcl_cut_thru_echo(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 459 | """run VCL cut thru echo test""" |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 460 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 461 | self.cut_thru_test( |
| 462 | "vcl_test_server", |
| 463 | self.server_args, |
| 464 | "vcl_test_client", |
| 465 | self.client_echo_test_args, |
| 466 | ) |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 467 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 468 | def test_vcl_cut_thru_uni_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 469 | """run VCL cut thru uni-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 470 | |
| 471 | self.timeout = self.client_uni_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 472 | self.cut_thru_test( |
| 473 | "vcl_test_server", |
| 474 | self.server_args, |
| 475 | "vcl_test_client", |
| 476 | self.client_uni_dir_nsock_test_args, |
| 477 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 478 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 479 | def test_vcl_cut_thru_bi_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 480 | """run VCL cut thru bi-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 481 | |
| 482 | self.timeout = self.client_bi_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 483 | self.cut_thru_test( |
| 484 | "vcl_test_server", |
| 485 | self.server_args, |
| 486 | "vcl_test_client", |
| 487 | self.client_bi_dir_nsock_test_args, |
| 488 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 489 | |
Dave Wallace | 9f11c01 | 2018-02-28 17:55:23 -0500 | [diff] [blame] | 490 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 491 | class VCLThruHostStackEcho(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 492 | """VCL Thru Host Stack Echo""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 493 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 494 | @classmethod |
| 495 | def setUpClass(cls): |
| 496 | super(VCLThruHostStackEcho, cls).setUpClass() |
| 497 | |
| 498 | @classmethod |
| 499 | def tearDownClass(cls): |
| 500 | super(VCLThruHostStackEcho, cls).tearDownClass() |
| 501 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 502 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 503 | super(VCLThruHostStackEcho, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 504 | |
| 505 | self.thru_host_stack_setup() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 506 | self.client_bi_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 507 | self.client_bi_dir_nsock_test_args = [ |
| 508 | "-N", |
| 509 | "1000", |
| 510 | "-B", |
| 511 | "-X", |
| 512 | "-I", |
| 513 | "2", |
| 514 | self.loop0.local_ip4, |
| 515 | self.server_port, |
| 516 | ] |
| 517 | self.client_echo_test_args = [ |
| 518 | "-E", |
| 519 | self.echo_phrase, |
| 520 | "-X", |
| 521 | self.loop0.local_ip4, |
| 522 | self.server_port, |
| 523 | ] |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 524 | |
| 525 | def tearDown(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 526 | self.thru_host_stack_tear_down() |
| 527 | super(VCLThruHostStackEcho, self).tearDown() |
| 528 | |
Filip Tehlar | 48bdf24 | 2022-02-08 09:40:00 +0000 | [diff] [blame] | 529 | def test_vcl_thru_host_stack_echo(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 530 | """run VCL IPv4 thru host stack echo test""" |
Filip Tehlar | 48bdf24 | 2022-02-08 09:40:00 +0000 | [diff] [blame] | 531 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 532 | self.thru_host_stack_test( |
| 533 | "vcl_test_server", |
| 534 | self.server_args, |
| 535 | "vcl_test_client", |
| 536 | self.client_echo_test_args, |
| 537 | ) |
Filip Tehlar | 48bdf24 | 2022-02-08 09:40:00 +0000 | [diff] [blame] | 538 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 539 | def show_commands_at_teardown(self): |
| 540 | self.logger.debug(self.vapi.cli("show app server")) |
| 541 | self.logger.debug(self.vapi.cli("show session verbose")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 542 | self.logger.debug(self.vapi.cli("show app mq")) |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 543 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 544 | |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 545 | class VCLThruHostStackTLS(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 546 | """VCL Thru Host Stack TLS""" |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 547 | |
| 548 | @classmethod |
| 549 | def setUpClass(cls): |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 550 | cls.session_startup = ["poll-main", "use-app-socket-api"] |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 551 | super(VCLThruHostStackTLS, cls).setUpClass() |
| 552 | |
| 553 | @classmethod |
| 554 | def tearDownClass(cls): |
| 555 | super(VCLThruHostStackTLS, cls).tearDownClass() |
| 556 | |
| 557 | def setUp(self): |
| 558 | super(VCLThruHostStackTLS, self).setUp() |
| 559 | |
| 560 | self.thru_host_stack_setup() |
| 561 | self.client_uni_dir_tls_timeout = 20 |
Dave Wallace | 03dd90a | 2019-03-25 19:34:50 -0400 | [diff] [blame] | 562 | self.server_tls_args = ["-L", self.server_port] |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 563 | self.client_uni_dir_tls_test_args = [ |
| 564 | "-N", |
| 565 | "1000", |
| 566 | "-U", |
| 567 | "-X", |
| 568 | "-L", |
| 569 | self.loop0.local_ip4, |
| 570 | self.server_port, |
| 571 | ] |
Florin Coras | 4c45d6f | 2021-08-12 08:38:02 -0700 | [diff] [blame] | 572 | self.sapi_server_sock = "1" |
| 573 | self.sapi_client_sock = "2" |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 574 | |
| 575 | def test_vcl_thru_host_stack_tls_uni_dir(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 576 | """run VCL thru host stack uni-directional TLS test""" |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 577 | |
| 578 | self.timeout = self.client_uni_dir_tls_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 579 | self.thru_host_stack_test( |
| 580 | "vcl_test_server", |
| 581 | self.server_tls_args, |
| 582 | "vcl_test_client", |
| 583 | self.client_uni_dir_tls_test_args, |
| 584 | ) |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 585 | |
| 586 | def tearDown(self): |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 587 | self.thru_host_stack_tear_down() |
| 588 | super(VCLThruHostStackTLS, self).tearDown() |
| 589 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 590 | def show_commands_at_teardown(self): |
| 591 | self.logger.debug(self.vapi.cli("show app server")) |
| 592 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 593 | self.logger.debug(self.vapi.cli("show app mq")) |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 594 | |
Florin Coras | 8a14061 | 2019-02-18 22:39:39 -0800 | [diff] [blame] | 595 | |
Florin Coras | cec1b27 | 2021-05-06 12:46:04 -0700 | [diff] [blame] | 596 | class VCLThruHostStackDTLS(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 597 | """VCL Thru Host Stack DTLS""" |
Florin Coras | cec1b27 | 2021-05-06 12:46:04 -0700 | [diff] [blame] | 598 | |
| 599 | @classmethod |
| 600 | def setUpClass(cls): |
| 601 | super(VCLThruHostStackDTLS, cls).setUpClass() |
| 602 | |
| 603 | @classmethod |
| 604 | def tearDownClass(cls): |
| 605 | super(VCLThruHostStackDTLS, cls).tearDownClass() |
| 606 | |
| 607 | def setUp(self): |
| 608 | super(VCLThruHostStackDTLS, self).setUp() |
| 609 | |
| 610 | self.thru_host_stack_setup() |
| 611 | self.client_uni_dir_dtls_timeout = 20 |
Florin Coras | fb50bc3 | 2021-05-18 00:28:59 -0700 | [diff] [blame] | 612 | self.server_dtls_args = ["-p", "dtls", self.server_port] |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 613 | self.client_uni_dir_dtls_test_args = [ |
| 614 | "-N", |
| 615 | "1000", |
| 616 | "-U", |
| 617 | "-X", |
| 618 | "-p", |
| 619 | "dtls", |
| 620 | "-T 1400", |
| 621 | self.loop0.local_ip4, |
| 622 | self.server_port, |
| 623 | ] |
Florin Coras | cec1b27 | 2021-05-06 12:46:04 -0700 | [diff] [blame] | 624 | |
| 625 | def test_vcl_thru_host_stack_dtls_uni_dir(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 626 | """run VCL thru host stack uni-directional DTLS test""" |
Florin Coras | cec1b27 | 2021-05-06 12:46:04 -0700 | [diff] [blame] | 627 | |
| 628 | self.timeout = self.client_uni_dir_dtls_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 629 | self.thru_host_stack_test( |
| 630 | "vcl_test_server", |
| 631 | self.server_dtls_args, |
| 632 | "vcl_test_client", |
| 633 | self.client_uni_dir_dtls_test_args, |
| 634 | ) |
Florin Coras | cec1b27 | 2021-05-06 12:46:04 -0700 | [diff] [blame] | 635 | |
| 636 | def tearDown(self): |
| 637 | self.thru_host_stack_tear_down() |
| 638 | super(VCLThruHostStackDTLS, self).tearDown() |
| 639 | |
| 640 | def show_commands_at_teardown(self): |
| 641 | self.logger.debug(self.vapi.cli("show app server")) |
| 642 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 643 | self.logger.debug(self.vapi.cli("show app mq")) |
| 644 | |
| 645 | |
Florin Coras | debb352 | 2021-05-18 00:35:50 -0700 | [diff] [blame] | 646 | class VCLThruHostStackQUIC(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 647 | """VCL Thru Host Stack QUIC""" |
Florin Coras | debb352 | 2021-05-18 00:35:50 -0700 | [diff] [blame] | 648 | |
| 649 | @classmethod |
| 650 | def setUpClass(cls): |
| 651 | cls.extra_vpp_plugin_config.append("plugin quic_plugin.so { enable }") |
| 652 | super(VCLThruHostStackQUIC, cls).setUpClass() |
| 653 | |
| 654 | @classmethod |
| 655 | def tearDownClass(cls): |
| 656 | super(VCLThruHostStackQUIC, cls).tearDownClass() |
| 657 | |
| 658 | def setUp(self): |
| 659 | super(VCLThruHostStackQUIC, self).setUp() |
| 660 | |
| 661 | self.thru_host_stack_setup() |
| 662 | self.client_uni_dir_quic_timeout = 20 |
| 663 | self.server_quic_args = ["-p", "quic", self.server_port] |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 664 | self.client_uni_dir_quic_test_args = [ |
| 665 | "-N", |
| 666 | "1000", |
| 667 | "-U", |
| 668 | "-X", |
| 669 | "-p", |
| 670 | "quic", |
| 671 | self.loop0.local_ip4, |
| 672 | self.server_port, |
| 673 | ] |
Florin Coras | debb352 | 2021-05-18 00:35:50 -0700 | [diff] [blame] | 674 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 675 | @unittest.skipUnless(config.extended, "part of extended tests") |
Florin Coras | debb352 | 2021-05-18 00:35:50 -0700 | [diff] [blame] | 676 | def test_vcl_thru_host_stack_quic_uni_dir(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 677 | """run VCL thru host stack uni-directional QUIC test""" |
Florin Coras | debb352 | 2021-05-18 00:35:50 -0700 | [diff] [blame] | 678 | |
| 679 | self.timeout = self.client_uni_dir_quic_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 680 | self.thru_host_stack_test( |
| 681 | "vcl_test_server", |
| 682 | self.server_quic_args, |
| 683 | "vcl_test_client", |
| 684 | self.client_uni_dir_quic_test_args, |
| 685 | ) |
Florin Coras | debb352 | 2021-05-18 00:35:50 -0700 | [diff] [blame] | 686 | |
| 687 | def tearDown(self): |
| 688 | self.thru_host_stack_tear_down() |
| 689 | super(VCLThruHostStackQUIC, self).tearDown() |
| 690 | |
| 691 | def show_commands_at_teardown(self): |
| 692 | self.logger.debug(self.vapi.cli("show app server")) |
| 693 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 694 | self.logger.debug(self.vapi.cli("show app mq")) |
| 695 | |
| 696 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 697 | class VCLThruHostStackBidirNsock(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 698 | """VCL Thru Host Stack Bidir Nsock""" |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 699 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 700 | @classmethod |
| 701 | def setUpClass(cls): |
| 702 | super(VCLThruHostStackBidirNsock, cls).setUpClass() |
| 703 | |
| 704 | @classmethod |
| 705 | def tearDownClass(cls): |
| 706 | super(VCLThruHostStackBidirNsock, cls).tearDownClass() |
| 707 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 708 | def setUp(self): |
| 709 | super(VCLThruHostStackBidirNsock, self).setUp() |
| 710 | |
| 711 | self.thru_host_stack_setup() |
| 712 | self.client_bi_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 713 | self.client_bi_dir_nsock_test_args = [ |
| 714 | "-N", |
| 715 | "1000", |
| 716 | "-B", |
| 717 | "-X", |
| 718 | "-I", |
| 719 | "2", |
| 720 | self.loop0.local_ip4, |
| 721 | self.server_port, |
| 722 | ] |
| 723 | self.client_echo_test_args = [ |
| 724 | "-E", |
| 725 | self.echo_phrase, |
| 726 | "-X", |
| 727 | self.loop0.local_ip4, |
| 728 | self.server_port, |
| 729 | ] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 730 | |
| 731 | def tearDown(self): |
| 732 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 733 | super(VCLThruHostStackBidirNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 734 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 735 | def show_commands_at_teardown(self): |
| 736 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 737 | self.logger.debug(self.vapi.cli("show app mq")) |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 738 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 739 | def test_vcl_thru_host_stack_bi_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 740 | """run VCL thru host stack bi-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 741 | |
| 742 | self.timeout = self.client_bi_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 743 | self.thru_host_stack_test( |
| 744 | "vcl_test_server", |
| 745 | self.server_args, |
| 746 | "vcl_test_client", |
| 747 | self.client_bi_dir_nsock_test_args, |
| 748 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 749 | |
| 750 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 751 | class LDPThruHostStackBidirNsock(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 752 | """LDP Thru Host Stack Bidir Nsock""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 753 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 754 | @classmethod |
| 755 | def setUpClass(cls): |
| 756 | super(LDPThruHostStackBidirNsock, cls).setUpClass() |
| 757 | |
| 758 | @classmethod |
| 759 | def tearDownClass(cls): |
| 760 | super(LDPThruHostStackBidirNsock, cls).tearDownClass() |
| 761 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 762 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 763 | super(LDPThruHostStackBidirNsock, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 764 | |
| 765 | self.thru_host_stack_setup() |
Dave Wallace | 3102c38 | 2020-04-03 19:48:48 -0400 | [diff] [blame] | 766 | self.client_bi_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 767 | self.client_bi_dir_nsock_test_args = [ |
| 768 | "-N", |
| 769 | "1000", |
| 770 | "-B", |
| 771 | "-X", |
| 772 | # OUCH! Host Stack Bug? |
| 773 | # Only fails when running |
| 774 | # 'make test TEST_JOBS=auto' |
| 775 | # or TEST_JOBS > 1 |
| 776 | # "-I", "2", |
| 777 | self.loop0.local_ip4, |
| 778 | self.server_port, |
| 779 | ] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 780 | |
| 781 | def tearDown(self): |
| 782 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 783 | super(LDPThruHostStackBidirNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 784 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 785 | def show_commands_at_teardown(self): |
| 786 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 787 | self.logger.debug(self.vapi.cli("show app mq")) |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 788 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 789 | def test_ldp_thru_host_stack_bi_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 790 | """run LDP thru host stack bi-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 791 | |
| 792 | self.timeout = self.client_bi_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 793 | self.thru_host_stack_test( |
| 794 | "sock_test_server", |
| 795 | self.server_args, |
| 796 | "sock_test_client", |
| 797 | self.client_bi_dir_nsock_test_args, |
| 798 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 799 | |
| 800 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 801 | class LDPThruHostStackNsock(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 802 | """LDP Thru Host Stack Nsock""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 803 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 804 | @classmethod |
| 805 | def setUpClass(cls): |
| 806 | super(LDPThruHostStackNsock, cls).setUpClass() |
| 807 | |
| 808 | @classmethod |
| 809 | def tearDownClass(cls): |
| 810 | super(LDPThruHostStackNsock, cls).tearDownClass() |
| 811 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 812 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 813 | super(LDPThruHostStackNsock, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 814 | |
| 815 | self.thru_host_stack_setup() |
| 816 | if self.vppDebug: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 817 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 818 | self.numSockets = "2" |
| 819 | else: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 820 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 821 | self.numSockets = "5" |
| 822 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 823 | self.client_uni_dir_nsock_test_args = [ |
| 824 | "-N", |
| 825 | "1000", |
| 826 | "-U", |
| 827 | "-X", |
| 828 | "-I", |
| 829 | self.numSockets, |
| 830 | self.loop0.local_ip4, |
| 831 | self.server_port, |
| 832 | ] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 833 | |
| 834 | def tearDown(self): |
| 835 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 836 | super(LDPThruHostStackNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 837 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 838 | def test_ldp_thru_host_stack_uni_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 839 | """run LDP thru host stack uni-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 840 | |
| 841 | self.timeout = self.client_uni_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 842 | self.thru_host_stack_test( |
| 843 | "sock_test_server", |
| 844 | self.server_args, |
| 845 | "sock_test_client", |
| 846 | self.client_uni_dir_nsock_test_args, |
| 847 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 848 | |
| 849 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 850 | class VCLThruHostStackNsock(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 851 | """VCL Thru Host Stack Nsock""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 852 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 853 | @classmethod |
| 854 | def setUpClass(cls): |
| 855 | super(VCLThruHostStackNsock, cls).setUpClass() |
| 856 | |
| 857 | @classmethod |
| 858 | def tearDownClass(cls): |
| 859 | super(VCLThruHostStackNsock, cls).tearDownClass() |
| 860 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 861 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 862 | super(VCLThruHostStackNsock, self).setUp() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 863 | |
| 864 | self.thru_host_stack_setup() |
| 865 | if self.vppDebug: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 866 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 867 | self.numSockets = "2" |
| 868 | else: |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 869 | self.client_uni_dir_nsock_timeout = 20 |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 870 | self.numSockets = "5" |
| 871 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 872 | self.client_uni_dir_nsock_test_args = [ |
| 873 | "-N", |
| 874 | "1000", |
| 875 | "-U", |
| 876 | "-X", |
| 877 | "-I", |
| 878 | self.numSockets, |
| 879 | self.loop0.local_ip4, |
| 880 | self.server_port, |
| 881 | ] |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 882 | |
| 883 | def tearDown(self): |
| 884 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 885 | super(VCLThruHostStackNsock, self).tearDown() |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 886 | |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 887 | def test_vcl_thru_host_stack_uni_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 888 | """run VCL thru host stack uni-directional (multiple sockets) test""" |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 889 | |
| 890 | self.timeout = self.client_uni_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 891 | self.thru_host_stack_test( |
| 892 | "vcl_test_server", |
| 893 | self.server_args, |
| 894 | "vcl_test_client", |
| 895 | self.client_uni_dir_nsock_test_args, |
| 896 | ) |
Dave Wallace | d85075e | 2018-03-02 13:19:30 -0500 | [diff] [blame] | 897 | |
| 898 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 899 | class LDPThruHostStackIperf(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 900 | """LDP Thru Host Stack Iperf""" |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 901 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 902 | @classmethod |
| 903 | def setUpClass(cls): |
| 904 | super(LDPThruHostStackIperf, cls).setUpClass() |
| 905 | |
| 906 | @classmethod |
| 907 | def tearDownClass(cls): |
| 908 | super(LDPThruHostStackIperf, cls).tearDownClass() |
| 909 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 910 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 911 | super(LDPThruHostStackIperf, self).setUp() |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 912 | |
| 913 | self.thru_host_stack_setup() |
| 914 | self.client_iperf3_timeout = 20 |
Florin Coras | 1d87914 | 2021-05-06 00:08:18 -0700 | [diff] [blame] | 915 | self.client_iperf3_args = ["-4", "-t 2", "-c", self.loop0.local_ip4] |
| 916 | self.server_iperf3_args = ["-4", "-s"] |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 917 | |
| 918 | def tearDown(self): |
| 919 | self.thru_host_stack_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 920 | super(LDPThruHostStackIperf, self).tearDown() |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 921 | |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 922 | def show_commands_at_teardown(self): |
| 923 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 924 | self.logger.debug(self.vapi.cli("show app mq")) |
Paul Vinciguerra | 90cf21b | 2019-03-13 09:23:05 -0700 | [diff] [blame] | 925 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 926 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 927 | def test_ldp_thru_host_stack_iperf3(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 928 | """run LDP thru host stack iperf3 test""" |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 929 | |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 930 | self.timeout = self.client_iperf3_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 931 | self.thru_host_stack_test( |
| 932 | iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args |
| 933 | ) |
Dave Wallace | 816833f | 2018-03-14 20:01:28 -0400 | [diff] [blame] | 934 | |
| 935 | |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 936 | class LDPThruHostStackIperfUdp(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 937 | """LDP Thru Host Stack Iperf UDP""" |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 938 | |
| 939 | @classmethod |
| 940 | def setUpClass(cls): |
| 941 | super(LDPThruHostStackIperfUdp, cls).setUpClass() |
| 942 | |
| 943 | @classmethod |
| 944 | def tearDownClass(cls): |
| 945 | super(LDPThruHostStackIperfUdp, cls).tearDownClass() |
| 946 | |
| 947 | def setUp(self): |
| 948 | super(LDPThruHostStackIperfUdp, self).setUp() |
| 949 | |
| 950 | self.thru_host_stack_setup() |
| 951 | self.client_iperf3_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 952 | self.client_iperf3_args = [ |
| 953 | "-4", |
| 954 | "-t 2", |
| 955 | "-u", |
| 956 | "-l 1400", |
| 957 | "-c", |
| 958 | self.loop0.local_ip4, |
| 959 | ] |
Florin Coras | 1d87914 | 2021-05-06 00:08:18 -0700 | [diff] [blame] | 960 | self.server_iperf3_args = ["-4", "-s"] |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 961 | |
| 962 | def tearDown(self): |
| 963 | self.thru_host_stack_tear_down() |
| 964 | super(LDPThruHostStackIperfUdp, self).tearDown() |
| 965 | |
| 966 | def show_commands_at_teardown(self): |
| 967 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 968 | self.logger.debug(self.vapi.cli("show app mq")) |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 969 | |
| 970 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
| 971 | def test_ldp_thru_host_stack_iperf3_udp(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 972 | """run LDP thru host stack iperf3 UDP test""" |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 973 | |
| 974 | self.timeout = self.client_iperf3_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 975 | self.thru_host_stack_test( |
| 976 | iperf3, self.server_iperf3_args, iperf3, self.client_iperf3_args |
| 977 | ) |
Florin Coras | 57a5a2d | 2020-04-01 23:16:11 +0000 | [diff] [blame] | 978 | |
| 979 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 980 | class LDPIpv6CutThruTestCase(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 981 | """LDP IPv6 Cut Thru Tests""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 982 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 983 | @classmethod |
| 984 | def setUpClass(cls): |
| 985 | super(LDPIpv6CutThruTestCase, cls).setUpClass() |
| 986 | |
| 987 | @classmethod |
| 988 | def tearDownClass(cls): |
| 989 | super(LDPIpv6CutThruTestCase, cls).tearDownClass() |
| 990 | |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 991 | def show_commands_at_teardown(self): |
| 992 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 993 | self.logger.debug(self.vapi.cli("show app mq")) |
| 994 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 995 | def setUp(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 996 | super(LDPIpv6CutThruTestCase, self).setUp() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 997 | |
| 998 | self.cut_thru_setup() |
| 999 | self.client_iperf3_timeout = 20 |
Florin Coras | 2eb42e7 | 2018-11-29 00:39:53 -0800 | [diff] [blame] | 1000 | self.client_uni_dir_nsock_timeout = 20 |
| 1001 | self.client_bi_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1002 | self.client_ipv6_echo_test_args = [ |
| 1003 | "-6", |
| 1004 | "-E", |
| 1005 | self.echo_phrase, |
| 1006 | "-X", |
| 1007 | self.server_ipv6_addr, |
| 1008 | self.server_port, |
| 1009 | ] |
| 1010 | self.client_ipv6_iperf3_args = ["-6", "-t 2", "-c", self.server_ipv6_addr] |
Florin Coras | 1d87914 | 2021-05-06 00:08:18 -0700 | [diff] [blame] | 1011 | self.server_ipv6_iperf3_args = ["-6", "-s"] |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1012 | self.client_ipv6_uni_dir_nsock_test_args = [ |
| 1013 | "-N", |
| 1014 | "1000", |
| 1015 | "-U", |
| 1016 | "-X", |
| 1017 | "-6", |
| 1018 | "-I", |
| 1019 | "2", |
| 1020 | self.server_ipv6_addr, |
| 1021 | self.server_port, |
| 1022 | ] |
| 1023 | self.client_ipv6_bi_dir_nsock_test_args = [ |
| 1024 | "-N", |
| 1025 | "1000", |
| 1026 | "-B", |
| 1027 | "-X", |
| 1028 | "-6", |
| 1029 | "-I", |
| 1030 | "2", |
| 1031 | self.server_ipv6_addr, |
| 1032 | self.server_port, |
| 1033 | ] |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1034 | |
| 1035 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 1036 | super(LDPIpv6CutThruTestCase, self).tearDown() |
Paul Vinciguerra | 9673e3e | 2019-05-10 20:41:08 -0400 | [diff] [blame] | 1037 | self.cut_thru_tear_down() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1038 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 1039 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1040 | def test_ldp_ipv6_cut_thru_echo(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1041 | """run LDP IPv6 cut thru echo test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1042 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1043 | self.cut_thru_test( |
| 1044 | "sock_test_server", |
| 1045 | self.server_ipv6_args, |
| 1046 | "sock_test_client", |
| 1047 | self.client_ipv6_echo_test_args, |
| 1048 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1049 | |
Paul Vinciguerra | 063366e | 2019-06-30 15:38:55 -0400 | [diff] [blame] | 1050 | @unittest.skipUnless(_have_iperf3, "'%s' not found, Skipping.") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1051 | def test_ldp_ipv6_cut_thru_iperf3(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1052 | """run LDP IPv6 cut thru iperf3 test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1053 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1054 | self.timeout = self.client_iperf3_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1055 | self.cut_thru_test( |
| 1056 | iperf3, self.server_ipv6_iperf3_args, iperf3, self.client_ipv6_iperf3_args |
| 1057 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1058 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 1059 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1060 | def test_ldp_ipv6_cut_thru_uni_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1061 | """run LDP IPv6 cut thru uni-directional (multiple sockets) test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1062 | |
| 1063 | self.timeout = self.client_uni_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1064 | self.cut_thru_test( |
| 1065 | "sock_test_server", |
| 1066 | self.server_ipv6_args, |
| 1067 | "sock_test_client", |
| 1068 | self.client_ipv6_uni_dir_nsock_test_args, |
| 1069 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1070 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 1071 | @unittest.skipUnless(config.extended, "part of extended tests") |
Florin Coras | 0f46e16 | 2019-07-02 19:33:15 -0700 | [diff] [blame] | 1072 | @unittest.skip("sock test apps need to be improved") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1073 | def test_ldp_ipv6_cut_thru_bi_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1074 | """run LDP IPv6 cut thru bi-directional (multiple sockets) test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1075 | |
| 1076 | self.timeout = self.client_bi_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1077 | self.cut_thru_test( |
| 1078 | "sock_test_server", |
| 1079 | self.server_ipv6_args, |
| 1080 | "sock_test_client", |
| 1081 | self.client_ipv6_bi_dir_nsock_test_args, |
| 1082 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1083 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 1084 | |
| 1085 | class VCLIpv6CutThruTestCase(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1086 | """VCL IPv6 Cut Thru Tests""" |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 1087 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 1088 | @classmethod |
| 1089 | def setUpClass(cls): |
| 1090 | super(VCLIpv6CutThruTestCase, cls).setUpClass() |
| 1091 | |
| 1092 | @classmethod |
| 1093 | def tearDownClass(cls): |
| 1094 | super(VCLIpv6CutThruTestCase, cls).tearDownClass() |
| 1095 | |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 1096 | def show_commands_at_teardown(self): |
| 1097 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 1098 | self.logger.debug(self.vapi.cli("show app mq")) |
| 1099 | |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 1100 | def setUp(self): |
| 1101 | super(VCLIpv6CutThruTestCase, self).setUp() |
| 1102 | |
| 1103 | self.cut_thru_setup() |
| 1104 | self.client_uni_dir_nsock_timeout = 20 |
| 1105 | self.client_bi_dir_nsock_timeout = 20 |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1106 | self.client_ipv6_echo_test_args = [ |
| 1107 | "-6", |
| 1108 | "-E", |
| 1109 | self.echo_phrase, |
| 1110 | "-X", |
| 1111 | self.server_ipv6_addr, |
| 1112 | self.server_port, |
| 1113 | ] |
| 1114 | self.client_ipv6_uni_dir_nsock_test_args = [ |
| 1115 | "-N", |
| 1116 | "1000", |
| 1117 | "-U", |
| 1118 | "-X", |
| 1119 | "-6", |
| 1120 | "-I", |
| 1121 | "2", |
| 1122 | self.server_ipv6_addr, |
| 1123 | self.server_port, |
| 1124 | ] |
| 1125 | self.client_ipv6_bi_dir_nsock_test_args = [ |
| 1126 | "-N", |
| 1127 | "1000", |
| 1128 | "-B", |
| 1129 | "-X", |
| 1130 | "-6", |
| 1131 | "-I", |
| 1132 | "2", |
| 1133 | self.server_ipv6_addr, |
| 1134 | self.server_port, |
| 1135 | ] |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 1136 | |
| 1137 | def tearDown(self): |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 1138 | super(VCLIpv6CutThruTestCase, self).tearDown() |
Paul Vinciguerra | 9673e3e | 2019-05-10 20:41:08 -0400 | [diff] [blame] | 1139 | self.cut_thru_tear_down() |
Florin Coras | 0ae445e | 2018-11-29 18:22:10 -0800 | [diff] [blame] | 1140 | |
Florin Coras | 41d5f54 | 2021-01-15 13:49:33 -0800 | [diff] [blame] | 1141 | def show_commands_at_teardown(self): |
| 1142 | self.logger.debug(self.vapi.cli("show session verbose 2")) |
| 1143 | self.logger.debug(self.vapi.cli("show app mq")) |
| 1144 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1145 | def test_vcl_ipv6_cut_thru_echo(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1146 | """run VCL IPv6 cut thru echo test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1147 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1148 | self.cut_thru_test( |
| 1149 | "vcl_test_server", |
| 1150 | self.server_ipv6_args, |
| 1151 | "vcl_test_client", |
| 1152 | self.client_ipv6_echo_test_args, |
| 1153 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1154 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 1155 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1156 | def test_vcl_ipv6_cut_thru_uni_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1157 | """run VCL IPv6 cut thru uni-directional (multiple sockets) test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1158 | |
| 1159 | self.timeout = self.client_uni_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1160 | self.cut_thru_test( |
| 1161 | "vcl_test_server", |
| 1162 | self.server_ipv6_args, |
| 1163 | "vcl_test_client", |
| 1164 | self.client_ipv6_uni_dir_nsock_test_args, |
| 1165 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1166 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 1167 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1168 | def test_vcl_ipv6_cut_thru_bi_dir_nsock(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1169 | """run VCL IPv6 cut thru bi-directional (multiple sockets) test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1170 | |
| 1171 | self.timeout = self.client_bi_dir_nsock_timeout |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1172 | self.cut_thru_test( |
| 1173 | "vcl_test_server", |
| 1174 | self.server_ipv6_args, |
| 1175 | "vcl_test_client", |
| 1176 | self.client_ipv6_bi_dir_nsock_test_args, |
| 1177 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1178 | |
| 1179 | |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 1180 | class VCLIpv6ThruHostStackEcho(VCLTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1181 | """VCL IPv6 Thru Host Stack Echo""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1182 | |
Paul Vinciguerra | 8d991d9 | 2019-01-25 14:05:48 -0800 | [diff] [blame] | 1183 | @classmethod |
| 1184 | def setUpClass(cls): |
| 1185 | super(VCLIpv6ThruHostStackEcho, cls).setUpClass() |
| 1186 | |
| 1187 | @classmethod |
| 1188 | def tearDownClass(cls): |
| 1189 | super(VCLIpv6ThruHostStackEcho, cls).tearDownClass() |
| 1190 | |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1191 | def setUp(self): |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 1192 | super(VCLIpv6ThruHostStackEcho, self).setUp() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1193 | |
| 1194 | self.thru_host_stack_ipv6_setup() |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1195 | self.client_ipv6_echo_test_args = [ |
| 1196 | "-6", |
| 1197 | "-E", |
| 1198 | self.echo_phrase, |
| 1199 | "-X", |
| 1200 | self.loop0.local_ip6, |
| 1201 | self.server_port, |
| 1202 | ] |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1203 | |
| 1204 | def tearDown(self): |
| 1205 | self.thru_host_stack_ipv6_tear_down() |
Florin Coras | dc2e251 | 2018-12-03 17:47:26 -0800 | [diff] [blame] | 1206 | super(VCLIpv6ThruHostStackEcho, self).tearDown() |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1207 | |
| 1208 | def test_vcl_ipv6_thru_host_stack_echo(self): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1209 | """run VCL IPv6 thru host stack echo test""" |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1210 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1211 | self.thru_host_stack_test( |
| 1212 | "vcl_test_server", |
| 1213 | self.server_ipv6_args, |
| 1214 | "vcl_test_client", |
| 1215 | self.client_ipv6_echo_test_args, |
| 1216 | ) |
Dave Wallace | de91006 | 2018-03-20 09:22:13 -0400 | [diff] [blame] | 1217 | |
| 1218 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 1219 | if __name__ == "__main__": |
Dave Wallace | cfcf2f4 | 2018-02-16 18:31:56 -0500 | [diff] [blame] | 1220 | unittest.main(testRunner=VppTestRunner) |