Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Mar 12, 2024
1 parent 5bbc61b commit 2c5c6df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions 1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ sleep 3
# '
# echo "::endgroup::"

docker exec $container_id bash -c 'timeout --preserve-status 1 nc -v 127.0.0.1 5901' 2>&1 | \
docker exec $container_id bash -c 'timeout --preserve-status 1 nc -v localhost 5901' 2>&1 | \
grep --quiet RFB && echo "Passed inside test" || { echo "Failed inside test" && TEST_OK=false; }

timeout --preserve-status 1 nc -v 127.0.0.1 5901 2>&1 | \
timeout --preserve-status 1 nc -v localhost 5901 2>&1 | \
grep --quiet RFB && echo "Passed outside test" || { echo "Failed outside test" && TEST_OK=false; }

echo "netstat inside container"
Expand Down
4 changes: 2 additions & 2 deletions 2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ sleep 3
# '
# echo "::endgroup::"

docker exec $container_id bash -c 'websocat --binary --one-message --exit-on-eof "ws://127.0.0.1:5901/"' 2>&1 | \
docker exec $container_id bash -c 'websocat --binary --one-message --exit-on-eof "ws://localhost:5901/"' 2>&1 | \
grep --quiet RFB && echo "Passed inside test" || { echo "Failed inside test" && TEST_OK=false; }

websocat --binary --one-message --exit-on-eof "ws://127.0.0.1:5901/" 2>&1 | \
websocat --binary --one-message --exit-on-eof "ws://localhost:5901/" 2>&1 | \
grep --quiet RFB && echo "Passed outside test" || { echo "Failed outside test" && TEST_OK=false; }

echo "netstat inside container"
Expand Down
8 changes: 4 additions & 4 deletions 3.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
container_id=$(docker run -d -p 0.0.0.0:8888:8888 -e JUPYTER_TOKEN=secret quay.io/consideratio/test:turbo)
sleep 5

curl --silent --fail 'http://127.0.0.1:8888/desktop/?token=secret' | grep --quiet 'Jupyter Remote Desktop Proxy' && echo "Passed get index.html test" || { echo "Failed" && TEST_OK=false; }
curl --silent --fail 'http://127.0.0.1:8888/desktop/static/dist/viewer.js?token=secret' > /dev/null && echo "Passed get viewer.js test" || { echo "Failed" && TEST_OK=false; }
curl --silent --fail 'http://localhost:8888/desktop/?token=secret' | grep --quiet 'Jupyter Remote Desktop Proxy' && echo "Passed get index.html test" || { echo "Failed" && TEST_OK=false; }
curl --silent --fail 'http://localhost:8888/desktop/static/dist/viewer.js?token=secret' > /dev/null && echo "Passed get viewer.js test" || { echo "Failed" && TEST_OK=false; }

websocat --binary --one-message --exit-on-eof 'ws://127.0.0.1:8888/desktop-websockify/?token=secret' | \
websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' | \
grep --quiet RFB && echo "Passed initial websocket test" || { \
echo "Failed initial websocket test" && sleep 3 && websocat --binary --one-message --exit-on-eof 'ws://127.0.0.1:8888/desktop-websockify/?token=secret' | grep --quiet RFB && echo "Passed second websocket test" || { echo "Failed second websocket test" && TEST_OK=false; } \
echo "Failed initial websocket test" && sleep 3 && websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' | grep --quiet RFB && echo "Passed second websocket test" || { echo "Failed second websocket test" && TEST_OK=false; } \
}

echo "netstat inside container"
Expand Down

0 comments on commit 2c5c6df

Please sign in to comment.