Skip to content

Commit

Permalink
asdfj
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Mar 12, 2024
1 parent b466762 commit 6e89f4c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,14 @@ jobs:
cat output-outside.txt | grep --quiet RFB && echo "Passed outside test" || { echo "Failed outside test" && TEST_OK=false; }
echo "::endgroup::"
echo "::group::vncserver logs"
docker exec $container_id bash -c "cat ~/.vnc/*.log"
echo "::endgroup::"
# echo "::group::vncserver logs"
# docker exec $container_id bash -c "cat ~/.vnc/*.log"
# echo "::endgroup::"
echo "netstat inside container"
docker exec $container_id netstat -na --tcp | grep -E "(:5901|:5902)"
echo "netstat outside container"
netstat -na --tcp | grep -E "(:5901|:5902)"
docker stop $container_id > /dev/null
if [ "$TEST_OK" == "false" ]; then
Expand Down
2 changes: 1 addition & 1 deletion 1.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# container_id=$(docker run -d -p 5901:5901 --security-opt seccomp=unconfined quay.io/consideratio/test:turbo vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -fg -geometry 1680x1050 -SecurityTypes None -rfbport 5901)
container_id=$(docker run -d -p 5901:5901 -v $(pwd):/mnt/test quay.io/consideratio/test:turbo python /mnt/test/dummy-tcp-server.py)
container_id=$(docker run -d -p 127.0.0.1:5901:5901 -v $(pwd):/mnt/test quay.io/consideratio/test:turbo python /mnt/test/dummy-tcp-server.py)
sleep 3

# echo "::group::Installing netcat (inside container)"
Expand Down
6 changes: 3 additions & 3 deletions 2.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# container_id=$(docker run -d -p 5901:5901 --security-opt seccomp=unconfined 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)
container_id=$(docker run -d -p 5901:5901 -v $(pwd):/mnt/test quay.io/consideratio/test:turbo websockify --verbose --log-file=/tmp/websockify.log --heartbeat=30 127.0.0.1:5901 -- python /mnt/test/dummy-tcp-server.py)
container_id=$(docker run -d -p 127.0.0.1:5901:5901 -v $(pwd):/mnt/test quay.io/consideratio/test:turbo websockify --verbose --log-file=/tmp/websockify.log --heartbeat=30 127.0.0.1:5901 -- python /mnt/test/dummy-tcp-server.py)
sleep 3

# echo "::group::Installing websocat (inside container)"
Expand All @@ -10,10 +10,10 @@ sleep 3
# '
# echo "::endgroup::"

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

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

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; }
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; }

websocat --binary --one-message --exit-on-eof 'ws://localhost:8888/desktop-websockify/?token=secret' | \
websocat --binary --one-message --exit-on-eof 'ws://127.0.0.1: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://localhost: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://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 "netstat inside container"
Expand Down

0 comments on commit 6e89f4c

Please sign in to comment.