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 {
|
|
|
|
listen_addr: "127.0.0.1:30381".to_string ().into (),
|
|
|
|
tcp_listen_port: 8001.into (),
|
|
|
|
};
|
|
|
|
let task_relay = tokio::spawn (async move {
|
|
|
|
relay::main (relay_opt).await?;
|
|
|
|
Ok::<_, anyhow::Error> (())
|
|
|
|
});
|
2022-12-19 19:17:22 +00:00
|
|
|
|
|
|
|
Ok (())
|
|
|
|
}
|