Skip to content

Commit

Permalink
Iterate on basic tests
Browse files Browse the repository at this point in the history
  • Loading branch information
consideRatio committed Mar 11, 2024
1 parent 21f0c90 commit 4ebde56
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,41 +48,42 @@ jobs:
# to this, we fallback to use the errorcode of vncsrever -list.
docker run jupyter-remote-desktop-proxy bash -c "vncserver -help || vncserver -list > /dev/null"
- name: Run vncserver, test with netcat (in container)
- name: Test vncserver with netcat
run: |
container_id=$(docker run -d --security-opt seccomp=unconfined jupyter-remote-desktop-proxy vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -localhost -fg -geometry 1680x1050 -SecurityTypes None)
container_id=$(docker run -d -p 5901:5901 --security-opt seccomp=unconfined jupyter-remote-desktop-proxy vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -localhost -fg -geometry 1680x1050 -SecurityTypes None)
sleep 3
echo "::group::Installing netcat in container"
docker exec --user root $container_id bash -c '
apt update
apt install -y netcat
'
echo "::endgroup::"
echo "::group::Testing vncserver with netcat in container"
docker exec $container_id bash -c '
nc -w 1 localhost 5901 | grep RFB
'
echo "::group::Testing vncserver with netcat"
nc -w 1 localhost 5901 2>&1 | tee -a output.txt
echo "::endgroup::"
echo "::group::vncserver logs"
docker exec $container_id bash -c "cat ~/.vnc/*.log"
echo "::endgroup::"
- name: Run vncserver wrapped by websockify, test with websocat (outside container)
docker stop $container_id > /dev/null
cat output.txt | grep --quiet RFB
- name: Test websockify'ed vncserver with websocat
run: |
container_id=$(docker run -d -p 5901:5901 --security-opt seccomp=unconfined jupyter-remote-desktop-proxy websockify --verbose --log-file=/tmp/websockify.log --heartbeat=30 5901 -- vncserver -xstartup /opt/install/jupyter_remote_desktop_proxy/share/xstartup -verbose -localhost -fg -geometry 1680x1050 -SecurityTypes None)
sleep 3
echo "::group::Testing vncserver with websocat outside container"
websocat -vv --no-async-stdio --binary --one-message --exit-on-eof 'ws://localhost:5901/'
echo "::group::Testing websockify'ed vncserver with websocat"
websocat -v --no-async-stdio --binary --one-message --exit-on-eof 'ws://localhost:5901/' 2>&1 | tee -a output.txt
echo "::endgroup::"
echo "::group::websockify logs"
docker exec $container_id bash -c "cat /tmp/websockify.log"
echo "::endgroup::"
echo "::group::vncserver logs"
docker exec $container_id bash -c "cat ~/.vnc/*.log"
echo "::endgroup::"
docker stop $container_id > /dev/null
cat output.txt | grep --quiet RFB
- name: Run basic tests and print logs
run: |
container_id=$(docker run -d -p 8888:8888 --security-opt seccomp=unconfined -e JUPYTER_TOKEN=secret jupyter-remote-desktop-proxy)
Expand Down

0 comments on commit 4ebde56

Please sign in to comment.