From 38cc55b33887234e720898efdd259ba1e53b223e Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Mon, 12 Aug 2024 11:34:06 -0700 Subject: [PATCH] change `anon_pipe_spawn_echo` to use `printf(1)` The illumos version of `echo(1)` doesn't support `-n`, so it interprets it literally as part of the string to echo, making the test fail. I've changed it to use `printf(1)` with no flags args to get the same behavior. I also changed the name of the test, since it doesn't actually spawn `echo(1)` anymore :) --- tokio/tests/net_unix_pipe.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tokio/tests/net_unix_pipe.rs b/tokio/tests/net_unix_pipe.rs index 37b8b41bd..a28303e97 100644 --- a/tokio/tests/net_unix_pipe.rs +++ b/tokio/tests/net_unix_pipe.rs @@ -457,15 +457,14 @@ async fn anon_pipe_simple_send() -> io::Result<()> { } #[tokio::test] -async fn anon_pipe_spawn_echo() -> std::io::Result<()> { +async fn anon_pipe_spawn_printf() -> std::io::Result<()> { use tokio::process::Command; const DATA: &str = "this is some data to write to the pipe"; let (tx, mut rx) = pipe::pipe()?; - let status = Command::new("echo") - .arg("-n") + let status = Command::new("printf") .arg(DATA) .stdout(tx.into_blocking_fd()?) .status();