Skip to content

Instantly share code, notes, and snippets.

@mwotton
Created February 6, 2012 01:10
Show Gist options
  • Save mwotton/1748758 to your computer and use it in GitHub Desktop.
Save mwotton/1748758 to your computer and use it in GitHub Desktop.
# we want to test that a simple echo service has a message containing
# the IP we connect with.
function cleanup {
echo "cleanup"
echo "echo: $echo_pid"
echo "gk: $gatekeeper_pid"
(($echo_pid)) && kill $echo_pid;
(($gatekeeper_pid)) && kill $gatekeeper_pid;
exit 1;
}
make echo_server gatekeeper client || cleanup ;
./echo_server tcp://localhost:8889 & echo_pid=$!
./gatekeeper 8888 8889 & export gatekeeper_pid=$!
sleep 1
./client tcp://localhost:8888 > client.out
echo "127.0.0.1" | diff - client.out
cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment