Skip to content

Commit 634fb4f

Browse files
committed
Tidy, rm unneeded test
1 parent d2d9b7c commit 634fb4f

1 file changed

Lines changed: 4 additions & 54 deletions

File tree

src/lib.rs

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ impl ProxyServer {
363363
Ok(join_handle)
364364
}
365365

366-
/// Helper to get the socket address of the underlying TCP listener
366+
/// Helper to get the socket address of either underlying TCP listener
367367
pub fn local_addr(&self) -> std::io::Result<SocketAddr> {
368368
match &self.outer {
369369
Some((listener, _)) => listener.local_addr(),
@@ -376,13 +376,15 @@ impl ProxyServer {
376376
}
377377
}
378378

379+
/// Helper to get the socket address of the underlying outer TCP listener if present
379380
pub fn outer_local_addr(&self) -> std::io::Result<Option<SocketAddr>> {
380381
self.outer
381382
.as_ref()
382383
.map(|(listener, _)| listener.local_addr())
383384
.transpose()
384385
}
385386

387+
/// Helper to get the socket address of the underlying inner TCP listener if present
386388
pub fn inner_local_addr(&self) -> std::io::Result<Option<SocketAddr>> {
387389
self.inner
388390
.as_ref()
@@ -1239,58 +1241,6 @@ mod tests {
12391241
assert!(matches!(conn, HttpConnection::Http2 { .. }));
12401242
}
12411243

1242-
// #[tokio::test(flavor = "multi_thread")]
1243-
// async fn http_proxy_default_constructors_work() {
1244-
// let target_addr = example_http_service().await;
1245-
//
1246-
// let (cert_chain, private_key) = generate_certificate_chain_for_host("localhost");
1247-
// let server_cert = cert_chain[0].clone();
1248-
//
1249-
// let proxy_server = ProxyServer::new(
1250-
// TlsCertAndKey {
1251-
// cert_chain,
1252-
// key: private_key,
1253-
// },
1254-
// "127.0.0.1:0",
1255-
// target_addr.to_string(),
1256-
// AttestationGenerator::new(AttestationType::DcapTdx, None).unwrap(),
1257-
// AttestationVerifier::expect_none(),
1258-
// false,
1259-
// )
1260-
// .await
1261-
// .unwrap();
1262-
//
1263-
// let proxy_addr = proxy_server.local_addr().unwrap();
1264-
//
1265-
// tokio::spawn(async move {
1266-
// proxy_server.accept().await.unwrap();
1267-
// });
1268-
//
1269-
// let proxy_client = ProxyClient::new(
1270-
// None,
1271-
// "127.0.0.1:0".to_string(),
1272-
// format!("localhost:{}", proxy_addr.port()),
1273-
// AttestationGenerator::with_no_attestation(),
1274-
// AttestationVerifier::mock(),
1275-
// Some(server_cert),
1276-
// )
1277-
// .await
1278-
// .unwrap();
1279-
//
1280-
// let proxy_client_addr = proxy_client.local_addr().unwrap();
1281-
//
1282-
// tokio::spawn(async move {
1283-
// proxy_client.accept().await.unwrap();
1284-
// });
1285-
//
1286-
// let res = reqwest::get(format!("http://{}", proxy_client_addr))
1287-
// .await
1288-
// .unwrap();
1289-
//
1290-
// let res_body = res.text().await.unwrap();
1291-
// assert_eq!(res_body, "No measurements");
1292-
// }
1293-
12941244
// Server has mock DCAP, client has no attestation and no client auth
12951245
#[tokio::test(flavor = "multi_thread")]
12961246
async fn http_proxy_with_server_attestation() {
@@ -1334,7 +1284,7 @@ mod tests {
13341284
.await
13351285
.unwrap();
13361286

1337-
let proxy_client_addr = proxy_client.local_addr().unwrap();
1287+
let proy_client_addr = proxy_client.local_addr().unwrap();
13381288

13391289
tokio::spawn(async move {
13401290
proxy_client.accept().await.unwrap();

0 commit comments

Comments
 (0)