Skip to content

Commit

Permalink
Use Python instead of Perl.
Browse files Browse the repository at this point in the history
  • Loading branch information
glasser committed Jan 3, 2013
1 parent 8231783 commit f3940ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions admin/cli-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@ sleep 2 # need to make sure these kills take effect

echo "... mongo message"

# 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
# Use Python 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) or die; sleep' &
PERL_PID=$!
python -c 'from socket import *; s = socket(); s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1); s.bind(("127.0.0.1", '$PORT'+2)); s.listen(1); s.accept()' &
PYTHON_PID=$!

sleep 1

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

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

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


echo "... settings"
Expand Down

0 comments on commit f3940ca

Please sign in to comment.