From 4651184e1f84c1e9100ba95b7e0f119a3da991f7 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Wed, 14 Oct 2026 20:10:15 +0800 Subject: [PATCH] test.py: accept host:port for --dns The tunnel test hard-coded port 53, so it could only use a public resolver or root. With a port it runs against a local DNS stand-in. --- tests/test.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test.py b/tests/test.py index 6e7cb815..a208e209 100755 --- a/tests/test.py +++ b/tests/test.py @@ -35,14 +35,16 @@ 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='8.8.8.8') +parser.add_argument('--dns', type=str, default='8.8.8.8', + help='DNS server for the tunnel test, host or host:port (default port 53)') parser.add_argument('--bin', type=str, default='') config = parser.parse_args() 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] +dns_target = config.dns if config.dns.count(':') == 1 else '%s:53' % config.dns +tunnel_args = ['%s%s' % (config.bin, 'ss-tunnel'), '-v', '-u', '-l1082', '-L%s' % dns_target] if config.client_conf: client_args.extend(['-c', config.client_conf])