Skip to content

Commit

Permalink
feat: Plumbing to begin supporting QNS migration tests
Browse files Browse the repository at this point in the history
And a small bit of cleanup to avoid repetition.
  • Loading branch information
larseggert committed Oct 11, 2024
1 parent 9ef0355 commit 5c7de91
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
19 changes: 10 additions & 9 deletions neqo-bin/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,11 @@ impl Args {

// Only use v1 for most QNS tests.
self.shared.quic_parameters.quic_version = vec![Version::Version1];
// This is the default for all tests except http3.
self.shared.use_old_http = true;
match testcase.as_str() {
"http3" => {
self.shared.use_old_http = false;
if let Some(testcase) = &self.test {
if testcase.as_str() != "upload" {
qerror!("Unsupported test case: {testcase}");
Expand All @@ -242,23 +245,25 @@ impl Args {
self.method = String::from("POST");
}
}
"handshake" | "transfer" | "retry" | "ecn" => {
self.shared.use_old_http = true;
}
"handshake"
| "transfer"
| "retry"
| "ecn"
| "rebind-port"
| "rebind-addr"
| "connectionmigration" => {}
"resumption" => {
if self.urls.len() < 2 {
qerror!("Warning: resumption test won't work without >1 URL");
exit(127);
}
self.shared.use_old_http = true;
self.resume = true;
}
"zerortt" => {
if self.urls.len() < 2 {
qerror!("Warning: zerortt test won't work without >1 URL");
exit(127);
}
self.shared.use_old_http = true;
self.resume = true;
// PMTUD probes inflate what we sent in 1-RTT, causing QNS to fail the test.
self.shared.quic_parameters.no_pmtud = true;
Expand All @@ -267,22 +272,18 @@ impl Args {
self.shared.quic_parameters.no_pacing = true;
}
"multiconnect" => {
self.shared.use_old_http = true;
self.download_in_series = true;
}
"chacha20" => {
self.shared.use_old_http = true;
self.shared.ciphers.clear();
self.shared
.ciphers
.extend_from_slice(&[String::from("TLS_CHACHA20_POLY1305_SHA256")]);
}
"keyupdate" => {
self.shared.use_old_http = true;
self.key_update = true;
}
"v2" => {
self.shared.use_old_http = true;
// Use default version set for this test (which allows compatible vneg.)
self.shared.quic_parameters.quic_version.clear();
}
Expand Down
18 changes: 12 additions & 6 deletions neqo-bin/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,28 +336,34 @@ pub async fn server(mut args: Args) -> Res<()> {
qwarn!("Both -V and --qns-test were set. Ignoring testcase specific versions.");
}

// This is the default for all tests except http3.
args.shared.use_old_http = true;
// TODO: More options to deduplicate with client?
match testcase.as_str() {
"http3" => (),
"http3" => args.shared.use_old_http = false,
"zerortt" => {
args.shared.use_old_http = true;
args.shared.alpn = String::from(HQ_INTEROP);
args.shared.quic_parameters.max_streams_bidi = 100;
}
"handshake" | "transfer" | "resumption" | "multiconnect" | "v2" | "ecn" => {
args.shared.use_old_http = true;
"handshake"
| "transfer"
| "resumption"
| "multiconnect"
| "v2"
| "ecn"
| "rebind-port"
| "rebind-addr"
| "connectionmigration" => {
args.shared.alpn = String::from(HQ_INTEROP);
}
"chacha20" => {
args.shared.use_old_http = true;
args.shared.alpn = String::from(HQ_INTEROP);
args.shared.ciphers.clear();
args.shared
.ciphers
.extend_from_slice(&[String::from("TLS_CHACHA20_POLY1305_SHA256")]);
}
"retry" => {
args.shared.use_old_http = true;
args.shared.alpn = String::from(HQ_INTEROP);
args.retry = true;
}
Expand Down

0 comments on commit 5c7de91

Please sign in to comment.