Skip to content

Commit

Permalink
cli-test: Use perl instead of nc for portability.
Browse files Browse the repository at this point in the history
  • Loading branch information
glasser committed Jan 2, 2013
1 parent 45b7ff1 commit 66b0e7c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions admin/cli-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,17 @@ sleep 2 # need to make sure these kills take effect

echo "... mongo message"

nc -l localhost $(($PORT + 2)) &
NC_PID=$!
# Use perl to listen on a port, so that Mongo fails to start up. (We used to use
# nc here, but the way you specify listener ports to nc varies between
# platforms. Bleah.)
perl -MIO::Socket::INET -e '$a = IO::Socket::INET->new(LocalPort=>('$PORT' + 2),LocalAddr=>"127.0.0.1",Proto=>"tcp",ReuseAddr=>1,Listen=>5); sleep' &
PERL_PID=$!

$METEOR -p $PORT > error.txt || true

grep 'port was closed' error.txt > /dev/null

kill -9 $NC_PID > /dev/null
kill -9 $PERL_PID > /dev/null


echo "... settings"
Expand Down

0 comments on commit 66b0e7c

Please sign in to comment.