From 7c382843349b39e7ed4f1be6424e5d022973cf8a Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Wed, 15 Nov 2017 23:10:46 +0900 Subject: [PATCH 1/3] tests: Update default dns setting in tests Set default dns to 8.8.8.8 for tests/test.py --- tests/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test.py b/tests/test.py index 3f2f6010..823a9509 100755 --- a/tests/test.py +++ b/tests/test.py @@ -35,7 +35,7 @@ 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') config = parser.parse_args() From ad76fd526e2f18fc9a68d50298019e18e9400835 Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Thu, 16 Nov 2017 00:10:33 +0900 Subject: [PATCH 2/3] tests: Add param --bin to specify the binrary path Default is to use the system installed version, in $PATH. --- tests/test.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test.py b/tests/test.py index 823a9509..0a1297b8 100755 --- a/tests/test.py +++ b/tests/test.py @@ -36,12 +36,13 @@ 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='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]) From fc11e6ae8ac5ea457279eecba75b131afd4c00fe Mon Sep 17 00:00:00 2001 From: Roger Shimizu Date: Thu, 16 Nov 2017 00:32:16 +0900 Subject: [PATCH 3/3] tests: run tests binary either in src/ folder or system --- tests/test.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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