From 86f07c7bda57c573da55b45cb2d949170fc248e8 Mon Sep 17 00:00:00 2001 From: aidan garske Date: Wed, 22 Jul 2026 10:16:46 -0700 Subject: [PATCH] Assert the real se050 wolfcrypt result instead of an early sub-test line --- .github/scripts/se050-run.sh | 9 ++++++--- SE050/wolfssl/wolfcrypt_test/wolfcrypt_test.c | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/scripts/se050-run.sh b/.github/scripts/se050-run.sh index fd16e85a..b3655edb 100755 --- a/.github/scripts/se050-run.sh +++ b/.github/scripts/se050-run.sh @@ -89,10 +89,13 @@ echo "::group::run wolfcrypt_test against SE050Sim" simpid=$! sleep 2 export SE050_SIM_HOST=127.0.0.1 SE050_SIM_PORT=8050 LD_LIBRARY_PATH=/usr/local/lib -out=$("$WORK/wolfcrypt_test" 2>&1) || true +rc=0 +out=$("$WORK/wolfcrypt_test" 2>&1) || rc=$? kill "$simpid" 2>/dev/null || true printf '%s\n' "$out" | tail -40 -printf '%s' "$out" | grep -qiE "Ran wolfCrypt test|Test complete|error test passed" \ - || { echo "FAIL: se050 wolfcrypt_test did not report success"; exit 1; } +# the demo now returns the test result and only prints this on a clean pass +if [ "$rc" -ne 0 ] || ! printf '%s' "$out" | grep -q "Ran wolfCrypt test successfully"; then + echo "FAIL: se050 wolfcrypt_test did not pass (rc=$rc)"; exit 1 +fi echo "PASS: se050 wolfcrypt_test ran against SE050Sim" echo "::endgroup::" diff --git a/SE050/wolfssl/wolfcrypt_test/wolfcrypt_test.c b/SE050/wolfssl/wolfcrypt_test/wolfcrypt_test.c index 417e697f..5e2a5b9c 100644 --- a/SE050/wolfssl/wolfcrypt_test/wolfcrypt_test.c +++ b/SE050/wolfssl/wolfcrypt_test/wolfcrypt_test.c @@ -63,10 +63,14 @@ sss_status_t ex_sss_entry(ex_sss_boot_ctx_t *pCtx) LOG_I("Ran setconfig successfully"); wolfSSL_Init(); - wolfcrypt_test(NULL); + ret = wolfcrypt_test(NULL); wolfSSL_Cleanup(); - LOG_I("Ran wolfCrypt test"); + if (ret != 0) { + LOG_E("wolfCrypt test failed (%d)", ret); + return kStatus_SSS_Fail; + } + LOG_I("Ran wolfCrypt test successfully"); return status; }