Skip to content

Commit

Permalink
Fix wasi-sockets tests
Browse files Browse the repository at this point in the history
Tests were failing because the right permissions were not provided to iwasm

Also, test failures didn't trigger build failure due to typo - also fixed in this change
  • Loading branch information
loganek committed Jul 25, 2023
1 parent 1cafa37 commit fa7ad7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions core/iwasm/libraries/lib-socket/test/nslookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ test_nslookup_mt(void *params)
{
int *af = (int *)params;
test_nslookup(*af);
return NULL;
}

int
Expand Down
14 changes: 8 additions & 6 deletions tests/wamr-test-suites/wasi-test-script/run_wasi_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ readonly TARGET=$2
readonly WORK_DIR=$PWD
readonly PLATFORM=$(uname -s | tr A-Z a-z)
readonly WAMR_DIR="${WORK_DIR}/../../../.."
readonly IWASM_CMD="${WORK_DIR}/../../../../product-mini/platforms/${PLATFORM}/build/iwasm"
readonly IWASM_CMD="${WORK_DIR}/../../../../product-mini/platforms/${PLATFORM}/build/iwasm \
--allow-resolve=google-public-dns-a.google.com \
--addr-pool=::1/128,127.0.0.1/32"
readonly WAMRC_CMD="${WORK_DIR}/../../../../wamr-compiler/build/wamrc"
readonly C_TESTS="tests/c/testsuite/"
readonly ASSEMBLYSCRIPT_TESTS="tests/assemblyscript/testsuite/"
Expand All @@ -35,20 +37,20 @@ run_aot_tests () {

echo "Running $test_aot"
expected=0
if [ -f ${test_json} ]; then
if [ -f ${test_json} ]; then
expected=$(jq .exit_code ${test_json})
fi

${IWASM_CMD} $test_aot

ret=${PIPESTATUS[0]}

echo "expected=$expected, actual=$ret"
if [[ $expected != "" ]] && [[ $expected != $ret ]];then
exit_code=1
fi
done
}
}

if [[ $MODE != "aot" ]];then
python3 -m venv wasi-env && source wasi-env/bin/activate
Expand All @@ -60,7 +62,7 @@ if [[ $MODE != "aot" ]];then
${ASSEMBLYSCRIPT_TESTS} \
${THREAD_PROPOSAL_TESTS} \
${THREAD_INTERNAL_TESTS} \
${LIB_SOCKET_TESTS} \
${LIB_SOCKET_TESTS}
exit_code=${PIPESTATUS[0]}
deactivate
else
Expand Down

0 comments on commit fa7ad7b

Please sign in to comment.