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