blob: 6651d74d036c8edaf9d305794513afef799d13a4 [file] [log] [blame]
Renato Botelho do Coutoead1e532019-10-31 13:31:07 -05001#!/usr/bin/env python3
Dave Wallace3bffd4b2019-05-13 15:51:52 -04002""" Vpp QUIC tests """
Dave Wallaceb063ad02019-04-09 21:01:09 -04003
4import unittest
Dave Wallace211b28a2019-05-08 20:46:33 -04005import os
Dave Wallace3bffd4b2019-05-13 15:51:52 -04006import subprocess
7import signal
Klement Sekerab23ffd72021-05-31 16:08:53 +02008from config import config
Andrew Yourtchenko8dc0d482021-01-29 13:17:19 +00009from framework import tag_fixme_vpp_workers
Klement Sekerab23ffd72021-05-31 16:08:53 +020010from framework import VppTestCase, VppTestRunner, Worker
Dave Wallaceb063ad02019-04-09 21:01:09 -040011from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath
12
13
Dave Wallace3bffd4b2019-05-13 15:51:52 -040014class QUICAppWorker(Worker):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020015 """QUIC Test Application Worker"""
16
Dave Wallace47e77302019-06-05 10:40:07 -040017 process = None
Dave Wallace3bffd4b2019-05-13 15:51:52 -040018
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020019 def __init__(
20 self,
21 appname,
22 executable_args,
23 logger,
24 role,
25 testcase,
26 env=None,
27 *args,
28 **kwargs,
29 ):
Paul Vinciguerra48bdbcd2019-12-04 19:43:53 -050030 if env is None:
31 env = {}
Klement Sekerab23ffd72021-05-31 16:08:53 +020032 app = f"{config.vpp_build_dir}/vpp/bin/{appname}"
Paul Vinciguerra48bdbcd2019-12-04 19:43:53 -050033 self.args = [app] + executable_args
Dave Wallace91af1852019-10-21 03:28:17 +000034 self.role = role
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020035 self.wait_for_gdb = "wait-for-gdb"
Dave Wallace91af1852019-10-21 03:28:17 +000036 self.testcase = testcase
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020037 super(QUICAppWorker, self).__init__(self.args, logger, env, *args, **kwargs)
Dave Wallace3bffd4b2019-05-13 15:51:52 -040038
Dave Wallace47e77302019-06-05 10:40:07 -040039 def run(self):
40 super(QUICAppWorker, self).run()
Dave Wallace47e77302019-06-05 10:40:07 -040041
42 def teardown(self, logger, timeout):
43 if self.process is None:
Chore464e1dc2019-06-25 14:21:26 +043044 return False
Dave Wallace47e77302019-06-05 10:40:07 -040045 try:
46 logger.debug("Killing worker process (pid %d)" % self.process.pid)
47 os.killpg(os.getpgid(self.process.pid), signal.SIGKILL)
48 self.join(timeout)
49 except OSError as e:
50 logger.debug("Couldn't kill worker process")
51 return True
52 return False
53
Dave Wallace3bffd4b2019-05-13 15:51:52 -040054
Dave Wallace211b28a2019-05-08 20:46:33 -040055class QUICTestCase(VppTestCase):
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020056 """QUIC Test Case"""
Paul Vinciguerra1063f2a2019-12-04 23:18:02 -050057
58 timeout = 20
59 pre_test_sleep = 0.3
Dave Wallace3ce03522020-01-27 18:21:15 -050060 post_test_sleep = 0.3
Paul Vinciguerra1063f2a2019-12-04 23:18:02 -050061
Aloys Augustinbaf1c7c2019-09-02 16:29:19 +020062 @classmethod
63 def setUpClass(cls):
64 cls.extra_vpp_plugin_config.append("plugin quic_plugin.so { enable }")
65 super(QUICTestCase, cls).setUpClass()
Dave Wallaceb063ad02019-04-09 21:01:09 -040066
Dave Wallaceb063ad02019-04-09 21:01:09 -040067 def setUp(self):
Dave Wallace47e77302019-06-05 10:40:07 -040068 super(QUICTestCase, self).setUp()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020069 self.vppDebug = "vpp_debug" in config.vpp_build_dir
Dave Wallace211b28a2019-05-08 20:46:33 -040070
Dave Wallaceb063ad02019-04-09 21:01:09 -040071 self.create_loopback_interfaces(2)
Dave Wallace211b28a2019-05-08 20:46:33 -040072 self.uri = "quic://%s/1234" % self.loop0.local_ip4
Dave Wallaceb063ad02019-04-09 21:01:09 -040073 table_id = 1
Dave Wallaceb063ad02019-04-09 21:01:09 -040074 for i in self.lo_interfaces:
75 i.admin_up()
76
77 if table_id != 0:
78 tbl = VppIpTable(self, table_id)
79 tbl.add_vpp_config()
80
81 i.set_table_ip4(table_id)
82 i.config_ip4()
83 table_id += 1
84
85 # Configure namespaces
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020086 self.vapi.app_namespace_add_del(
87 namespace_id="server", sw_if_index=self.loop0.sw_if_index
88 )
89 self.vapi.app_namespace_add_del(
90 namespace_id="client", sw_if_index=self.loop1.sw_if_index
91 )
Dave Wallaceb063ad02019-04-09 21:01:09 -040092
Dave Wallace211b28a2019-05-08 20:46:33 -040093 # Add inter-table routes
Klement Sekerad9b0c6f2022-04-26 19:02:15 +020094 self.ip_t01 = VppIpRoute(
95 self,
96 self.loop1.local_ip4,
97 32,
98 [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=2)],
99 table_id=1,
100 )
101 self.ip_t10 = VppIpRoute(
102 self,
103 self.loop0.local_ip4,
104 32,
105 [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=1)],
106 table_id=2,
107 )
Dave Wallace211b28a2019-05-08 20:46:33 -0400108 self.ip_t01.add_vpp_config()
109 self.ip_t10.add_vpp_config()
110 self.logger.debug(self.vapi.cli("show ip fib"))
111
Dave Wallace47e77302019-06-05 10:40:07 -0400112 def tearDown(self):
Dave Wallace211b28a2019-05-08 20:46:33 -0400113 # Delete inter-table routes
114 self.ip_t01.remove_vpp_config()
115 self.ip_t10.remove_vpp_config()
116
Dave Wallaceb063ad02019-04-09 21:01:09 -0400117 for i in self.lo_interfaces:
118 i.unconfig_ip4()
119 i.set_table_ip4(0)
120 i.admin_down()
Dave Wallace47e77302019-06-05 10:40:07 -0400121 super(QUICTestCase, self).tearDown()
Dave Wallace3bffd4b2019-05-13 15:51:52 -0400122
Dave Wallace211b28a2019-05-08 20:46:33 -0400123
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000124class QUICEchoIntTestCase(QUICTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400125 """QUIC Echo Internal Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200126
127 test_bytes = " test-bytes"
Florin Corase92c9462020-11-25 08:44:16 -0800128 extra_vpp_punt_config = ["session", "{", "enable", "poll-main", "}"]
Chore464e1dc2019-06-25 14:21:26 +0430129
Dave Wallace211b28a2019-05-08 20:46:33 -0400130 def setUp(self):
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000131 super(QUICEchoIntTestCase, self).setUp()
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200132 self.client_args = "uri {uri} fifo-size 64{testbytes} appns client".format(
133 uri=self.uri, testbytes=self.test_bytes
134 )
Dave Wallace47e77302019-06-05 10:40:07 -0400135 self.server_args = "uri %s fifo-size 64 appns server" % self.uri
Dave Wallace211b28a2019-05-08 20:46:33 -0400136
Dave Wallace3ce03522020-01-27 18:21:15 -0500137 def tearDown(self):
138 super(QUICEchoIntTestCase, self).tearDown()
139
Dave Wallace47e77302019-06-05 10:40:07 -0400140 def server(self, *args):
Chore464e1dc2019-06-25 14:21:26 +0430141 error = self.vapi.cli(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200142 "test echo server %s %s" % (self.server_args, " ".join(args))
143 )
Dave Wallace47e77302019-06-05 10:40:07 -0400144 if error:
145 self.logger.critical(error)
146 self.assertNotIn("failed", error)
Dave Wallace211b28a2019-05-08 20:46:33 -0400147
Dave Wallace47e77302019-06-05 10:40:07 -0400148 def client(self, *args):
Chore464e1dc2019-06-25 14:21:26 +0430149 error = self.vapi.cli(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200150 "test echo client %s %s" % (self.client_args, " ".join(args))
151 )
Dave Wallace47e77302019-06-05 10:40:07 -0400152 if error:
153 self.logger.critical(error)
154 self.assertNotIn("failed", error)
Dave Wallaceb063ad02019-04-09 21:01:09 -0400155
Chore464e1dc2019-06-25 14:21:26 +0430156
Andrew Yourtchenko8dc0d482021-01-29 13:17:19 +0000157@tag_fixme_vpp_workers
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000158class QUICEchoIntTransferTestCase(QUICEchoIntTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400159 """QUIC Echo Internal Transfer Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200160
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000161 def test_quic_int_transfer(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000162 """QUIC internal transfer"""
Dave Wallace47e77302019-06-05 10:40:07 -0400163 self.server()
Aloys Augustin706079c2019-06-27 16:10:23 +0200164 self.client("no-output", "mbytes", "2")
Dave Wallaceb063ad02019-04-09 21:01:09 -0400165
Chore464e1dc2019-06-25 14:21:26 +0430166
Andrew Yourtchenko8dc0d482021-01-29 13:17:19 +0000167@tag_fixme_vpp_workers
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000168class QUICEchoIntSerialTestCase(QUICEchoIntTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400169 """QUIC Echo Internal Serial Transfer Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200170
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000171 def test_quic_serial_int_transfer(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000172 """QUIC serial internal transfer"""
Dave Wallace47e77302019-06-05 10:40:07 -0400173 self.server()
Aloys Augustin706079c2019-06-27 16:10:23 +0200174 self.client("no-output", "mbytes", "2")
175 self.client("no-output", "mbytes", "2")
176 self.client("no-output", "mbytes", "2")
177 self.client("no-output", "mbytes", "2")
178 self.client("no-output", "mbytes", "2")
Dave Wallace0d144c72019-05-15 21:41:23 -0400179
Chore464e1dc2019-06-25 14:21:26 +0430180
Andrew Yourtchenko8dc0d482021-01-29 13:17:19 +0000181@tag_fixme_vpp_workers
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000182class QUICEchoIntMStreamTestCase(QUICEchoIntTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400183 """QUIC Echo Internal MultiStream Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200184
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000185 def test_quic_int_multistream_transfer(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000186 """QUIC internal multi-stream transfer"""
Dave Wallace47e77302019-06-05 10:40:07 -0400187 self.server()
188 self.client("nclients", "10", "mbytes", "1", "no-output")
Dave Wallace3bffd4b2019-05-13 15:51:52 -0400189
190
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000191class QUICEchoExtTestCase(QUICTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400192 quic_setup = "default"
Dave Wallace3ad078d2019-10-21 22:45:23 +0000193 test_bytes = "test-bytes:assert"
Dave Wallace3ce03522020-01-27 18:21:15 -0500194 pre_test_sleep = 1
195 post_test_sleep = 1
Dave Wallace91af1852019-10-21 03:28:17 +0000196 app = "vpp_echo"
Dave Wallace3ce03522020-01-27 18:21:15 -0500197 evt_q_len = 16384
Klement Sekera8d815022021-03-15 16:58:10 +0100198 vpp_worker_count = 1
Dave Wallace3ce03522020-01-27 18:21:15 -0500199 server_fifo_size = "1M"
200 client_fifo_size = "4M"
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200201 extra_vpp_punt_config = [
202 "session",
203 "{",
204 "enable",
205 "poll-main",
206 "evt_qs_memfd_seg",
Florin Corascf5c7742022-06-28 14:34:45 -0700207 "wrk-mqs-segment-size",
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200208 "64M",
209 "event-queue-length",
210 f"{evt_q_len}",
211 "preallocated-sessions",
212 "1024",
213 "v4-session-table-buckets",
214 "20000",
215 "v4-session-table-memory",
216 "64M",
217 "v4-halfopen-table-buckets",
218 "20000",
219 "v4-halfopen-table-memory",
220 "64M",
221 "local-endpoints-table-buckets",
222 "250000",
223 "local-endpoints-table-memory",
224 "512M",
225 "}",
226 ]
Dave Wallace3bffd4b2019-05-13 15:51:52 -0400227
228 def setUp(self):
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000229 super(QUICEchoExtTestCase, self).setUp()
Chore464e1dc2019-06-25 14:21:26 +0430230 common_args = [
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200231 "uri",
232 self.uri,
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000233 "json",
Dave Wallace3ad078d2019-10-21 22:45:23 +0000234 self.test_bytes,
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200235 "socket-name",
236 self.get_api_sock_path(),
237 "quic-setup",
238 self.quic_setup,
239 "nthreads",
240 "1",
241 "mq-size",
242 f"{self.evt_q_len}",
Dave Wallace3ce03522020-01-27 18:21:15 -0500243 ]
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200244 self.server_echo_test_args = common_args + [
245 "server",
246 "appns",
247 "server",
248 "fifo-size",
249 f"{self.server_fifo_size}",
250 ]
251 self.client_echo_test_args = common_args + [
252 "client",
253 "appns",
254 "client",
255 "fifo-size",
256 f"{self.client_fifo_size}",
257 ]
Dave Wallacef9d784b2019-10-30 16:58:30 +0000258 error = self.vapi.cli("quic set fifo-size 2M")
Dave Wallace91af1852019-10-21 03:28:17 +0000259 if error:
260 self.logger.critical(error)
261 self.assertNotIn("failed", error)
Dave Wallace3bffd4b2019-05-13 15:51:52 -0400262
Dave Wallace47e77302019-06-05 10:40:07 -0400263 def server(self, *args):
264 _args = self.server_echo_test_args + list(args)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200265 self.worker_server = QUICAppWorker(self.app, _args, self.logger, "server", self)
Dave Wallace47e77302019-06-05 10:40:07 -0400266 self.worker_server.start()
267 self.sleep(self.pre_test_sleep)
Dave Wallace3bffd4b2019-05-13 15:51:52 -0400268
Dave Wallace47e77302019-06-05 10:40:07 -0400269 def client(self, *args):
270 _args = self.client_echo_test_args + list(args)
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200271 self.worker_client = QUICAppWorker(self.app, _args, self.logger, "client", self)
Dave Wallace47e77302019-06-05 10:40:07 -0400272 self.worker_client.start()
Dave Wallace91af1852019-10-21 03:28:17 +0000273 timeout = None if self.debug_all else self.timeout
274 self.worker_client.join(timeout)
Dave Wallace3ce03522020-01-27 18:21:15 -0500275 if self.worker_client.is_alive():
276 error = f"Client failed to complete in {timeout} seconds!"
277 self.logger.critical(error)
278 return
Dave Wallace91af1852019-10-21 03:28:17 +0000279 self.worker_server.join(timeout)
Dave Wallace3ce03522020-01-27 18:21:15 -0500280 if self.worker_server.is_alive():
281 error = f"Server failed to complete in {timeout} seconds!"
282 self.logger.critical(error)
Dave Wallace47e77302019-06-05 10:40:07 -0400283 self.sleep(self.post_test_sleep)
Dave Wallace3bffd4b2019-05-13 15:51:52 -0400284
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000285 def validate_ext_test_results(self):
Dave Wallace47e77302019-06-05 10:40:07 -0400286 server_result = self.worker_server.result
287 client_result = self.worker_client.result
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200288 self.logger.info("Server worker result is `%s'" % server_result)
289 self.logger.info("Client worker result is `%s'" % client_result)
Dave Wallace47e77302019-06-05 10:40:07 -0400290 server_kill_error = False
291 if self.worker_server.result is None:
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200292 server_kill_error = self.worker_server.teardown(self.logger, self.timeout)
Dave Wallace47e77302019-06-05 10:40:07 -0400293 if self.worker_client.result is None:
294 self.worker_client.teardown(self.logger, self.timeout)
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000295 err_msg = "Wrong server worker return code (%s)" % server_result
296 self.assertEqual(server_result, 0, err_msg)
Chore464e1dc2019-06-25 14:21:26 +0430297 self.assertIsNotNone(
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200298 client_result, "Timeout! Client worker did not finish in %ss" % self.timeout
299 )
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000300 err_msg = "Wrong client worker return code (%s)" % client_result
301 self.assertEqual(client_result, 0, err_msg)
Dave Wallace47e77302019-06-05 10:40:07 -0400302 self.assertFalse(server_kill_error, "Server kill errored")
303
304
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000305class QUICEchoExtTransferTestCase(QUICEchoExtTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400306 """QUIC Echo External Transfer Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200307
Paul Vinciguerra1063f2a2019-12-04 23:18:02 -0500308 timeout = 60
309
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000310 def test_quic_ext_transfer(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000311 """QUIC external transfer"""
Dave Wallace47e77302019-06-05 10:40:07 -0400312 self.server()
313 self.client()
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000314 self.validate_ext_test_results()
Dave Wallace3bffd4b2019-05-13 15:51:52 -0400315
Chore464e1dc2019-06-25 14:21:26 +0430316
Dave Wallace3ad078d2019-10-21 22:45:23 +0000317class QUICEchoExtTransferBigTestCase(QUICEchoExtTestCase):
318 """QUIC Echo External Transfer Big Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200319
320 server_fifo_size = "4M"
321 client_fifo_size = "4M"
322 test_bytes = ""
Paul Vinciguerra1063f2a2019-12-04 23:18:02 -0500323 timeout = 60
Dave Wallace3ad078d2019-10-21 22:45:23 +0000324
Klement Sekerab23ffd72021-05-31 16:08:53 +0200325 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace3ad078d2019-10-21 22:45:23 +0000326 def test_quic_ext_transfer_big(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000327 """QUIC external transfer, big stream"""
Dave Wallace2edff142020-02-07 17:55:53 -0500328 self.server("TX=0", "RX=2G")
329 self.client("TX=2G", "RX=0")
Dave Wallace3ad078d2019-10-21 22:45:23 +0000330 self.validate_ext_test_results()
331
332
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000333class QUICEchoExtQcloseRxTestCase(QUICEchoExtTestCase):
334 """QUIC Echo External Transfer Qclose Rx Test Case"""
335
Klement Sekerab23ffd72021-05-31 16:08:53 +0200336 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500337 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000338 def test_quic_ext_qclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000339 """QUIC external transfer, rx close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500340 self.server("TX=0", "RX=10M", "qclose=Y", "sclose=N")
341 self.client("TX=10M", "RX=0", "qclose=W", "sclose=W")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000342 self.validate_ext_test_results()
343
344
345class QUICEchoExtQcloseTxTestCase(QUICEchoExtTestCase):
346 """QUIC Echo External Transfer Qclose Tx Test Case"""
347
Klement Sekerab23ffd72021-05-31 16:08:53 +0200348 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500349 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000350 def test_quic_ext_qclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000351 """QUIC external transfer, tx close"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200352 self.server("TX=0", "RX=10M", "qclose=W", "sclose=W", "rx-results-diff")
Dave Wallace3ce03522020-01-27 18:21:15 -0500353 self.client("TX=10M", "RX=0", "qclose=Y", "sclose=N")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000354 self.validate_ext_test_results()
355
356
357class QUICEchoExtEarlyQcloseRxTestCase(QUICEchoExtTestCase):
358 """QUIC Echo External Transfer Early Qclose Rx Test Case"""
359
Klement Sekerab23ffd72021-05-31 16:08:53 +0200360 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500361 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000362 def test_quic_ext_early_qclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000363 """QUIC external transfer, early rx close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500364 self.server("TX=0", "RX=10M", "qclose=Y", "sclose=N")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200365 self.client("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000366 self.validate_ext_test_results()
367
368
369class QUICEchoExtEarlyQcloseTxTestCase(QUICEchoExtTestCase):
370 """QUIC Echo External Transfer Early Qclose Tx Test Case"""
371
Klement Sekerab23ffd72021-05-31 16:08:53 +0200372 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500373 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000374 def test_quic_ext_early_qclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000375 """QUIC external transfer, early tx close"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200376 self.server("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff")
Dave Wallace3ce03522020-01-27 18:21:15 -0500377 self.client("TX=10M", "RX=0", "qclose=Y", "sclose=N")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000378 self.validate_ext_test_results()
379
380
381class QUICEchoExtScloseRxTestCase(QUICEchoExtTestCase):
382 """QUIC Echo External Transfer Sclose Rx Test Case"""
383
Klement Sekerab23ffd72021-05-31 16:08:53 +0200384 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500385 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000386 def test_quic_ext_sclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000387 """QUIC external transfer, rx stream close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500388 self.server("TX=0", "RX=10M", "qclose=N", "sclose=Y")
389 self.client("TX=10M", "RX=0", "qclose=W", "sclose=W")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000390 self.validate_ext_test_results()
391
392
393class QUICEchoExtScloseTxTestCase(QUICEchoExtTestCase):
394 """QUIC Echo External Transfer Sclose Tx Test Case"""
395
Klement Sekerab23ffd72021-05-31 16:08:53 +0200396 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500397 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000398 def test_quic_ext_sclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000399 """QUIC external transfer, tx stream close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500400 self.server("TX=0", "RX=10M", "qclose=W", "sclose=W")
401 self.client("TX=10M", "RX=0", "qclose=Y", "sclose=Y")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000402 self.validate_ext_test_results()
403
404
405class QUICEchoExtEarlyScloseRxTestCase(QUICEchoExtTestCase):
406 """QUIC Echo External Transfer Early Sclose Rx Test Case"""
407
Klement Sekerab23ffd72021-05-31 16:08:53 +0200408 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500409 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000410 def test_quic_ext_early_sclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000411 """QUIC external transfer, early rx stream close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500412 self.server("TX=0", "RX=10M", "qclose=N", "sclose=Y")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200413 self.client("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000414 self.validate_ext_test_results()
415
416
417class QUICEchoExtEarlyScloseTxTestCase(QUICEchoExtTestCase):
Dave Wallaceff5a9b62019-09-25 17:58:24 -0400418 """QUIC Echo External Transfer Early Sclose Tx Test Case"""
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000419
Klement Sekerab23ffd72021-05-31 16:08:53 +0200420 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500421 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000422 def test_quic_ext_early_sclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000423 """QUIC external transfer, early tx stream close"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200424 self.server("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff")
Dave Wallace3ce03522020-01-27 18:21:15 -0500425 self.client("TX=10M", "RX=0", "qclose=Y", "sclose=Y")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000426 self.validate_ext_test_results()
427
428
429class QUICEchoExtServerStreamTestCase(QUICEchoExtTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400430 """QUIC Echo External Transfer Server Stream Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200431
Dave Wallace47e77302019-06-05 10:40:07 -0400432 quic_setup = "serverstream"
Dave Wallace3ce03522020-01-27 18:21:15 -0500433 timeout = 60
Dave Wallace47e77302019-06-05 10:40:07 -0400434
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000435 def test_quic_ext_transfer_server_stream(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000436 """QUIC external server transfer"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500437 self.server("TX=10M", "RX=0")
438 self.client("TX=0", "RX=10M")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000439 self.validate_ext_test_results()
Dave Wallace47e77302019-06-05 10:40:07 -0400440
Chore464e1dc2019-06-25 14:21:26 +0430441
Dave Wallace3ce03522020-01-27 18:21:15 -0500442class QUICEchoExtServerStreamBigTestCase(QUICEchoExtTestCase):
443 """QUIC Echo External Transfer Server Stream Big Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200444
Dave Wallace3ad078d2019-10-21 22:45:23 +0000445 quic_setup = "serverstream"
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200446 server_fifo_size = "4M"
447 client_fifo_size = "4M"
448 test_bytes = ""
Dave Wallace3ce03522020-01-27 18:21:15 -0500449 timeout = 60
Dave Wallace3ad078d2019-10-21 22:45:23 +0000450
Klement Sekerab23ffd72021-05-31 16:08:53 +0200451 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace3ce03522020-01-27 18:21:15 -0500452 def test_quic_ext_transfer_server_stream_big(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000453 """QUIC external server transfer, big stream"""
Dave Wallace2edff142020-02-07 17:55:53 -0500454 self.server("TX=2G", "RX=0")
455 self.client("TX=0", "RX=2G")
Dave Wallace3ad078d2019-10-21 22:45:23 +0000456 self.validate_ext_test_results()
457
458
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000459class QUICEchoExtServerStreamQcloseRxTestCase(QUICEchoExtTestCase):
460 """QUIC Echo External Transfer Server Stream Qclose Rx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200461
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000462 quic_setup = "serverstream"
463
Klement Sekerab23ffd72021-05-31 16:08:53 +0200464 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500465 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000466 def test_quic_ext_server_stream_qclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000467 """QUIC external server transfer, rx close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500468 self.server("TX=10M", "RX=0", "qclose=W", "sclose=W")
469 self.client("TX=0", "RX=10M", "qclose=Y", "sclose=N")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000470 self.validate_ext_test_results()
471
472
473class QUICEchoExtServerStreamQcloseTxTestCase(QUICEchoExtTestCase):
474 """QUIC Echo External Transfer Server Stream Qclose Tx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200475
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000476 quic_setup = "serverstream"
477
Klement Sekerab23ffd72021-05-31 16:08:53 +0200478 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500479 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000480 def test_quic_ext_server_stream_qclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000481 """QUIC external server transfer, tx close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500482 self.server("TX=10M", "RX=0", "qclose=Y", "sclose=N")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200483 self.client("TX=0", "RX=10M", "qclose=W", "sclose=W", "rx-results-diff")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000484 self.validate_ext_test_results()
485
486
487class QUICEchoExtServerStreamEarlyQcloseRxTestCase(QUICEchoExtTestCase):
488 """QUIC Echo External Transfer Server Stream Early Qclose Rx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200489
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000490 quic_setup = "serverstream"
491
Klement Sekerab23ffd72021-05-31 16:08:53 +0200492 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500493 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000494 def test_quic_ext_server_stream_early_qclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000495 """QUIC external server transfer, early rx close"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200496 self.server("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff")
Dave Wallace3ce03522020-01-27 18:21:15 -0500497 self.client("TX=0", "RX=10M", "qclose=Y", "sclose=N")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000498 self.validate_ext_test_results()
499
500
501class QUICEchoExtServerStreamEarlyQcloseTxTestCase(QUICEchoExtTestCase):
502 """QUIC Echo External Transfer Server Stream Early Qclose Tx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200503
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000504 quic_setup = "serverstream"
505
Klement Sekerab23ffd72021-05-31 16:08:53 +0200506 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500507 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000508 def test_quic_ext_server_stream_early_qclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000509 """QUIC external server transfer, early tx close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500510 self.server("TX=10M", "RX=0", "qclose=Y", "sclose=N")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200511 self.client("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000512 self.validate_ext_test_results()
513
514
515class QUICEchoExtServerStreamScloseRxTestCase(QUICEchoExtTestCase):
516 """QUIC Echo External Transfer Server Stream Sclose Rx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200517
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000518 quic_setup = "serverstream"
519
Klement Sekerab23ffd72021-05-31 16:08:53 +0200520 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500521 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000522 def test_quic_ext_server_stream_sclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000523 """QUIC external server transfer, rx stream close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500524 self.server("TX=10M", "RX=0", "qclose=W", "sclose=W")
525 self.client("TX=0", "RX=10M", "qclose=N", "sclose=Y")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000526 self.validate_ext_test_results()
527
528
529class QUICEchoExtServerStreamScloseTxTestCase(QUICEchoExtTestCase):
530 """QUIC Echo External Transfer Server Stream Sclose Tx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200531
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000532 quic_setup = "serverstream"
533
Klement Sekerab23ffd72021-05-31 16:08:53 +0200534 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500535 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000536 def test_quic_ext_server_stream_sclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000537 """QUIC external server transfer, tx stream close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500538 self.server("TX=10M", "RX=0", "qclose=Y", "sclose=Y")
539 self.client("TX=0", "RX=10M", "qclose=W", "sclose=W")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000540 self.validate_ext_test_results()
541
542
543class QUICEchoExtServerStreamEarlyScloseRxTestCase(QUICEchoExtTestCase):
544 """QUIC Echo External Transfer Server Stream Early Sclose Rx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200545
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000546 quic_setup = "serverstream"
547
Klement Sekerab23ffd72021-05-31 16:08:53 +0200548 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500549 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000550 def test_quic_ext_server_stream_early_sclose_rx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000551 """QUIC external server transfer, early rx stream close"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200552 self.server("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff")
Dave Wallace3ce03522020-01-27 18:21:15 -0500553 self.client("TX=0", "RX=10M", "qclose=N", "sclose=Y")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000554 self.validate_ext_test_results()
555
556
557class QUICEchoExtServerStreamEarlyScloseTxTestCase(QUICEchoExtTestCase):
558 """QUIC Echo Ext Transfer Server Stream Early Sclose Tx Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200559
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000560 quic_setup = "serverstream"
561
Klement Sekerab23ffd72021-05-31 16:08:53 +0200562 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500563 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000564 def test_quic_ext_server_stream_early_sclose_tx(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000565 """QUIC external server transfer, early tx stream close"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500566 self.server("TX=10M", "RX=0", "qclose=Y", "sclose=Y")
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200567 self.client("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000568 self.validate_ext_test_results()
569
570
571class QUICEchoExtServerStreamWorkersTestCase(QUICEchoExtTestCase):
Dave Wallace47e77302019-06-05 10:40:07 -0400572 """QUIC Echo External Transfer Server Stream MultiWorker Test Case"""
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200573
Dave Wallace47e77302019-06-05 10:40:07 -0400574 quic_setup = "serverstream"
575
Klement Sekerab23ffd72021-05-31 16:08:53 +0200576 @unittest.skipUnless(config.extended, "part of extended tests")
Dave Wallace2edff142020-02-07 17:55:53 -0500577 @unittest.skip("testcase under development")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000578 def test_quic_ext_transfer_server_stream_multi_workers(self):
Dave Wallace03ec1342020-05-05 19:45:10 +0000579 """QUIC external server transfer, multi-worker"""
Dave Wallace3ce03522020-01-27 18:21:15 -0500580 self.server("nclients", "4", "quic-streams", "4", "TX=10M", "RX=0")
581 self.client("nclients", "4", "quic-streams", "4", "TX=0", "RX=10M")
Dave Wallace83c1e9a2019-09-21 04:19:26 +0000582 self.validate_ext_test_results()
Dave Wallace211b28a2019-05-08 20:46:33 -0400583
Dave Wallaceb063ad02019-04-09 21:01:09 -0400584
Klement Sekerad9b0c6f2022-04-26 19:02:15 +0200585if __name__ == "__main__":
Dave Wallaceb063ad02019-04-09 21:01:09 -0400586 unittest.main(testRunner=VppTestRunner)