Browse Source

do not mix config of client and server for server-multi-passwd

auth
clowwindy 10 years ago
parent
commit
f0b0f6edff
  1. 2
      .travis.yml
  2. 8
      tests/server-multi-passwd-client-side.json
  3. 2
      tests/server-multi-passwd.json
  4. 17
      tests/test.py

2
.travis.yml

@ -21,6 +21,6 @@ script:
- python tests/test.py -c tests/rc4-md5.json
- python tests/test.py -c tests/salsa20.json
- python tests/test.py -c tests/server-multi-ports.json
- python tests/test.py -c tests/server-multi-passwd.json
- python tests/test.py -c tests/server-multi-passwd.json tests/server-multi-passwd-client-side.json
- python tests/test.py -c tests/server-multi-passwd-table.json
- python tests/test.py -c tests/workers.json

8
tests/server-multi-passwd-client-side.json

@ -0,0 +1,8 @@
{
"server": "127.0.0.1",
"server_port": "8385",
"local_port": 1081,
"password": "foobar5",
"timeout": 60,
"method": "aes-256-cfb"
}

2
tests/server-multi-passwd.json

@ -1,8 +1,6 @@
{
"server": "127.0.0.1",
"server_port": 8384,
"local_port": 1081,
"password": "foobar4",
"port_password": {
"8381": "foobar1",
"8382": "foobar2",

17
tests/test.py

@ -10,15 +10,24 @@ from subprocess import Popen, PIPE
sys.path.insert(0, './')
if sys.argv[-3] == '-c':
client_config = sys.argv[-1]
server_config = sys.argv[-2]
elif sys.argv[-2] == '-c':
client_config = sys.argv[-1]
server_config = sys.argv[-1]
else:
raise Exception('usage: test.py -c server_conf [client_conf]')
if 'salsa20' in sys.argv[-1]:
from shadowsocks.crypto import salsa20_ctr
salsa20_ctr.test()
print 'encryption test passed'
p1 = Popen(['python', 'shadowsocks/server.py', '-c', sys.argv[-1]], stdin=PIPE,
stdout=PIPE, stderr=PIPE, close_fds=True)
p2 = Popen(['python', 'shadowsocks/local.py', '-c', sys.argv[-1]], stdin=PIPE,
stdout=PIPE, stderr=PIPE, close_fds=True)
p1 = Popen(['python', 'shadowsocks/server.py', '-c', server_config],
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
p2 = Popen(['python', 'shadowsocks/local.py', '-c', client_config],
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
p3 = None
try:

Loading…
Cancel
Save