Skip to content

Commit

Permalink
External Wasm modules for testing.
Browse files Browse the repository at this point in the history
Signed-off-by: Ismo Puustinen <[email protected]>
  • Loading branch information
ipuustin committed May 4, 2023
1 parent fe70750 commit a72617e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ members = [
"crates/oci-tar-builder",
"crates/containerd-shim-wasmedge",
"crates/containerd-shim-wasmtime",
"test/wasi-modules-for-testing",
]

[workspace.package]
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ test/k8s/deploy: test/k8s/cluster
test/k8s/clean:
kind delete cluster --name $(KIND_CLUSTER_NAME)

test/wasm-modules:
cargo build -p wasi-modules-for-testing --target wasm32-wasi

.PHONY: bin/wasmedge
bin/wasmedge:
curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash -s -- -p $(PWD)/bin/wasmedge && \
Expand Down
2 changes: 2 additions & 0 deletions test/wasi-modules-for-testing/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target = "wasm32-wasi"
10 changes: 10 additions & 0 deletions test/wasi-modules-for-testing/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "wasi-modules-for-testing"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "hello-world"
path = "src/hello_world.rs"

[dependencies]
7 changes: 7 additions & 0 deletions test/wasi-modules-for-testing/src/hello_world.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main() {
// Add current working dir request so that we have some known system call to
// test seccomp with.
let cwd = std::env::current_dir().unwrap();

println!("hello world, current working dir: {}", cwd.to_string_lossy());
}

0 comments on commit a72617e

Please sign in to comment.