2022-12-19 19:17:22 +00:00
|
|
|
#[test]
|
|
|
|
fn end_to_end () -> anyhow::Result <()> {
|
|
|
|
let rt = tokio::runtime::Runtime::new ()?;
|
|
|
|
rt.block_on (end_to_end_async ())?;
|
|
|
|
Ok (())
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn end_to_end_async () -> anyhow::Result <()> {
|
2022-12-19 19:21:46 +00:00
|
|
|
use crate::executable_relay_server as relay;
|
2022-12-19 19:17:22 +00:00
|
|
|
|
2022-12-19 19:21:46 +00:00
|
|
|
let relay_opt = relay::Opt {
|
2022-12-19 19:51:37 +00:00
|
|
|
listen_addr: "127.0.0.1:0".to_string ().into (),
|
|
|
|
tcp_listen_port: None,
|
2022-12-19 19:21:46 +00:00
|
|
|
};
|
2022-12-19 19:51:37 +00:00
|
|
|
let relay_app = relay::App::new (relay_opt)?;
|
2022-12-19 19:21:46 +00:00
|
|
|
let task_relay = tokio::spawn (async move {
|
2022-12-19 19:51:37 +00:00
|
|
|
relay_app.run ().await
|
2022-12-19 19:21:46 +00:00
|
|
|
});
|
2022-12-19 19:17:22 +00:00
|
|
|
|
|
|
|
Ok (())
|
|
|
|
}
|