Allow test programs use custom port using environment variable or command-line argument

master
Andriy Senkovych 11 years ago
parent 290a188067
commit 3156b530af

@ -6,9 +6,9 @@ try:
except:
msgpack = None
host = '127.0.0.1'
port = 7379
import os
host = os.getenv('WEBDIS_HOST', '127.0.0.1')
port = int(os.getenv('WEBDIS_PORT', 7379))
class TestWebdis(unittest.TestCase):

@ -1,8 +1,12 @@
#!/bin/bash
CLIENTS=100
REQUESTS=100000
HOST=127.0.0.1
PORT=7379
HOST=$WEBDIS_HOST
PORT=$WEBDIS_PORT
[ -n $HOST ] && HOST=127.0.0.1
[ -n $PORT ] && PORT=7379
info() {
echo "Testing on $HOST:$PORT with $CLIENTS clients in parallel, for a total of $REQUESTS requests per benchmark."

@ -2,8 +2,9 @@
import socket
import unittest
HOST = "127.0.0.1"
PORT = 7379
import os
HOST = os.getenv('WEBDIS_HOST', '127.0.0.1')
PORT = int(os.getenv('WEBDIS_PORT', 7379))
class BlockingSocket:

Loading…
Cancel
Save