diff --git a/tests/test.py b/tests/test.py index 3f2f6010..0a1297b8 100755 --- a/tests/test.py +++ b/tests/test.py @@ -35,13 +35,14 @@ parser.add_argument('-a', '--client-args', type=str, default=None) parser.add_argument('-b', '--server-args', type=str, default=None) parser.add_argument('--should-fail', action='store_true', default=None) parser.add_argument('--url', type=str, default=default_url) -parser.add_argument('--dns', type=str, default='10.19.185.252') +parser.add_argument('--dns', type=str, default='8.8.8.8') +parser.add_argument('--bin', type=str, default='') config = parser.parse_args() -client_args = ['src/ss-local', '-v'] -server_args = ['src/ss-server', '-v', '-u'] -tunnel_args = ['src/ss-tunnel', '-v', '-u', '-l1082', '-L%s:53' % config.dns] +client_args = ['%s%s' % (config.bin, 'ss-local'), '-v'] +server_args = ['%s%s' % (config.bin, 'ss-server'), '-v', '-u'] +tunnel_args = ['%s%s' % (config.bin, 'ss-tunnel'), '-v', '-u', '-l1082', '-L%s:53' % config.dns] if config.client_conf: client_args.extend(['-c', config.client_conf]) diff --git a/tests/test.sh b/tests/test.sh index 684e9d4b..1dcd15fc 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -24,13 +24,16 @@ function run_test { return 0 } -run_test python tests/test.py -c tests/aes.json -run_test python tests/test.py -c tests/aes-gcm.json -run_test python tests/test.py -c tests/aes-ctr.json -run_test python tests/test.py -c tests/rc4-md5.json -run_test python tests/test.py -c tests/salsa20.json -run_test python tests/test.py -c tests/chacha20.json -run_test python tests/test.py -c tests/chacha20-ietf.json -run_test python tests/test.py -c tests/chacha20-ietf-poly1305.json +[ -d src -a -x src/ss-local ] && + BIN="--bin src/" + +run_test python tests/test.py $BIN -c tests/aes.json +run_test python tests/test.py $BIN -c tests/aes-gcm.json +run_test python tests/test.py $BIN -c tests/aes-ctr.json +run_test python tests/test.py $BIN -c tests/rc4-md5.json +run_test python tests/test.py $BIN -c tests/salsa20.json +run_test python tests/test.py $BIN -c tests/chacha20.json +run_test python tests/test.py $BIN -c tests/chacha20-ietf.json +run_test python tests/test.py $BIN -c tests/chacha20-ietf-poly1305.json exit $result