git-sync/_test_tools/ncsvr
Tim Hockin 6af1e6921d Add lint for shellcheck, fix issues 2024-07-04 15:25:25 -07:00
..
Dockerfile Make sure all code files have headers 2021-05-27 08:46:00 -07:00
README.md Use docker to run helper servers in e2e 2021-01-23 15:59:24 -08:00
ncsvr.sh Add lint for shellcheck, fix issues 2024-07-04 15:25:25 -07:00

README.md

A simple server for tests

DO NOT USE THIS FOR ANYTHING BUT TESTING!!!

How to use it

Build yourself a test image. We use example.com so you can't accidentally push it.

$ docker build -t example.com/test/test-ncvsr .
...lots of output...
Successfully tagged example.com/test/test-ncsvr:latest

Run it.

$ docker run -d example.com/test/test-ncsvr 9376 "echo hello"
6d05b4111b03c66907031e3cd7587763f0e4fab6c50fac33c4a8284732b448ae

Find your IP.

$ docker inspect 6d05b4111b03c66907031e3cd7587763f0e4fab6c50fac33c4a8284732b448ae | jq -r .[0].NetworkSettings.IPAddress
192.168.1.2

Connect to it.

$ echo "" | nc 192.168.9.2 9376
hello

If you want to know how many times it was accessed, mount a file on /var/log/hits. This will log one line per hit.