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