Skip to content

Commit

Permalink
asdf
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Mar 29, 2024
1 parent b725956 commit d52e08e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 8 deletions.
45 changes: 42 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,54 @@ jobs:
- name: "1"
if: always()
run: |
bash +o pipefail 1.sh
container_id=$(docker run -d -p 5901:5901 quay.io/consideratio/test:turbo vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbport 5901)
sleep 1
timeout --preserve-status 1 nc -v localhost 5901 2>&1 | \
grep --quiet RFB && echo "Passed test" || { echo "Failed test" && TEST_OK=false; }
docker stop $container_id > /dev/null
if [ "$TEST_OK" == "false" ]; then
echo "One or more tests failed!"
exit 1
fi
- name: "2"
if: always()
run: |
bash +o pipefail 2.sh
container_id=$(docker run -d -p 5901:5901 quay.io/consideratio/test:turbo websockify --verbose --log-file=/tmp/websockify.log --heartbeat=30 5901 -- vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbport 5901)
sleep 1
websocat --binary --one-message --exit-on-eof "ws://localhost:5901/" 2>&1 | \
grep --quiet RFB && echo "Passed test" || { echo "Failed test" && TEST_OK=false; }
docker stop $container_id > /dev/null
if [ "$TEST_OK" == "false" ]; then
echo "One or more tests failed!"
exit 1
fi
- name: "3"
if: always()
run: |
bash +o pipefail 3.sh
container_id=$(docker run -d -p 8888:8888 -e JUPYTER_TOKEN=secret quay.io/consideratio/test:turbo)
sleep 3
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://localhost:8888/desktop-websockify/?token=secret' | \
grep --quiet RFB && echo "Passed initial websocket test" || { \
echo "Failed initial websocket test" && sleep 1 && 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; } \
}
timeout 5 docker stop $container_id > /dev/null && echo "Passed SIGTERM test" || { echo "Failed" && TEST_OK=false; }
if [ "$TEST_OK" == "false" ]; then
echo "One or more tests failed!"
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion 1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ container_id=$(docker run -d -p 5901:5901 quay.io/consideratio/test:turbo vncser
sleep 1

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

docker stop $container_id > /dev/null
if [ "$TEST_OK" == "false" ]; then
Expand Down
2 changes: 1 addition & 1 deletion 2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ container_id=$(docker run -d -p 5901:5901 quay.io/consideratio/test:turbo websoc
sleep 1

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

docker stop $container_id > /dev/null
if [ "$TEST_OK" == "false" ]; then
Expand Down
6 changes: 3 additions & 3 deletions 3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ curl --silent --fail 'http://localhost:8888/desktop/?token=secret' | grep --quie
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://localhost:8888/desktop-websockify/?token=secret' | \
grep --quiet RFB && echo "Passed initial websocket test" || { \
echo "Failed initial websocket test" && sleep 1 && 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; } \
}
grep --quiet RFB && echo "Passed initial websocket test" || { \
echo "Failed initial websocket test" && sleep 1 && 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; } \
}

timeout 5 docker stop $container_id > /dev/null && echo "Passed SIGTERM test" || { echo "Failed" && TEST_OK=false; }

Expand Down

0 comments on commit d52e08e

Please sign in to comment.