Skip to content

Commit

Permalink
test(24.10): fix aspnetcore test case
Browse files Browse the repository at this point in the history
  • Loading branch information
zhijie-yang committed Dec 20, 2024
1 parent 0bc0497 commit c2450c5
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions tests/spread/integration/aspnetcore-runtime-9.0/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,28 @@ execute: |
mkdir -p "${rootfs}"/proc
mount --bind /proc "${rootfs}"/proc
mkdir -p "${rootfs}"/dev
head -c 500 /dev/urandom > "${rootfs}"/dev/random
head -c 500 /dev/urandom > "${rootfs}"/dev/urandom
# test the helloworld web app
chroot "${rootfs}" dotnet /app_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" &
sleep 5
chroot "${rootfs}" dotnet /web_helloworld/bin/Release/net9.0/Hello.dll --urls="http://0.0.0.0:5108" &
app_pid=$!
# Wait for the web app to start
while ! fuser 5108/tcp > /dev/null 2>&1; do
if ! test -d /proc/$app_pid; then
echo "dotnet exited quickly"
exit 1
fi
sleep 1
done
# Send a request to the web app and verify the result
ret=0
curl http://localhost:5108/ | grep "Hello World!" || ret=1
# Cleanup
kill $app_pid
exit $ret

0 comments on commit c2450c5

Please sign in to comment.