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