Skip to content

Commit

Permalink
Update make_request_for_sequenced_responses_using_websocat.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
azagniotov authored Feb 5, 2024
1 parent 0ac2988 commit a480232
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,19 @@ fi

websocat --text --exit-on-eof --protocol "zumba" -q -uU tcp-l:127.0.0.1:1234 reuse-raw:$1://$2:$3/ws/hello-world/2 --max-messages-rev 1&

echo ""
echo "#####################################################################"
echo "## WebSoCat is TCP listening on 127.0.0.1:1234"
echo "#####################################################################"


smoke_test_sequenced_response=$(echo "Hello, World!" | nc 127.0.0.1 1234 2> /dev/null; echo $?)
echo ""
echo "#####################################################################"
echo "## Got $smoke_test_sequenced_response"
echo "#####################################################################"


if [ "$smoke_test_sequenced_response" != "world-0" ]
then
echo "WebSocket request to $2:$3 failed, got: $smoke_test_sequenced_response ... Exiting with status 1 ... "
Expand All @@ -41,6 +53,11 @@ else
exit 0
fi

echo ""
echo "#####################################################################"
echo "## Got $smoke_test_sequenced_response"
echo "#####################################################################"

smoke_test_sequenced_response=$(echo "Hello, World!" | nc 127.0.0.1 1234 2> /dev/null; echo $?)
if [ "$smoke_test_sequenced_response" != "world-1" ]
then
Expand Down

0 comments on commit a480232

Please sign in to comment.