Skip to content

Commit 86f07c7

Browse files
committed
Assert the real se050 wolfcrypt result instead of an early sub-test line
1 parent 8c71295 commit 86f07c7

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

.github/scripts/se050-run.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,13 @@ echo "::group::run wolfcrypt_test against SE050Sim"
8989
simpid=$!
9090
sleep 2
9191
export SE050_SIM_HOST=127.0.0.1 SE050_SIM_PORT=8050 LD_LIBRARY_PATH=/usr/local/lib
92-
out=$("$WORK/wolfcrypt_test" 2>&1) || true
92+
rc=0
93+
out=$("$WORK/wolfcrypt_test" 2>&1) || rc=$?
9394
kill "$simpid" 2>/dev/null || true
9495
printf '%s\n' "$out" | tail -40
95-
printf '%s' "$out" | grep -qiE "Ran wolfCrypt test|Test complete|error test passed" \
96-
|| { echo "FAIL: se050 wolfcrypt_test did not report success"; exit 1; }
96+
# the demo now returns the test result and only prints this on a clean pass
97+
if [ "$rc" -ne 0 ] || ! printf '%s' "$out" | grep -q "Ran wolfCrypt test successfully"; then
98+
echo "FAIL: se050 wolfcrypt_test did not pass (rc=$rc)"; exit 1
99+
fi
97100
echo "PASS: se050 wolfcrypt_test ran against SE050Sim"
98101
echo "::endgroup::"

SE050/wolfssl/wolfcrypt_test/wolfcrypt_test.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,14 @@ sss_status_t ex_sss_entry(ex_sss_boot_ctx_t *pCtx)
6363
LOG_I("Ran setconfig successfully");
6464

6565
wolfSSL_Init();
66-
wolfcrypt_test(NULL);
66+
ret = wolfcrypt_test(NULL);
6767
wolfSSL_Cleanup();
6868

69-
LOG_I("Ran wolfCrypt test");
69+
if (ret != 0) {
70+
LOG_E("wolfCrypt test failed (%d)", ret);
71+
return kStatus_SSS_Fail;
72+
}
73+
LOG_I("Ran wolfCrypt test successfully");
7074
return status;
7175
}
7276

0 commit comments

Comments
 (0)