Last active
September 12, 2015 19:01
-
-
Save marko-asplund/aa7883dbbbc1a8be1580 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import socket | |
sock = socket.socket() | |
sock.connect(("127.0.0.1", 26542)) | |
ss = sock.makefile() | |
for i in range(1, 5000000): | |
ss.write("| %i:2\n" % i) | |
ss.flush() | |
l = ss.readline() | |
if len(l) < 1: | |
print "error: '%s'" % l | |
sys.exit(1) | |
print "ok %i, %i" % (i, len(l)) | |
ss.close | |
sock.close |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in `seq 1 500000`; do | |
res=$(echo "| $i:2" | nc localhost 26542) | |
siz=$(echo "$res" | wc -c) | |
if [ "$siz" -lt "1" ]; then | |
echo "error response: $i, $siz, '$res'" | |
exit 1 | |
else | |
echo "ok $i" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment