do not mix config of client and server for server-multi-passwd
This commit is contained in:
parent
81223902d0
commit
f0b0f6edff
4 changed files with 22 additions and 7 deletions
|
@ -21,6 +21,6 @@ script:
|
||||||
- python tests/test.py -c tests/rc4-md5.json
|
- python tests/test.py -c tests/rc4-md5.json
|
||||||
- python tests/test.py -c tests/salsa20.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-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/server-multi-passwd-table.json
|
||||||
- python tests/test.py -c tests/workers.json
|
- python tests/test.py -c tests/workers.json
|
||||||
|
|
8
tests/server-multi-passwd-client-side.json
Normal file
8
tests/server-multi-passwd-client-side.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"server": "127.0.0.1",
|
||||||
|
"server_port": "8385",
|
||||||
|
"local_port": 1081,
|
||||||
|
"password": "foobar5",
|
||||||
|
"timeout": 60,
|
||||||
|
"method": "aes-256-cfb"
|
||||||
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
{
|
{
|
||||||
"server": "127.0.0.1",
|
"server": "127.0.0.1",
|
||||||
"server_port": 8384,
|
|
||||||
"local_port": 1081,
|
"local_port": 1081,
|
||||||
"password": "foobar4",
|
|
||||||
"port_password": {
|
"port_password": {
|
||||||
"8381": "foobar1",
|
"8381": "foobar1",
|
||||||
"8382": "foobar2",
|
"8382": "foobar2",
|
||||||
|
|
|
@ -10,15 +10,24 @@ from subprocess import Popen, PIPE
|
||||||
|
|
||||||
sys.path.insert(0, './')
|
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]:
|
if 'salsa20' in sys.argv[-1]:
|
||||||
from shadowsocks.crypto import salsa20_ctr
|
from shadowsocks.crypto import salsa20_ctr
|
||||||
salsa20_ctr.test()
|
salsa20_ctr.test()
|
||||||
print 'encryption test passed'
|
print 'encryption test passed'
|
||||||
|
|
||||||
p1 = Popen(['python', 'shadowsocks/server.py', '-c', sys.argv[-1]], stdin=PIPE,
|
p1 = Popen(['python', 'shadowsocks/server.py', '-c', server_config],
|
||||||
stdout=PIPE, stderr=PIPE, close_fds=True)
|
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
|
||||||
p2 = Popen(['python', 'shadowsocks/local.py', '-c', sys.argv[-1]], stdin=PIPE,
|
p2 = Popen(['python', 'shadowsocks/local.py', '-c', client_config],
|
||||||
stdout=PIPE, stderr=PIPE, close_fds=True)
|
stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=True)
|
||||||
p3 = None
|
p3 = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Reference in a new issue