Renato Botelho do Couto | ead1e53 | 2019-10-31 13:31:07 -0500 | [diff] [blame] | 1 | #!/usr/bin/env python3 |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 2 | """ Vpp QUIC tests """ |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 3 | |
| 4 | import unittest |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 5 | import os |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 6 | import signal |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 7 | from config import config |
Dave Wallace | 8800f73 | 2023-08-31 00:47:44 -0400 | [diff] [blame] | 8 | from asfframework import VppAsfTestCase, VppTestRunner, Worker, tag_fixme_vpp_workers |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 9 | from vpp_ip_route import VppIpTable, VppIpRoute, VppRoutePath |
| 10 | |
| 11 | |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 12 | class QUICAppWorker(Worker): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 13 | """QUIC Test Application Worker""" |
| 14 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 15 | process = None |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 16 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 17 | def __init__( |
| 18 | self, |
| 19 | appname, |
| 20 | executable_args, |
| 21 | logger, |
| 22 | role, |
| 23 | testcase, |
| 24 | env=None, |
| 25 | *args, |
| 26 | **kwargs, |
| 27 | ): |
Paul Vinciguerra | 48bdbcd | 2019-12-04 19:43:53 -0500 | [diff] [blame] | 28 | if env is None: |
| 29 | env = {} |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 30 | app = f"{config.vpp_build_dir}/vpp/bin/{appname}" |
Paul Vinciguerra | 48bdbcd | 2019-12-04 19:43:53 -0500 | [diff] [blame] | 31 | self.args = [app] + executable_args |
Dave Wallace | 91af185 | 2019-10-21 03:28:17 +0000 | [diff] [blame] | 32 | self.role = role |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 33 | self.wait_for_gdb = "wait-for-gdb" |
Dave Wallace | 91af185 | 2019-10-21 03:28:17 +0000 | [diff] [blame] | 34 | self.testcase = testcase |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 35 | super(QUICAppWorker, self).__init__(self.args, logger, env, *args, **kwargs) |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 36 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 37 | def run(self): |
| 38 | super(QUICAppWorker, self).run() |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 39 | |
| 40 | def teardown(self, logger, timeout): |
| 41 | if self.process is None: |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 42 | return False |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 43 | try: |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 44 | logger.debug(f"Killing worker process (pid {self.process.pid})") |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 45 | os.killpg(os.getpgid(self.process.pid), signal.SIGKILL) |
| 46 | self.join(timeout) |
| 47 | except OSError as e: |
| 48 | logger.debug("Couldn't kill worker process") |
| 49 | return True |
| 50 | return False |
| 51 | |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 52 | |
Andrew Yourtchenko | bc37878 | 2023-09-26 16:01:21 +0200 | [diff] [blame] | 53 | @unittest.skipIf("quic" in config.excluded_plugins, "Exclude QUIC plugin tests") |
Dave Wallace | 8800f73 | 2023-08-31 00:47:44 -0400 | [diff] [blame] | 54 | class QUICTestCase(VppAsfTestCase): |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 55 | """QUIC Test Case""" |
Paul Vinciguerra | 1063f2a | 2019-12-04 23:18:02 -0500 | [diff] [blame] | 56 | |
| 57 | timeout = 20 |
| 58 | pre_test_sleep = 0.3 |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 59 | post_test_sleep = 0.3 |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 60 | server_appns = "server" |
| 61 | server_appns_secret = None |
| 62 | client_appns = "client" |
| 63 | client_appns_secret = None |
Paul Vinciguerra | 1063f2a | 2019-12-04 23:18:02 -0500 | [diff] [blame] | 64 | |
Aloys Augustin | baf1c7c | 2019-09-02 16:29:19 +0200 | [diff] [blame] | 65 | @classmethod |
| 66 | def setUpClass(cls): |
| 67 | cls.extra_vpp_plugin_config.append("plugin quic_plugin.so { enable }") |
| 68 | super(QUICTestCase, cls).setUpClass() |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 69 | |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 70 | def setUp(self): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 71 | super(QUICTestCase, self).setUp() |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 72 | self.vppDebug = "vpp_debug" in config.vpp_build_dir |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 73 | |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 74 | self.create_loopback_interfaces(2) |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 75 | self.uri = f"quic://{self.loop0.local_ip4}/1234" |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 76 | table_id = 1 |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 77 | for i in self.lo_interfaces: |
| 78 | i.admin_up() |
| 79 | |
| 80 | if table_id != 0: |
| 81 | tbl = VppIpTable(self, table_id) |
| 82 | tbl.add_vpp_config() |
| 83 | |
| 84 | i.set_table_ip4(table_id) |
| 85 | i.config_ip4() |
| 86 | table_id += 1 |
| 87 | |
| 88 | # Configure namespaces |
Nathan Skrzypczak | 51f1b26 | 2023-04-27 12:43:46 +0200 | [diff] [blame] | 89 | self.vapi.app_namespace_add_del_v4( |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 90 | namespace_id=self.server_appns, |
| 91 | secret=self.server_appns_secret, |
| 92 | sw_if_index=self.loop0.sw_if_index, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 93 | ) |
Nathan Skrzypczak | 51f1b26 | 2023-04-27 12:43:46 +0200 | [diff] [blame] | 94 | self.vapi.app_namespace_add_del_v4( |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 95 | namespace_id=self.client_appns, |
| 96 | secret=self.client_appns_secret, |
| 97 | sw_if_index=self.loop1.sw_if_index, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 98 | ) |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 99 | |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 100 | # Add inter-table routes |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 101 | self.ip_t01 = VppIpRoute( |
| 102 | self, |
| 103 | self.loop1.local_ip4, |
| 104 | 32, |
| 105 | [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=2)], |
| 106 | table_id=1, |
| 107 | ) |
| 108 | self.ip_t10 = VppIpRoute( |
| 109 | self, |
| 110 | self.loop0.local_ip4, |
| 111 | 32, |
| 112 | [VppRoutePath("0.0.0.0", 0xFFFFFFFF, nh_table_id=1)], |
| 113 | table_id=2, |
| 114 | ) |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 115 | self.ip_t01.add_vpp_config() |
| 116 | self.ip_t10.add_vpp_config() |
| 117 | self.logger.debug(self.vapi.cli("show ip fib")) |
| 118 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 119 | def tearDown(self): |
Steven Luong | 67bae20 | 2024-07-08 11:21:23 -0700 | [diff] [blame] | 120 | self.vapi.app_namespace_add_del_v4( |
| 121 | is_add=0, |
| 122 | namespace_id=self.server_appns, |
| 123 | secret=self.server_appns_secret, |
| 124 | sw_if_index=self.loop0.sw_if_index, |
| 125 | ) |
| 126 | self.vapi.app_namespace_add_del_v4( |
| 127 | is_add=0, |
| 128 | namespace_id=self.client_appns, |
| 129 | secret=self.client_appns_secret, |
| 130 | sw_if_index=self.loop1.sw_if_index, |
| 131 | ) |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 132 | # Delete inter-table routes |
| 133 | self.ip_t01.remove_vpp_config() |
| 134 | self.ip_t10.remove_vpp_config() |
| 135 | |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 136 | for i in self.lo_interfaces: |
| 137 | i.unconfig_ip4() |
| 138 | i.set_table_ip4(0) |
| 139 | i.admin_down() |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 140 | super(QUICTestCase, self).tearDown() |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 141 | |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 142 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 143 | class QUICEchoIntTestCase(QUICTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 144 | """QUIC Echo Internal Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 145 | |
| 146 | test_bytes = " test-bytes" |
Klement Sekera | d3e0d10 | 2023-01-26 12:35:35 +0100 | [diff] [blame] | 147 | extra_vpp_config = ["session", "{", "enable", "poll-main", "}"] |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 148 | |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 149 | def setUp(self): |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 150 | super(QUICEchoIntTestCase, self).setUp() |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 151 | self.client_args = ( |
Filip Tehlar | efe875e | 2023-09-04 14:17:52 +0200 | [diff] [blame] | 152 | f"uri {self.uri} fifo-size 64k{self.test_bytes} appns {self.client_appns} " |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 153 | ) |
Filip Tehlar | efe875e | 2023-09-04 14:17:52 +0200 | [diff] [blame] | 154 | self.server_args = f"uri {self.uri} fifo-size 64k appns {self.server_appns} " |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 155 | |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 156 | def tearDown(self): |
| 157 | super(QUICEchoIntTestCase, self).tearDown() |
| 158 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 159 | def server(self, *args): |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 160 | _args = self.server_args + " ".join(args) |
| 161 | error = self.vapi.cli(f"test echo server {_args}") |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 162 | if error: |
| 163 | self.logger.critical(error) |
| 164 | self.assertNotIn("failed", error) |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 165 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 166 | def client(self, *args): |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 167 | _args = self.client_args + " ".join(args) |
| 168 | error = self.vapi.cli(f"test echo client {_args}") |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 169 | if error: |
| 170 | self.logger.critical(error) |
| 171 | self.assertNotIn("failed", error) |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 172 | |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 173 | |
Andrew Yourtchenko | 8dc0d48 | 2021-01-29 13:17:19 +0000 | [diff] [blame] | 174 | @tag_fixme_vpp_workers |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 175 | class QUICEchoIntTransferTestCase(QUICEchoIntTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 176 | """QUIC Echo Internal Transfer Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 177 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 178 | def test_quic_int_transfer(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 179 | """QUIC internal transfer""" |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 180 | self.server() |
Filip Tehlar | efe875e | 2023-09-04 14:17:52 +0200 | [diff] [blame] | 181 | self.client("mbytes", "2") |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 182 | |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 183 | |
Andrew Yourtchenko | 8dc0d48 | 2021-01-29 13:17:19 +0000 | [diff] [blame] | 184 | @tag_fixme_vpp_workers |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 185 | class QUICEchoIntSerialTestCase(QUICEchoIntTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 186 | """QUIC Echo Internal Serial Transfer Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 187 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 188 | def test_quic_serial_int_transfer(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 189 | """QUIC serial internal transfer""" |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 190 | self.server() |
Filip Tehlar | efe875e | 2023-09-04 14:17:52 +0200 | [diff] [blame] | 191 | self.client("mbytes", "2") |
| 192 | self.client("mbytes", "2") |
| 193 | self.client("mbytes", "2") |
| 194 | self.client("mbytes", "2") |
| 195 | self.client("mbytes", "2") |
Dave Wallace | 0d144c7 | 2019-05-15 21:41:23 -0400 | [diff] [blame] | 196 | |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 197 | |
Andrew Yourtchenko | 8dc0d48 | 2021-01-29 13:17:19 +0000 | [diff] [blame] | 198 | @tag_fixme_vpp_workers |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 199 | class QUICEchoIntMStreamTestCase(QUICEchoIntTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 200 | """QUIC Echo Internal MultiStream Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 201 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 202 | def test_quic_int_multistream_transfer(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 203 | """QUIC internal multi-stream transfer""" |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 204 | self.server() |
Filip Tehlar | efe875e | 2023-09-04 14:17:52 +0200 | [diff] [blame] | 205 | self.client("nclients", "10", "mbytes", "1") |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 206 | |
| 207 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 208 | class QUICEchoExtTestCase(QUICTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 209 | quic_setup = "default" |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 210 | test_bytes = "test-bytes:assert" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 211 | pre_test_sleep = 1 |
| 212 | post_test_sleep = 1 |
Dave Wallace | 91af185 | 2019-10-21 03:28:17 +0000 | [diff] [blame] | 213 | app = "vpp_echo" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 214 | evt_q_len = 16384 |
Klement Sekera | 8d81502 | 2021-03-15 16:58:10 +0100 | [diff] [blame] | 215 | vpp_worker_count = 1 |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 216 | server_fifo_size = "1M" |
| 217 | client_fifo_size = "4M" |
Klement Sekera | d3e0d10 | 2023-01-26 12:35:35 +0100 | [diff] [blame] | 218 | extra_vpp_config = [ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 219 | "session", |
| 220 | "{", |
| 221 | "enable", |
| 222 | "poll-main", |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 223 | "use-app-socket-api", |
Florin Coras | cf5c774 | 2022-06-28 14:34:45 -0700 | [diff] [blame] | 224 | "wrk-mqs-segment-size", |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 225 | "64M", |
| 226 | "event-queue-length", |
| 227 | f"{evt_q_len}", |
| 228 | "preallocated-sessions", |
| 229 | "1024", |
| 230 | "v4-session-table-buckets", |
| 231 | "20000", |
| 232 | "v4-session-table-memory", |
| 233 | "64M", |
| 234 | "v4-halfopen-table-buckets", |
| 235 | "20000", |
| 236 | "v4-halfopen-table-memory", |
| 237 | "64M", |
| 238 | "local-endpoints-table-buckets", |
| 239 | "250000", |
| 240 | "local-endpoints-table-memory", |
| 241 | "512M", |
| 242 | "}", |
| 243 | ] |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 244 | |
| 245 | def setUp(self): |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 246 | self.server_appns_secret = 1234 |
| 247 | self.client_appns_secret = 5678 |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 248 | super(QUICEchoExtTestCase, self).setUp() |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 249 | common_args = [ |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 250 | "uri", |
| 251 | self.uri, |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 252 | "json", |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 253 | self.test_bytes, |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 254 | "quic-setup", |
| 255 | self.quic_setup, |
| 256 | "nthreads", |
| 257 | "1", |
| 258 | "mq-size", |
| 259 | f"{self.evt_q_len}", |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 260 | "use-app-socket-api", |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 261 | ] |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 262 | self.server_echo_test_args = common_args + [ |
| 263 | "server", |
| 264 | "appns", |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 265 | f"{self.server_appns}", |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 266 | "fifo-size", |
| 267 | f"{self.server_fifo_size}", |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 268 | "socket-name", |
| 269 | f"{self.tempdir}/app_ns_sockets/{self.server_appns}", |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 270 | ] |
| 271 | self.client_echo_test_args = common_args + [ |
| 272 | "client", |
| 273 | "appns", |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 274 | f"{self.client_appns}", |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 275 | "fifo-size", |
| 276 | f"{self.client_fifo_size}", |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 277 | "socket-name", |
| 278 | f"{self.tempdir}/app_ns_sockets/{self.client_appns}", |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 279 | ] |
Dave Wallace | f9d784b | 2019-10-30 16:58:30 +0000 | [diff] [blame] | 280 | error = self.vapi.cli("quic set fifo-size 2M") |
Dave Wallace | 91af185 | 2019-10-21 03:28:17 +0000 | [diff] [blame] | 281 | if error: |
| 282 | self.logger.critical(error) |
| 283 | self.assertNotIn("failed", error) |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 284 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 285 | def server(self, *args): |
| 286 | _args = self.server_echo_test_args + list(args) |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 287 | self.worker_server = QUICAppWorker( |
| 288 | self.app, _args, self.logger, self.server_appns, self |
| 289 | ) |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 290 | self.worker_server.start() |
| 291 | self.sleep(self.pre_test_sleep) |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 292 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 293 | def client(self, *args): |
| 294 | _args = self.client_echo_test_args + list(args) |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 295 | self.worker_client = QUICAppWorker( |
| 296 | self.app, _args, self.logger, self.client_appns, self |
| 297 | ) |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 298 | self.worker_client.start() |
Dave Wallace | 91af185 | 2019-10-21 03:28:17 +0000 | [diff] [blame] | 299 | timeout = None if self.debug_all else self.timeout |
| 300 | self.worker_client.join(timeout) |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 301 | if self.worker_client.is_alive(): |
| 302 | error = f"Client failed to complete in {timeout} seconds!" |
| 303 | self.logger.critical(error) |
| 304 | return |
Dave Wallace | 91af185 | 2019-10-21 03:28:17 +0000 | [diff] [blame] | 305 | self.worker_server.join(timeout) |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 306 | if self.worker_server.is_alive(): |
| 307 | error = f"Server failed to complete in {timeout} seconds!" |
| 308 | self.logger.critical(error) |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 309 | self.sleep(self.post_test_sleep) |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 310 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 311 | def validate_ext_test_results(self): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 312 | server_result = self.worker_server.result |
Florin Coras | e8a1dbf | 2023-09-06 19:09:30 -0700 | [diff] [blame] | 313 | self.logger.debug(self.vapi.cli(f"show session verbose 2")) |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 314 | client_result = self.worker_client.result |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 315 | self.logger.info(f"Server worker result is `{server_result}'") |
| 316 | self.logger.info(f"Client worker result is `{client_result}'") |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 317 | server_kill_error = False |
| 318 | if self.worker_server.result is None: |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 319 | server_kill_error = self.worker_server.teardown(self.logger, self.timeout) |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 320 | if self.worker_client.result is None: |
| 321 | self.worker_client.teardown(self.logger, self.timeout) |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 322 | err_msg = f"Wrong server worker return code ({server_result})" |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 323 | self.assertEqual(server_result, 0, err_msg) |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 324 | self.assertIsNotNone( |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 325 | client_result, f"Timeout! Client worker did not finish in {self.timeout}s" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 326 | ) |
Dave Wallace | 8430c40 | 2023-01-26 12:44:01 -0500 | [diff] [blame] | 327 | err_msg = f"Wrong client worker return code ({client_result})" |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 328 | self.assertEqual(client_result, 0, err_msg) |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 329 | self.assertFalse(server_kill_error, "Server kill errored") |
| 330 | |
| 331 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 332 | class QUICEchoExtTransferTestCase(QUICEchoExtTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 333 | """QUIC Echo External Transfer Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 334 | |
Paul Vinciguerra | 1063f2a | 2019-12-04 23:18:02 -0500 | [diff] [blame] | 335 | timeout = 60 |
| 336 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 337 | def test_quic_ext_transfer(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 338 | """QUIC external transfer""" |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 339 | self.server() |
| 340 | self.client() |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 341 | self.validate_ext_test_results() |
Dave Wallace | 3bffd4b | 2019-05-13 15:51:52 -0400 | [diff] [blame] | 342 | |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 343 | |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 344 | class QUICEchoExtTransferBigTestCase(QUICEchoExtTestCase): |
| 345 | """QUIC Echo External Transfer Big Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 346 | |
| 347 | server_fifo_size = "4M" |
| 348 | client_fifo_size = "4M" |
| 349 | test_bytes = "" |
Paul Vinciguerra | 1063f2a | 2019-12-04 23:18:02 -0500 | [diff] [blame] | 350 | timeout = 60 |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 351 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 352 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 353 | def test_quic_ext_transfer_big(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 354 | """QUIC external transfer, big stream""" |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 355 | self.server("TX=0", "RX=2G") |
| 356 | self.client("TX=2G", "RX=0") |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 357 | self.validate_ext_test_results() |
| 358 | |
| 359 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 360 | class QUICEchoExtQcloseRxTestCase(QUICEchoExtTestCase): |
| 361 | """QUIC Echo External Transfer Qclose Rx Test Case""" |
| 362 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 363 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 364 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 365 | def test_quic_ext_qclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 366 | """QUIC external transfer, rx close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 367 | self.server("TX=0", "RX=10M", "qclose=Y", "sclose=N") |
| 368 | self.client("TX=10M", "RX=0", "qclose=W", "sclose=W") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 369 | self.validate_ext_test_results() |
| 370 | |
| 371 | |
| 372 | class QUICEchoExtQcloseTxTestCase(QUICEchoExtTestCase): |
| 373 | """QUIC Echo External Transfer Qclose Tx Test Case""" |
| 374 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 375 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 376 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 377 | def test_quic_ext_qclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 378 | """QUIC external transfer, tx close""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 379 | self.server("TX=0", "RX=10M", "qclose=W", "sclose=W", "rx-results-diff") |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 380 | self.client("TX=10M", "RX=0", "qclose=Y", "sclose=N") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 381 | self.validate_ext_test_results() |
| 382 | |
| 383 | |
| 384 | class QUICEchoExtEarlyQcloseRxTestCase(QUICEchoExtTestCase): |
| 385 | """QUIC Echo External Transfer Early Qclose Rx Test Case""" |
| 386 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 387 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 388 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 389 | def test_quic_ext_early_qclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 390 | """QUIC external transfer, early rx close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 391 | self.server("TX=0", "RX=10M", "qclose=Y", "sclose=N") |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 392 | self.client("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 393 | self.validate_ext_test_results() |
| 394 | |
| 395 | |
| 396 | class QUICEchoExtEarlyQcloseTxTestCase(QUICEchoExtTestCase): |
| 397 | """QUIC Echo External Transfer Early Qclose Tx Test Case""" |
| 398 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 399 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 400 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 401 | def test_quic_ext_early_qclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 402 | """QUIC external transfer, early tx close""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 403 | self.server("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff") |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 404 | self.client("TX=10M", "RX=0", "qclose=Y", "sclose=N") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 405 | self.validate_ext_test_results() |
| 406 | |
| 407 | |
| 408 | class QUICEchoExtScloseRxTestCase(QUICEchoExtTestCase): |
| 409 | """QUIC Echo External Transfer Sclose Rx Test Case""" |
| 410 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 411 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 412 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 413 | def test_quic_ext_sclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 414 | """QUIC external transfer, rx stream close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 415 | self.server("TX=0", "RX=10M", "qclose=N", "sclose=Y") |
| 416 | self.client("TX=10M", "RX=0", "qclose=W", "sclose=W") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 417 | self.validate_ext_test_results() |
| 418 | |
| 419 | |
| 420 | class QUICEchoExtScloseTxTestCase(QUICEchoExtTestCase): |
| 421 | """QUIC Echo External Transfer Sclose Tx Test Case""" |
| 422 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 423 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 424 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 425 | def test_quic_ext_sclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 426 | """QUIC external transfer, tx stream close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 427 | self.server("TX=0", "RX=10M", "qclose=W", "sclose=W") |
| 428 | self.client("TX=10M", "RX=0", "qclose=Y", "sclose=Y") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 429 | self.validate_ext_test_results() |
| 430 | |
| 431 | |
| 432 | class QUICEchoExtEarlyScloseRxTestCase(QUICEchoExtTestCase): |
| 433 | """QUIC Echo External Transfer Early Sclose Rx Test Case""" |
| 434 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 435 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 436 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 437 | def test_quic_ext_early_sclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 438 | """QUIC external transfer, early rx stream close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 439 | self.server("TX=0", "RX=10M", "qclose=N", "sclose=Y") |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 440 | self.client("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 441 | self.validate_ext_test_results() |
| 442 | |
| 443 | |
| 444 | class QUICEchoExtEarlyScloseTxTestCase(QUICEchoExtTestCase): |
Dave Wallace | ff5a9b6 | 2019-09-25 17:58:24 -0400 | [diff] [blame] | 445 | """QUIC Echo External Transfer Early Sclose Tx Test Case""" |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 446 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 447 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 448 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 449 | def test_quic_ext_early_sclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 450 | """QUIC external transfer, early tx stream close""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 451 | self.server("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff") |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 452 | self.client("TX=10M", "RX=0", "qclose=Y", "sclose=Y") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 453 | self.validate_ext_test_results() |
| 454 | |
| 455 | |
| 456 | class QUICEchoExtServerStreamTestCase(QUICEchoExtTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 457 | """QUIC Echo External Transfer Server Stream Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 458 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 459 | quic_setup = "serverstream" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 460 | timeout = 60 |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 461 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 462 | def test_quic_ext_transfer_server_stream(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 463 | """QUIC external server transfer""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 464 | self.server("TX=10M", "RX=0") |
| 465 | self.client("TX=0", "RX=10M") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 466 | self.validate_ext_test_results() |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 467 | |
Chore | 464e1dc | 2019-06-25 14:21:26 +0430 | [diff] [blame] | 468 | |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 469 | class QUICEchoExtServerStreamBigTestCase(QUICEchoExtTestCase): |
| 470 | """QUIC Echo External Transfer Server Stream Big Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 471 | |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 472 | quic_setup = "serverstream" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 473 | server_fifo_size = "4M" |
| 474 | client_fifo_size = "4M" |
| 475 | test_bytes = "" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 476 | timeout = 60 |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 477 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 478 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 479 | def test_quic_ext_transfer_server_stream_big(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 480 | """QUIC external server transfer, big stream""" |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 481 | self.server("TX=2G", "RX=0") |
| 482 | self.client("TX=0", "RX=2G") |
Dave Wallace | 3ad078d | 2019-10-21 22:45:23 +0000 | [diff] [blame] | 483 | self.validate_ext_test_results() |
| 484 | |
| 485 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 486 | class QUICEchoExtServerStreamQcloseRxTestCase(QUICEchoExtTestCase): |
| 487 | """QUIC Echo External Transfer Server Stream Qclose Rx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 488 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 489 | quic_setup = "serverstream" |
| 490 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 491 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 492 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 493 | def test_quic_ext_server_stream_qclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 494 | """QUIC external server transfer, rx close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 495 | self.server("TX=10M", "RX=0", "qclose=W", "sclose=W") |
| 496 | self.client("TX=0", "RX=10M", "qclose=Y", "sclose=N") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 497 | self.validate_ext_test_results() |
| 498 | |
| 499 | |
| 500 | class QUICEchoExtServerStreamQcloseTxTestCase(QUICEchoExtTestCase): |
| 501 | """QUIC Echo External Transfer Server Stream Qclose Tx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 502 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 503 | quic_setup = "serverstream" |
| 504 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 505 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 506 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 507 | def test_quic_ext_server_stream_qclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 508 | """QUIC external server transfer, tx close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 509 | self.server("TX=10M", "RX=0", "qclose=Y", "sclose=N") |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 510 | self.client("TX=0", "RX=10M", "qclose=W", "sclose=W", "rx-results-diff") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 511 | self.validate_ext_test_results() |
| 512 | |
| 513 | |
| 514 | class QUICEchoExtServerStreamEarlyQcloseRxTestCase(QUICEchoExtTestCase): |
| 515 | """QUIC Echo External Transfer Server Stream Early Qclose Rx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 516 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 517 | quic_setup = "serverstream" |
| 518 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 519 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 520 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 521 | def test_quic_ext_server_stream_early_qclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 522 | """QUIC external server transfer, early rx close""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 523 | self.server("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff") |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 524 | self.client("TX=0", "RX=10M", "qclose=Y", "sclose=N") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 525 | self.validate_ext_test_results() |
| 526 | |
| 527 | |
| 528 | class QUICEchoExtServerStreamEarlyQcloseTxTestCase(QUICEchoExtTestCase): |
| 529 | """QUIC Echo External Transfer Server Stream Early Qclose Tx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 530 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 531 | quic_setup = "serverstream" |
| 532 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 533 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 534 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 535 | def test_quic_ext_server_stream_early_qclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 536 | """QUIC external server transfer, early tx close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 537 | self.server("TX=10M", "RX=0", "qclose=Y", "sclose=N") |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 538 | self.client("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 539 | self.validate_ext_test_results() |
| 540 | |
| 541 | |
| 542 | class QUICEchoExtServerStreamScloseRxTestCase(QUICEchoExtTestCase): |
| 543 | """QUIC Echo External Transfer Server Stream Sclose Rx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 544 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 545 | quic_setup = "serverstream" |
| 546 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 547 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 548 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 549 | def test_quic_ext_server_stream_sclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 550 | """QUIC external server transfer, rx stream close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 551 | self.server("TX=10M", "RX=0", "qclose=W", "sclose=W") |
| 552 | self.client("TX=0", "RX=10M", "qclose=N", "sclose=Y") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 553 | self.validate_ext_test_results() |
| 554 | |
| 555 | |
| 556 | class QUICEchoExtServerStreamScloseTxTestCase(QUICEchoExtTestCase): |
| 557 | """QUIC Echo External Transfer Server Stream Sclose Tx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 558 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 559 | quic_setup = "serverstream" |
| 560 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 561 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 562 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 563 | def test_quic_ext_server_stream_sclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 564 | """QUIC external server transfer, tx stream close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 565 | self.server("TX=10M", "RX=0", "qclose=Y", "sclose=Y") |
| 566 | self.client("TX=0", "RX=10M", "qclose=W", "sclose=W") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 567 | self.validate_ext_test_results() |
| 568 | |
| 569 | |
| 570 | class QUICEchoExtServerStreamEarlyScloseRxTestCase(QUICEchoExtTestCase): |
| 571 | """QUIC Echo External Transfer Server Stream Early Sclose Rx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 572 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 573 | quic_setup = "serverstream" |
| 574 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 575 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 576 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 577 | def test_quic_ext_server_stream_early_sclose_rx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 578 | """QUIC external server transfer, early rx stream close""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 579 | self.server("TX=20M", "RX=0", "qclose=W", "sclose=W", "tx-results-diff") |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 580 | self.client("TX=0", "RX=10M", "qclose=N", "sclose=Y") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 581 | self.validate_ext_test_results() |
| 582 | |
| 583 | |
| 584 | class QUICEchoExtServerStreamEarlyScloseTxTestCase(QUICEchoExtTestCase): |
| 585 | """QUIC Echo Ext Transfer Server Stream Early Sclose Tx Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 586 | |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 587 | quic_setup = "serverstream" |
| 588 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 589 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 590 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 591 | def test_quic_ext_server_stream_early_sclose_tx(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 592 | """QUIC external server transfer, early tx stream close""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 593 | self.server("TX=10M", "RX=0", "qclose=Y", "sclose=Y") |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 594 | self.client("TX=0", "RX=20M", "qclose=W", "sclose=W", "rx-results-diff") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 595 | self.validate_ext_test_results() |
| 596 | |
| 597 | |
| 598 | class QUICEchoExtServerStreamWorkersTestCase(QUICEchoExtTestCase): |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 599 | """QUIC Echo External Transfer Server Stream MultiWorker Test Case""" |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 600 | |
Dave Wallace | 47e7730 | 2019-06-05 10:40:07 -0400 | [diff] [blame] | 601 | quic_setup = "serverstream" |
| 602 | |
Klement Sekera | b23ffd7 | 2021-05-31 16:08:53 +0200 | [diff] [blame] | 603 | @unittest.skipUnless(config.extended, "part of extended tests") |
Dave Wallace | 2edff14 | 2020-02-07 17:55:53 -0500 | [diff] [blame] | 604 | @unittest.skip("testcase under development") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 605 | def test_quic_ext_transfer_server_stream_multi_workers(self): |
Dave Wallace | 03ec134 | 2020-05-05 19:45:10 +0000 | [diff] [blame] | 606 | """QUIC external server transfer, multi-worker""" |
Dave Wallace | 3ce0352 | 2020-01-27 18:21:15 -0500 | [diff] [blame] | 607 | self.server("nclients", "4", "quic-streams", "4", "TX=10M", "RX=0") |
| 608 | self.client("nclients", "4", "quic-streams", "4", "TX=0", "RX=10M") |
Dave Wallace | 83c1e9a | 2019-09-21 04:19:26 +0000 | [diff] [blame] | 609 | self.validate_ext_test_results() |
Dave Wallace | 211b28a | 2019-05-08 20:46:33 -0400 | [diff] [blame] | 610 | |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 611 | |
Klement Sekera | d9b0c6f | 2022-04-26 19:02:15 +0200 | [diff] [blame] | 612 | if __name__ == "__main__": |
Dave Wallace | b063ad0 | 2019-04-09 21:01:09 -0400 | [diff] [blame] | 613 | unittest.main(testRunner=VppTestRunner) |