From a155eda5f1137068d7efa818206d54968679759b Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Fri, 27 Mar 2026 17:42:40 +0100 Subject: [PATCH 1/5] Revert "ci(systests/zephyr) disable input_output" This reverts commit 697ce1cb0db943b80906de3f67df845f8f60a721. Signed-off-by: Marco Casaroli --- .github/workflows/zephyr-systests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/zephyr-systests.yml b/.github/workflows/zephyr-systests.yml index dc794649..43ebf83c 100644 --- a/.github/workflows/zephyr-systests.yml +++ b/.github/workflows/zephyr-systests.yml @@ -29,6 +29,7 @@ jobs: - lib - ocre - context + - input_output steps: - name: Clean other workspace run: rm -rf ../.west From 027b7ded6949708b1e1cd4532818e14c4f7ff4b0 Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Fri, 27 Mar 2026 17:41:31 +0100 Subject: [PATCH 2/5] test(system/input_output): fix read Signed-off-by: Marco Casaroli --- tests/system/input_output.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/system/input_output.c b/tests/system/input_output.c index 0fdb199d..17fa314b 100644 --- a/tests/system/input_output.c +++ b/tests/system/input_output.c @@ -51,18 +51,22 @@ void test_ocre_container_output_stdout(void) ocre_container_wait(container, NULL); - char buf[1000]; + /* Skip to newline */ + + char c; + do { + size_t n = read(stdout_pair[0], &c, 1); + TEST_ASSERT_EQUAL_size_t(1, n); + } while (c != '\n'); + + char buf[19]; /* "argv[1]=Zirigdum!\n" */ memset(buf, 0, sizeof(buf)); ssize_t n = read(stdout_pair[0], buf, sizeof(buf) - 1); - TEST_ASSERT_GREATER_THAN_size_t(0, n); - - char *second_line = strchr(buf, '\n'); - ++second_line; - TEST_ASSERT_NOT_NULL(second_line); + TEST_ASSERT_EQUAL_size_t(sizeof(buf) - 1, n); - TEST_ASSERT_EQUAL_STRING("argv[1]=" ARG_TEST_STRING "\n", second_line); + TEST_ASSERT_EQUAL_STRING("argv[1]=" ARG_TEST_STRING "\n", buf); ocre_container_kill(container); ocre_container_wait(container, NULL); From c8e07b20a257153257b6550c93f6ca0d9db927da Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Tue, 21 Apr 2026 17:38:28 +0200 Subject: [PATCH 3/5] test(zephyr/unity): link with zephyr interface Signed-off-by: Marco Casaroli --- tests/system/zephyr/input_output/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/system/zephyr/input_output/CMakeLists.txt b/tests/system/zephyr/input_output/CMakeLists.txt index b2bc73ef..a210415f 100644 --- a/tests/system/zephyr/input_output/CMakeLists.txt +++ b/tests/system/zephyr/input_output/CMakeLists.txt @@ -22,6 +22,9 @@ add_library(Unity STATIC ../../../../tests/Unity/src/unity.c ) +target_link_libraries(Unity PUBLIC zephyr_interface) + + target_include_directories(Unity PUBLIC ../../../../tests/Unity/src ) From 9fbc5e295476c0a006b56070a4fbebcfd28e041a Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Tue, 21 Apr 2026 17:38:50 +0200 Subject: [PATCH 4/5] test(input_output): close file descriptors Signed-off-by: Marco Casaroli --- tests/system/input_output.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/system/input_output.c b/tests/system/input_output.c index 17fa314b..b30e8f2d 100644 --- a/tests/system/input_output.c +++ b/tests/system/input_output.c @@ -69,6 +69,7 @@ void test_ocre_container_output_stdout(void) TEST_ASSERT_EQUAL_STRING("argv[1]=" ARG_TEST_STRING "\n", buf); ocre_container_kill(container); + close(stdout_pair[0]); ocre_container_wait(container, NULL); ocre_context_remove_container(context, container); @@ -98,6 +99,8 @@ void test_ocre_container_input_stdin_output_stdout(void) TEST_ASSERT_EQUAL_STRING(ARG_TEST_STRING "\n", buf); ocre_container_kill(container); + close(stdin_pair[0]); + close(stdout_pair[0]); ocre_container_wait(container, NULL); ocre_context_remove_container(context, container); @@ -135,6 +138,8 @@ void test_ocre_container_input_stdin_output_stderr(void) TEST_ASSERT_EQUAL_STRING(ARG_TEST_STRING "\n", buf); ocre_container_kill(container); + close(stdin_pair[0]); + close(stderr_pair[0]); ocre_container_wait(container, NULL); ocre_context_remove_container(context, container); From cfbfe9cc01b438f1965a8c18536f664cb8a7033b Mon Sep 17 00:00:00 2001 From: Marco Casaroli Date: Tue, 21 Apr 2026 09:56:54 +0200 Subject: [PATCH 5/5] chore(wamr): bump for io redirection Signed-off-by: Marco Casaroli --- wasm-micro-runtime | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wasm-micro-runtime b/wasm-micro-runtime index d1a577ea..089f5c7a 160000 --- a/wasm-micro-runtime +++ b/wasm-micro-runtime @@ -1 +1 @@ -Subproject commit d1a577ea0e62ff3d550a74639e4dff54007e2255 +Subproject commit 089f5c7a08710db225291a01c1528be0163f0f9a