Skip to content

Commit

Permalink
add the right to fetch stats on pipes (#5090)
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej authored Sep 17, 2024
2 parents 12f6ba2 + 75c2307 commit 94f0684
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ wasmer-config = { path = "./lib/config" }
wasmer-wasix = { path = "./lib/wasix" }

# Wasmer-owned crates
webc = { version = "6.0.0", default-features = false, features = ["package"] }
webc = { version = "6.0.1", default-features = false, features = ["package"] }
shared-buffer = "0.1.4"

# Third-party crates
Expand Down
3 changes: 2 additions & 1 deletion lib/wasix/src/syscalls/wasix/fd_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ pub fn fd_pipe_internal(
| Rights::FD_DATASYNC
| Rights::POLL_FD_READWRITE
| Rights::SOCK_SEND
| Rights::FD_FDSTAT_SET_FLAGS;
| Rights::FD_FDSTAT_SET_FLAGS
| Rights::FD_FILESTAT_GET;

let fd1 = if let Some(fd) = with_fd1 {
state
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hex = "0.4.3"
pretty_assertions.workspace = true
object = "0.30.0"
reqwest = { workspace = true, default-features = false, features = ["json", "blocking", "rustls-tls"] }
tokio = { workspace = true, features = [ "rt", "rt-multi-thread", "macros" ] }
tokio = { workspace = true, features = [ "rt", "rt-multi-thread", "macros", "process" ] }
assert_cmd = "2.0.8"
predicates = "2.1.5"
once_cell = "1.17.1"
Expand Down
43 changes: 43 additions & 0 deletions tests/integration/cli/tests/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,49 @@ static CACHE_RUST_LOG: Lazy<String> = Lazy::new(|| {
.join(",")
});

#[tokio::test]
async fn aio_http() {
let status = tokio::process::Command::new(get_wasmer_path())
.kill_on_drop(true)
.arg("package")
.arg("download")
.arg("wasmer-integration-tests/aio-http-hello-world")
.arg("-o")
.arg("aio-http-hello-world.webc")
.arg("--quiet")
.spawn()
.unwrap()
.wait()
.await
.unwrap();

assert!(status.success());

let mut wasmer = tokio::process::Command::new(get_wasmer_path())
.kill_on_drop(true)
.arg("run")
.arg("aio-http-hello-world.webc")
.arg("--net")
.stdout(Stdio::null())
.spawn()
.unwrap();

tokio::time::sleep(std::time::Duration::from_secs(5)).await;

let rsp = reqwest::Client::new()
.get("http://localhost:34343")
.send()
.await
.unwrap();

let body = rsp.text().await.unwrap();

assert_eq!(body, "Hello, World!");

wasmer.kill().await.unwrap();
wasmer.wait().await.unwrap();
}

#[test]
fn list_cwd() {
let package = packages().join("list-cwd");
Expand Down

0 comments on commit 94f0684

Please sign in to comment.