| Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python | 
|  | 2 |  | 
| David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 3 | # | 
|  | 4 | # Licensed to the Apache Software Foundation (ASF) under one | 
|  | 5 | # or more contributor license agreements. See the NOTICE file | 
|  | 6 | # distributed with this work for additional information | 
|  | 7 | # regarding copyright ownership. The ASF licenses this file | 
|  | 8 | # to you under the Apache License, Version 2.0 (the | 
|  | 9 | # "License"); you may not use this file except in compliance | 
|  | 10 | # with the License. You may obtain a copy of the License at | 
|  | 11 | # | 
|  | 12 | #   http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 13 | # | 
|  | 14 | # Unless required by applicable law or agreed to in writing, | 
|  | 15 | # software distributed under the License is distributed on an | 
|  | 16 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | 
|  | 17 | # KIND, either express or implied. See the License for the | 
|  | 18 | # specific language governing permissions and limitations | 
|  | 19 | # under the License. | 
|  | 20 | # | 
|  | 21 |  | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 22 | from __future__ import division | 
| Nobuaki Sukegawa | 760511f | 2015-11-06 21:24:16 +0900 | [diff] [blame] | 23 | from __future__ import print_function | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 24 | import copy | 
|  | 25 | import glob | 
|  | 26 | import os | 
|  | 27 | import signal | 
| Roger Meier | 9b32853 | 2014-04-21 21:22:54 +0200 | [diff] [blame] | 28 | import socket | 
| Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 29 | import subprocess | 
|  | 30 | import sys | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 31 | import time | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 32 | from optparse import OptionParser | 
|  | 33 |  | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 34 | SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) | 
|  | 35 | ROOT_DIR = os.path.dirname(os.path.dirname(SCRIPT_DIR)) | 
|  | 36 | DEFAULT_LIBDIR_GLOB = os.path.join(ROOT_DIR, 'lib', 'py', 'build', 'lib.*') | 
|  | 37 | DEFAULT_LIBDIR_PY3 = os.path.join(ROOT_DIR, 'lib', 'py', 'build', 'lib') | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 38 |  | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 39 | SCRIPTS = [ | 
| Nobuaki Sukegawa | 7b89469 | 2015-12-23 21:45:06 +0900 | [diff] [blame] | 40 | 'FastbinaryTest.py', | 
| Nobuaki Sukegawa | e841b3d | 2015-11-17 11:01:17 +0900 | [diff] [blame] | 41 | 'TestFrozen.py', | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 42 | 'TSimpleJSONProtocolTest.py', | 
|  | 43 | 'SerializationTest.py', | 
|  | 44 | 'TestEof.py', | 
|  | 45 | 'TestSyntax.py', | 
|  | 46 | 'TestSocket.py', | 
|  | 47 | ] | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 48 | FRAMED = ["TNonblockingServer"] | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 49 | SKIP_ZLIB = ['TNonblockingServer', 'THttpServer'] | 
|  | 50 | SKIP_SSL = ['TNonblockingServer', 'THttpServer'] | 
| Roger Meier | 6857b7f | 2015-09-16 19:53:07 +0200 | [diff] [blame] | 51 | EXTRA_DELAY = dict(TProcessPoolServer=5.5) | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 52 |  | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 53 | PROTOS = [ | 
|  | 54 | 'accel', | 
|  | 55 | 'binary', | 
|  | 56 | 'compact', | 
|  | 57 | 'json', | 
|  | 58 | ] | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 59 |  | 
|  | 60 | SERVERS = [ | 
|  | 61 | "TSimpleServer", | 
|  | 62 | "TThreadedServer", | 
|  | 63 | "TThreadPoolServer", | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 64 | "TProcessPoolServer", | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 65 | "TForkingServer", | 
|  | 66 | "TNonblockingServer", | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 67 | "THttpServer", | 
|  | 68 | ] | 
| Bryan Duxbury | 59d4efd | 2011-03-21 17:38:22 +0000 | [diff] [blame] | 69 |  | 
| Mark Slee | 5299a95 | 2007-10-05 00:13:24 +0000 | [diff] [blame] | 70 |  | 
| David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame] | 71 | def relfile(fname): | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 72 | return os.path.join(SCRIPT_DIR, fname) | 
| David Reiss | 2a4bfd6 | 2008-04-07 23:45:00 +0000 | [diff] [blame] | 73 |  | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 74 |  | 
|  | 75 | def setup_pypath(dirs): | 
|  | 76 | env = copy.copy(os.environ) | 
|  | 77 | pypath = env.get('PYTHONPATH', None) | 
|  | 78 | if pypath: | 
|  | 79 | dirs.append(pypath) | 
|  | 80 | env['PYTHONPATH'] = ':'.join(dirs) | 
|  | 81 | return env | 
|  | 82 |  | 
|  | 83 |  | 
|  | 84 | def runScriptTest(libdir, genpydir, script): | 
|  | 85 | env = setup_pypath([libdir, genpydir]) | 
|  | 86 | script_args = [sys.executable, relfile(script)] | 
| Nobuaki Sukegawa | 760511f | 2015-11-06 21:24:16 +0900 | [diff] [blame] | 87 | print('\nTesting script: %s\n----' % (' '.join(script_args))) | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 88 | ret = subprocess.call(script_args, env=env) | 
| Roger Meier | f4eec7a | 2011-09-11 18:16:21 +0000 | [diff] [blame] | 89 | if ret != 0: | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 90 | print('*** FAILED ***', file=sys.stderr) | 
|  | 91 | print('LIBDIR: %s' % libdir, file=sys.stderr) | 
|  | 92 | print('PY_GEN: %s' % genpydir, file=sys.stderr) | 
|  | 93 | print('SCRIPT: %s' % script, file=sys.stderr) | 
| Roger Meier | f4eec7a | 2011-09-11 18:16:21 +0000 | [diff] [blame] | 94 | raise Exception("Script subprocess failed, retcode=%d, args: %s" % (ret, ' '.join(script_args))) | 
| Roger Meier | 7615072 | 2014-05-31 22:22:07 +0200 | [diff] [blame] | 95 |  | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 96 |  | 
|  | 97 | def runServiceTest(libdir, genpydir, server_class, proto, port, use_zlib, use_ssl, verbose): | 
|  | 98 | env = setup_pypath([libdir, genpydir]) | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 99 | # Build command line arguments | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 100 | server_args = [sys.executable, relfile('TestServer.py')] | 
|  | 101 | cli_args = [sys.executable, relfile('TestClient.py')] | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 102 | for which in (server_args, cli_args): | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 103 | which.append('--protocol=%s' % proto)  # accel, binary, compact or json | 
|  | 104 | which.append('--port=%d' % port)  # default to 9090 | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 105 | if use_zlib: | 
|  | 106 | which.append('--zlib') | 
|  | 107 | if use_ssl: | 
|  | 108 | which.append('--ssl') | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 109 | if verbose == 0: | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 110 | which.append('-q') | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 111 | if verbose == 2: | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 112 | which.append('-v') | 
|  | 113 | # server-specific option to select server class | 
|  | 114 | server_args.append(server_class) | 
|  | 115 | # client-specific cmdline options | 
|  | 116 | if server_class in FRAMED: | 
| Roger Meier | 7615072 | 2014-05-31 22:22:07 +0200 | [diff] [blame] | 117 | cli_args.append('--transport=framed') | 
|  | 118 | else: | 
|  | 119 | cli_args.append('--transport=buffered') | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 120 | if server_class == 'THttpServer': | 
|  | 121 | cli_args.append('--http=/') | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 122 | if verbose > 0: | 
| Nobuaki Sukegawa | 760511f | 2015-11-06 21:24:16 +0900 | [diff] [blame] | 123 | print('Testing server %s: %s' % (server_class, ' '.join(server_args))) | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 124 | serverproc = subprocess.Popen(server_args, env=env) | 
| Roger Meier | 9b32853 | 2014-04-21 21:22:54 +0200 | [diff] [blame] | 125 |  | 
|  | 126 | def ensureServerAlive(): | 
|  | 127 | if serverproc.poll() is not None: | 
| Nobuaki Sukegawa | 760511f | 2015-11-06 21:24:16 +0900 | [diff] [blame] | 128 | print(('FAIL: Server process (%s) failed with retcode %d') | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 129 | % (' '.join(server_args), serverproc.returncode)) | 
| Roger Meier | 9b32853 | 2014-04-21 21:22:54 +0200 | [diff] [blame] | 130 | raise Exception('Server subprocess %s died, args: %s' | 
|  | 131 | % (server_class, ' '.join(server_args))) | 
|  | 132 |  | 
|  | 133 | # Wait for the server to start accepting connections on the given port. | 
|  | 134 | sock = socket.socket() | 
|  | 135 | sleep_time = 0.1  # Seconds | 
|  | 136 | max_attempts = 100 | 
|  | 137 | try: | 
|  | 138 | attempt = 0 | 
|  | 139 | while sock.connect_ex(('127.0.0.1', port)) != 0: | 
|  | 140 | attempt += 1 | 
|  | 141 | if attempt >= max_attempts: | 
|  | 142 | raise Exception("TestServer not ready on port %d after %.2f seconds" | 
|  | 143 | % (port, sleep_time * attempt)) | 
|  | 144 | ensureServerAlive() | 
|  | 145 | time.sleep(sleep_time) | 
|  | 146 | finally: | 
|  | 147 | sock.close() | 
|  | 148 |  | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 149 | try: | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 150 | if verbose > 0: | 
| Nobuaki Sukegawa | 760511f | 2015-11-06 21:24:16 +0900 | [diff] [blame] | 151 | print('Testing client: %s' % (' '.join(cli_args))) | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 152 | ret = subprocess.call(cli_args, env=env) | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 153 | if ret != 0: | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 154 | print('*** FAILED ***', file=sys.stderr) | 
|  | 155 | print('LIBDIR: %s' % libdir, file=sys.stderr) | 
|  | 156 | print('PY_GEN: %s' % genpydir, file=sys.stderr) | 
| Bryan Duxbury | 1606659 | 2011-03-22 18:06:04 +0000 | [diff] [blame] | 157 | raise Exception("Client subprocess failed, retcode=%d, args: %s" % (ret, ' '.join(cli_args))) | 
|  | 158 | finally: | 
|  | 159 | # check that server didn't die | 
| Roger Meier | 9b32853 | 2014-04-21 21:22:54 +0200 | [diff] [blame] | 160 | ensureServerAlive() | 
|  | 161 | extra_sleep = EXTRA_DELAY.get(server_class, 0) | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 162 | if extra_sleep > 0 and verbose > 0: | 
| Nobuaki Sukegawa | 760511f | 2015-11-06 21:24:16 +0900 | [diff] [blame] | 163 | print('Giving %s (proto=%s,zlib=%s,ssl=%s) an extra %d seconds for child' | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 164 | 'processes to terminate via alarm' | 
|  | 165 | % (server_class, proto, use_zlib, use_ssl, extra_sleep)) | 
| Roger Meier | 9b32853 | 2014-04-21 21:22:54 +0200 | [diff] [blame] | 166 | time.sleep(extra_sleep) | 
|  | 167 | os.kill(serverproc.pid, signal.SIGKILL) | 
|  | 168 | serverproc.wait() | 
| David Reiss | bcaa2ad | 2008-06-10 22:55:26 +0000 | [diff] [blame] | 169 |  | 
| Roger Meier | 7615072 | 2014-05-31 22:22:07 +0200 | [diff] [blame] | 170 |  | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 171 | class TestCases(object): | 
|  | 172 | def __init__(self, libdir, port, gendirs, servers, verbose): | 
|  | 173 | self.libdir = libdir | 
|  | 174 | self.port = port | 
|  | 175 | self.verbose = verbose | 
|  | 176 | self.gendirs = gendirs | 
|  | 177 | self.servers = servers | 
|  | 178 |  | 
|  | 179 | def default_conf(self): | 
|  | 180 | return { | 
|  | 181 | 'gendir': self.gendirs[0], | 
|  | 182 | 'server': self.servers[0], | 
|  | 183 | 'proto': PROTOS[0], | 
|  | 184 | 'zlib': False, | 
|  | 185 | 'ssl': False, | 
|  | 186 | } | 
|  | 187 |  | 
|  | 188 | def run(self, conf, test_count): | 
|  | 189 | with_zlib = conf['zlib'] | 
|  | 190 | with_ssl = conf['ssl'] | 
|  | 191 | try_server = conf['server'] | 
|  | 192 | try_proto = conf['proto'] | 
|  | 193 | genpydir = conf['gendir'] | 
|  | 194 | # skip any servers that don't work with the Zlib transport | 
|  | 195 | if with_zlib and try_server in SKIP_ZLIB: | 
|  | 196 | return False | 
|  | 197 | # skip any servers that don't work with SSL | 
|  | 198 | if with_ssl and try_server in SKIP_SSL: | 
|  | 199 | return False | 
|  | 200 | if self.verbose > 0: | 
|  | 201 | print('\nTest run #%d:  (includes %s) Server=%s,  Proto=%s,  zlib=%s,  SSL=%s' | 
|  | 202 | % (test_count, genpydir, try_server, try_proto, with_zlib, with_ssl)) | 
|  | 203 | runServiceTest(self.libdir, genpydir, try_server, try_proto, self.port, with_zlib, with_ssl, self.verbose) | 
|  | 204 | if self.verbose > 0: | 
|  | 205 | print('OK: Finished (includes %s)  %s / %s proto / zlib=%s / SSL=%s.   %d combinations tested.' | 
|  | 206 | % (genpydir, try_server, try_proto, with_zlib, with_ssl, test_count)) | 
|  | 207 | return True | 
|  | 208 |  | 
|  | 209 | def test_feature(self, name, values): | 
|  | 210 | test_count = 0 | 
|  | 211 | conf = self.default_conf() | 
|  | 212 | for try_server in values: | 
|  | 213 | conf[name] = try_server | 
|  | 214 | if self.run(conf, test_count): | 
|  | 215 | test_count += 1 | 
|  | 216 | return test_count | 
|  | 217 |  | 
|  | 218 | def run_all_tests(self): | 
|  | 219 | test_count = 0 | 
|  | 220 | for try_server in self.servers: | 
|  | 221 | for genpydir in self.gendirs: | 
|  | 222 | for try_proto in PROTOS: | 
|  | 223 | for with_zlib in (False, True): | 
|  | 224 | # skip any servers that don't work with the Zlib transport | 
|  | 225 | if with_zlib and try_server in SKIP_ZLIB: | 
|  | 226 | continue | 
|  | 227 | for with_ssl in (False, True): | 
|  | 228 | # skip any servers that don't work with SSL | 
|  | 229 | if with_ssl and try_server in SKIP_SSL: | 
|  | 230 | continue | 
|  | 231 | test_count += 1 | 
|  | 232 | if self.verbose > 0: | 
|  | 233 | print('\nTest run #%d:  (includes %s) Server=%s,  Proto=%s,  zlib=%s,  SSL=%s' | 
|  | 234 | % (test_count, genpydir, try_server, try_proto, with_zlib, with_ssl)) | 
|  | 235 | runServiceTest(self.libdir, genpydir, try_server, try_proto, self.port, with_zlib, with_ssl) | 
|  | 236 | if self.verbose > 0: | 
|  | 237 | print('OK: Finished (includes %s)  %s / %s proto / zlib=%s / SSL=%s.   %d combinations tested.' | 
|  | 238 | % (genpydir, try_server, try_proto, with_zlib, with_ssl, test_count)) | 
|  | 239 | return test_count | 
|  | 240 |  | 
|  | 241 |  | 
|  | 242 | def default_libdir(): | 
|  | 243 | if sys.version_info[0] == 2: | 
|  | 244 | return glob.glob(DEFAULT_LIBDIR_GLOB)[0] | 
|  | 245 | else: | 
|  | 246 | return DEFAULT_LIBDIR_PY3 | 
|  | 247 |  | 
|  | 248 |  | 
|  | 249 | def main(): | 
|  | 250 | parser = OptionParser() | 
|  | 251 | parser.add_option('--all', action="store_true", dest='all') | 
|  | 252 | parser.add_option('--genpydirs', type='string', dest='genpydirs', | 
| Nobuaki Sukegawa | b78d781 | 2015-12-24 00:01:26 +0900 | [diff] [blame] | 253 | default='default,slots,oldstyle,dynamic,dynamicslots', | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 254 | help='directory extensions for generated code, used as suffixes for \"gen-py-*\" added sys.path for individual tests') | 
|  | 255 | parser.add_option("--port", type="int", dest="port", default=9090, | 
|  | 256 | help="port number for server to listen on") | 
|  | 257 | parser.add_option('-v', '--verbose', action="store_const", | 
|  | 258 | dest="verbose", const=2, | 
|  | 259 | help="verbose output") | 
|  | 260 | parser.add_option('-q', '--quiet', action="store_const", | 
|  | 261 | dest="verbose", const=0, | 
|  | 262 | help="minimal output") | 
|  | 263 | parser.add_option('-L', '--libdir', dest="libdir", default=default_libdir(), | 
|  | 264 | help="directory path that contains Thrift Python library") | 
|  | 265 | parser.set_defaults(verbose=1) | 
|  | 266 | options, args = parser.parse_args() | 
|  | 267 |  | 
|  | 268 | generated_dirs = [] | 
|  | 269 | for gp_dir in options.genpydirs.split(','): | 
|  | 270 | generated_dirs.append('gen-py-%s' % (gp_dir)) | 
|  | 271 |  | 
|  | 272 | # commandline permits a single class name to be specified to override SERVERS=[...] | 
|  | 273 | servers = SERVERS | 
|  | 274 | if len(args) == 1: | 
|  | 275 | if args[0] in SERVERS: | 
|  | 276 | servers = args | 
|  | 277 | else: | 
|  | 278 | print('Unavailable server type "%s", please choose one of: %s' % (args[0], servers)) | 
|  | 279 | sys.exit(0) | 
|  | 280 |  | 
|  | 281 | tests = TestCases(options.libdir, options.port, generated_dirs, servers, options.verbose) | 
|  | 282 |  | 
|  | 283 | # run tests without a client/server first | 
|  | 284 | print('----------------') | 
|  | 285 | print(' Executing individual test scripts with various generated code directories') | 
|  | 286 | print(' Directories to be tested: ' + ', '.join(generated_dirs)) | 
|  | 287 | print(' Scripts to be tested: ' + ', '.join(SCRIPTS)) | 
|  | 288 | print('----------------') | 
| Roger Meier | f4eec7a | 2011-09-11 18:16:21 +0000 | [diff] [blame] | 289 | for genpydir in generated_dirs: | 
| Nobuaki Sukegawa | cacce2f | 2015-11-08 23:43:55 +0900 | [diff] [blame] | 290 | for script in SCRIPTS: | 
|  | 291 | runScriptTest(options.libdir, genpydir, script) | 
|  | 292 |  | 
|  | 293 | print('----------------') | 
|  | 294 | print(' Executing Client/Server tests with various generated code directories') | 
|  | 295 | print(' Servers to be tested: ' + ', '.join(servers)) | 
|  | 296 | print(' Directories to be tested: ' + ', '.join(generated_dirs)) | 
|  | 297 | print(' Protocols to be tested: ' + ', '.join(PROTOS)) | 
|  | 298 | print(' Options to be tested: ZLIB(yes/no), SSL(yes/no)') | 
|  | 299 | print('----------------') | 
|  | 300 |  | 
|  | 301 | if options.all: | 
|  | 302 | tests.run_all_tests() | 
|  | 303 | else: | 
|  | 304 | tests.test_feature('gendir', generated_dirs) | 
|  | 305 | tests.test_feature('server', servers) | 
|  | 306 | tests.test_feature('proto', PROTOS) | 
|  | 307 | tests.test_feature('zlib', [False, True]) | 
|  | 308 | tests.test_feature('ssl', [False, True]) | 
|  | 309 |  | 
|  | 310 |  | 
|  | 311 | if __name__ == '__main__': | 
|  | 312 | sys.exit(main()) |