[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | """Sets environment variables needed to run a chromium unit test.""" |
| 7 | |
Trent Apted | b185243 | 2018-01-25 02:15:10 | [diff] [blame] | 8 | import io |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 9 | import os |
Ben Pastene | e5ece81 | 2018-06-20 22:39:34 | [diff] [blame^] | 10 | import signal |
[email protected] | 76361be45 | 2012-08-30 22:48:14 | [diff] [blame] | 11 | import stat |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 12 | import subprocess |
| 13 | import sys |
Trent Apted | b185243 | 2018-01-25 02:15:10 | [diff] [blame] | 14 | import time |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 15 | |
| 16 | # This is hardcoded to be src/ relative to this script. |
| 17 | ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| 18 | |
[email protected] | 76361be45 | 2012-08-30 22:48:14 | [diff] [blame] | 19 | CHROME_SANDBOX_ENV = 'CHROME_DEVEL_SANDBOX' |
| 20 | CHROME_SANDBOX_PATH = '/opt/chromium/chrome_sandbox' |
| 21 | |
| 22 | |
earthdok | 748e135 | 2015-01-27 23:04:08 | [diff] [blame] | 23 | def get_sandbox_env(env): |
| 24 | """Returns the environment flags needed for the SUID sandbox to work.""" |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 25 | extra_env = {} |
[email protected] | 76361be45 | 2012-08-30 22:48:14 | [diff] [blame] | 26 | chrome_sandbox_path = env.get(CHROME_SANDBOX_ENV, CHROME_SANDBOX_PATH) |
earthdok | 748e135 | 2015-01-27 23:04:08 | [diff] [blame] | 27 | # The above would silently disable the SUID sandbox if the env value were |
| 28 | # an empty string. We don't want to allow that. http://crbug.com/245376 |
| 29 | # TODO(jln): Remove this check once it's no longer possible to disable the |
| 30 | # sandbox that way. |
| 31 | if not chrome_sandbox_path: |
| 32 | chrome_sandbox_path = CHROME_SANDBOX_PATH |
| 33 | extra_env[CHROME_SANDBOX_ENV] = chrome_sandbox_path |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 34 | |
| 35 | return extra_env |
| 36 | |
| 37 | |
| 38 | def trim_cmd(cmd): |
| 39 | """Removes internal flags from cmd since they're just used to communicate from |
| 40 | the host machine to this script running on the swarm slaves.""" |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 41 | sanitizers = ['asan', 'lsan', 'msan', 'tsan'] |
| 42 | internal_flags = frozenset('--%s=%d' % (name, value) |
| 43 | for name in sanitizers |
| 44 | for value in [0, 1]) |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 45 | return [i for i in cmd if i not in internal_flags] |
[email protected] | 76361be45 | 2012-08-30 22:48:14 | [diff] [blame] | 46 | |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 47 | |
[email protected] | 4bf4d63 | 2012-05-31 15:50:30 | [diff] [blame] | 48 | def fix_python_path(cmd): |
| 49 | """Returns the fixed command line to call the right python executable.""" |
| 50 | out = cmd[:] |
| 51 | if out[0] == 'python': |
| 52 | out[0] = sys.executable |
| 53 | elif out[0].endswith('.py'): |
| 54 | out.insert(0, sys.executable) |
| 55 | return out |
| 56 | |
| 57 | |
pcc | 46233c2 | 2017-06-20 22:11:41 | [diff] [blame] | 58 | def get_sanitizer_env(cmd, asan, lsan, msan, tsan, cfi_diag): |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 59 | """Returns the envirnoment flags needed for sanitizer tools.""" |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 60 | |
| 61 | extra_env = {} |
| 62 | |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 63 | # Instruct GTK to use malloc while running sanitizer-instrumented tests. |
earthdok | e6c54a4 | 2014-10-16 18:02:36 | [diff] [blame] | 64 | extra_env['G_SLICE'] = 'always-malloc' |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 65 | |
| 66 | extra_env['NSS_DISABLE_ARENA_FREE_LIST'] = '1' |
| 67 | extra_env['NSS_DISABLE_UNLOAD'] = '1' |
| 68 | |
| 69 | # TODO(glider): remove the symbolizer path once |
| 70 | # https://code.google.com/p/address-sanitizer/issues/detail?id=134 is fixed. |
Nico Weber | 1909731 | 2016-01-29 18:13:15 | [diff] [blame] | 71 | symbolizer_path = os.path.join(ROOT_DIR, |
| 72 | 'third_party', 'llvm-build', 'Release+Asserts', 'bin', 'llvm-symbolizer') |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 73 | |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 74 | if lsan or tsan: |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 75 | # LSan is not sandbox-compatible, so we can use online symbolization. In |
| 76 | # fact, it needs symbolization to be able to apply suppressions. |
| 77 | symbolization_options = ['symbolize=1', |
| 78 | 'external_symbolizer_path=%s' % symbolizer_path] |
pcc | 46233c2 | 2017-06-20 22:11:41 | [diff] [blame] | 79 | elif (asan or msan or cfi_diag) and sys.platform not in ['win32', 'cygwin']: |
timurrrr | 064f952 | 2015-02-12 15:46:32 | [diff] [blame] | 80 | # ASan uses a script for offline symbolization, except on Windows. |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 81 | # Important note: when running ASan with leak detection enabled, we must use |
| 82 | # the LSan symbolization options above. |
| 83 | symbolization_options = ['symbolize=0'] |
vadimsh | 5cf3c44 | 2014-10-20 10:22:38 | [diff] [blame] | 84 | # Set the path to llvm-symbolizer to be used by asan_symbolize.py |
| 85 | extra_env['LLVM_SYMBOLIZER_PATH'] = symbolizer_path |
timurrrr | 7e67df9 | 2015-02-12 21:50:52 | [diff] [blame] | 86 | else: |
| 87 | symbolization_options = [] |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 88 | |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 89 | if asan: |
| 90 | asan_options = symbolization_options[:] |
| 91 | if lsan: |
| 92 | asan_options.append('detect_leaks=1') |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 93 | |
timurrrr | 7e67df9 | 2015-02-12 21:50:52 | [diff] [blame] | 94 | if asan_options: |
| 95 | extra_env['ASAN_OPTIONS'] = ' '.join(asan_options) |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 96 | |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 97 | if sys.platform == 'darwin': |
| 98 | isolate_output_dir = os.path.abspath(os.path.dirname(cmd[0])) |
| 99 | # This is needed because the test binary has @executable_path embedded in |
| 100 | # it that the OS tries to resolve to the cache directory and not the |
| 101 | # mapped directory. |
| 102 | extra_env['DYLD_LIBRARY_PATH'] = str(isolate_output_dir) |
| 103 | |
| 104 | if lsan: |
| 105 | if asan or msan: |
| 106 | lsan_options = [] |
| 107 | else: |
| 108 | lsan_options = symbolization_options[:] |
| 109 | if sys.platform == 'linux2': |
| 110 | # Use the debug version of libstdc++ under LSan. If we don't, there will |
| 111 | # be a lot of incomplete stack traces in the reports. |
| 112 | extra_env['LD_LIBRARY_PATH'] = '/usr/lib/x86_64-linux-gnu/debug:' |
| 113 | |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 114 | extra_env['LSAN_OPTIONS'] = ' '.join(lsan_options) |
| 115 | |
| 116 | if msan: |
| 117 | msan_options = symbolization_options[:] |
| 118 | if lsan: |
| 119 | msan_options.append('detect_leaks=1') |
| 120 | extra_env['MSAN_OPTIONS'] = ' '.join(msan_options) |
| 121 | |
| 122 | if tsan: |
| 123 | tsan_options = symbolization_options[:] |
| 124 | extra_env['TSAN_OPTIONS'] = ' '.join(tsan_options) |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 125 | |
pcc | 46233c2 | 2017-06-20 22:11:41 | [diff] [blame] | 126 | # CFI uses the UBSan runtime to provide diagnostics. |
| 127 | if cfi_diag: |
| 128 | ubsan_options = symbolization_options[:] + ['print_stacktrace=1'] |
| 129 | extra_env['UBSAN_OPTIONS'] = ' '.join(ubsan_options) |
| 130 | |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 131 | return extra_env |
| 132 | |
| 133 | |
glider | 9d91934 | 2015-02-06 17:42:27 | [diff] [blame] | 134 | def get_sanitizer_symbolize_command(json_path=None, executable_path=None): |
earthdok | 9bd5d58 | 2015-01-29 21:19:36 | [diff] [blame] | 135 | """Construct the command to invoke offline symbolization script.""" |
Nico Weber | 1909731 | 2016-01-29 18:13:15 | [diff] [blame] | 136 | script_path = os.path.join( |
| 137 | ROOT_DIR, 'tools', 'valgrind', 'asan', 'asan_symbolize.py') |
earthdok | 9bd5d58 | 2015-01-29 21:19:36 | [diff] [blame] | 138 | cmd = [sys.executable, script_path] |
| 139 | if json_path is not None: |
| 140 | cmd.append('--test-summary-json-file=%s' % json_path) |
glider | 9d91934 | 2015-02-06 17:42:27 | [diff] [blame] | 141 | if executable_path is not None: |
| 142 | cmd.append('--executable-path=%s' % executable_path) |
earthdok | 9bd5d58 | 2015-01-29 21:19:36 | [diff] [blame] | 143 | return cmd |
| 144 | |
| 145 | |
| 146 | def get_json_path(cmd): |
| 147 | """Extract the JSON test summary path from a command line.""" |
| 148 | json_path_flag = '--test-launcher-summary-output=' |
| 149 | for arg in cmd: |
| 150 | if arg.startswith(json_path_flag): |
| 151 | return arg.split(json_path_flag).pop() |
| 152 | return None |
| 153 | |
| 154 | |
| 155 | def symbolize_snippets_in_json(cmd, env): |
| 156 | """Symbolize output snippets inside the JSON test summary.""" |
| 157 | json_path = get_json_path(cmd) |
| 158 | if json_path is None: |
| 159 | return |
| 160 | |
| 161 | try: |
glider | 9d91934 | 2015-02-06 17:42:27 | [diff] [blame] | 162 | symbolize_command = get_sanitizer_symbolize_command( |
| 163 | json_path=json_path, executable_path=cmd[0]) |
earthdok | 9bd5d58 | 2015-01-29 21:19:36 | [diff] [blame] | 164 | p = subprocess.Popen(symbolize_command, stderr=subprocess.PIPE, env=env) |
| 165 | (_, stderr) = p.communicate() |
| 166 | except OSError as e: |
thakis | 45643b4 | 2016-01-29 21:53:42 | [diff] [blame] | 167 | print >> sys.stderr, 'Exception while symbolizing snippets: %s' % e |
| 168 | raise |
earthdok | 9bd5d58 | 2015-01-29 21:19:36 | [diff] [blame] | 169 | |
| 170 | if p.returncode != 0: |
thakis | 45643b4 | 2016-01-29 21:53:42 | [diff] [blame] | 171 | print >> sys.stderr, "Error: failed to symbolize snippets in JSON:\n" |
| 172 | print >> sys.stderr, stderr |
| 173 | raise subprocess.CalledProcessError(p.returncode, symbolize_command) |
earthdok | 9bd5d58 | 2015-01-29 21:19:36 | [diff] [blame] | 174 | |
| 175 | |
Trent Apted | b185243 | 2018-01-25 02:15:10 | [diff] [blame] | 176 | def run_command_with_output(argv, stdoutfile, env=None, cwd=None): |
| 177 | """ Run command and stream its stdout/stderr to the console & |stdoutfile|. |
| 178 | """ |
| 179 | print('Running %r in %r (env: %r)' % (argv, cwd, env)) |
| 180 | assert stdoutfile |
| 181 | with io.open(stdoutfile, 'w') as writer, io.open(stdoutfile, 'r', 1) as \ |
| 182 | reader: |
| 183 | process = subprocess.Popen(argv, env=env, cwd=cwd, stdout=writer, |
| 184 | stderr=subprocess.STDOUT) |
Ben Pastene | e5ece81 | 2018-06-20 22:39:34 | [diff] [blame^] | 185 | forward_signals([process]) |
Trent Apted | b185243 | 2018-01-25 02:15:10 | [diff] [blame] | 186 | while process.poll() is None: |
| 187 | sys.stdout.write(reader.read()) |
| 188 | time.sleep(0.1) |
| 189 | # Read the remaining. |
| 190 | sys.stdout.write(reader.read()) |
| 191 | print('Command %r returned exit code %d' % (argv, process.returncode)) |
| 192 | return process.returncode |
| 193 | |
| 194 | |
Ben Pastene | e5ece81 | 2018-06-20 22:39:34 | [diff] [blame^] | 195 | def forward_signals(procs): |
| 196 | """Forwards unix's SIGTERM or win's CTRL_BREAK_EVENT to the given processes. |
| 197 | |
| 198 | This plays nicely with swarming's timeout handling. See also |
| 199 | https://chromium.googlesource.com/infra/luci/luci-py/+/master/appengine/swarming/doc/Bot.md#graceful-termination_aka-the-sigterm-and-sigkill-dance |
| 200 | |
| 201 | Args: |
| 202 | procs: A list of subprocess.Popen objects representing child processes. |
| 203 | """ |
| 204 | assert all(isinstance(p, subprocess.Popen) for p in procs) |
| 205 | def _sig_handler(sig, _): |
| 206 | for p in procs: |
| 207 | if sig == signal.SIGBREAK: |
| 208 | p.send_signal(signal.CTRL_BREAK_EVENT) |
| 209 | else: |
| 210 | p.send_signal(sig) |
| 211 | if sys.platform == 'win32': |
| 212 | signal.signal(signal.SIGBREAK, _sig_handler) |
| 213 | else: |
| 214 | signal.signal(signal.SIGTERM, _sig_handler) |
| 215 | |
| 216 | |
Trent Apted | b185243 | 2018-01-25 02:15:10 | [diff] [blame] | 217 | def run_executable(cmd, env, stdoutfile=None): |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 218 | """Runs an executable with: |
Dirk Pranke | 50e557b | 2017-12-01 23:48:09 | [diff] [blame] | 219 | - CHROME_HEADLESS set to indicate that the test is running on a |
| 220 | bot and shouldn't do anything interactive like show modal dialogs. |
[email protected] | 3766ed1c | 2012-07-26 20:53:56 | [diff] [blame] | 221 | - environment variable CR_SOURCE_ROOT set to the root directory. |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 222 | - environment variable LANGUAGE to en_US.UTF-8. |
earthdok | 748e135 | 2015-01-27 23:04:08 | [diff] [blame] | 223 | - environment variable CHROME_DEVEL_SANDBOX set |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 224 | - Reuses sys.executable automatically. |
| 225 | """ |
Dirk Pranke | 50e557b | 2017-12-01 23:48:09 | [diff] [blame] | 226 | extra_env = { |
| 227 | # Set to indicate that the executable is running non-interactively on |
| 228 | # a bot. |
| 229 | 'CHROME_HEADLESS': '1', |
| 230 | |
| 231 | # Many tests assume a English interface... |
| 232 | 'LANG': 'en_US.UTF-8', |
| 233 | } |
| 234 | |
[email protected] | 3766ed1c | 2012-07-26 20:53:56 | [diff] [blame] | 235 | # Used by base/base_paths_linux.cc as an override. Just make sure the default |
| 236 | # logic is used. |
| 237 | env.pop('CR_SOURCE_ROOT', None) |
earthdok | 748e135 | 2015-01-27 23:04:08 | [diff] [blame] | 238 | extra_env.update(get_sandbox_env(env)) |
John Abd-El-Malek | 4569c42 | 2014-10-09 05:10:53 | [diff] [blame] | 239 | |
| 240 | # Copy logic from tools/build/scripts/slave/runtest.py. |
| 241 | asan = '--asan=1' in cmd |
| 242 | lsan = '--lsan=1' in cmd |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 243 | msan = '--msan=1' in cmd |
| 244 | tsan = '--tsan=1' in cmd |
pcc | 46233c2 | 2017-06-20 22:11:41 | [diff] [blame] | 245 | cfi_diag = '--cfi-diag=1' in cmd |
Trent Apted | b185243 | 2018-01-25 02:15:10 | [diff] [blame] | 246 | if stdoutfile or sys.platform in ['win32', 'cygwin']: |
timurrrr | 064f952 | 2015-02-12 15:46:32 | [diff] [blame] | 247 | # Symbolization works in-process on Windows even when sandboxed. |
| 248 | use_symbolization_script = False |
| 249 | else: |
| 250 | # LSan doesn't support sandboxing yet, so we use the in-process symbolizer. |
| 251 | # Note that ASan and MSan can work together with LSan. |
pcc | 46233c2 | 2017-06-20 22:11:41 | [diff] [blame] | 252 | use_symbolization_script = (asan or msan or cfi_diag) and not lsan |
John Abd-El-Malek | 4569c42 | 2014-10-09 05:10:53 | [diff] [blame] | 253 | |
pcc | 46233c2 | 2017-06-20 22:11:41 | [diff] [blame] | 254 | if asan or lsan or msan or tsan or cfi_diag: |
| 255 | extra_env.update(get_sanitizer_env(cmd, asan, lsan, msan, tsan, cfi_diag)) |
earthdok | eeb06530 | 2015-02-04 18:18:04 | [diff] [blame] | 256 | |
Timur Iskhodzhanov | fdbfd4e1 | 2015-02-05 13:50:23 | [diff] [blame] | 257 | if lsan or tsan: |
| 258 | # LSan and TSan are not sandbox-friendly. |
| 259 | cmd.append('--no-sandbox') |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 260 | |
| 261 | cmd = trim_cmd(cmd) |
John Abd-El-Malek | 4569c42 | 2014-10-09 05:10:53 | [diff] [blame] | 262 | |
[email protected] | 8ba9835 | 2012-05-23 20:43:59 | [diff] [blame] | 263 | # Ensure paths are correctly separated on windows. |
| 264 | cmd[0] = cmd[0].replace('/', os.path.sep) |
[email protected] | 4bf4d63 | 2012-05-31 15:50:30 | [diff] [blame] | 265 | cmd = fix_python_path(cmd) |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 266 | |
| 267 | print('Additional test environment:\n%s\n' |
| 268 | 'Command: %s\n' % ( |
| 269 | '\n'.join(' %s=%s' % |
| 270 | (k, v) for k, v in sorted(extra_env.iteritems())), |
| 271 | ' '.join(cmd))) |
maruel | f00125f8 | 2016-11-19 00:01:14 | [diff] [blame] | 272 | sys.stdout.flush() |
John Abd-El-Malek | 14ae054 | 2014-10-15 17:52:31 | [diff] [blame] | 273 | env.update(extra_env or {}) |
[email protected] | 50ec9f23 | 2012-03-16 04:18:23 | [diff] [blame] | 274 | try: |
Trent Apted | b185243 | 2018-01-25 02:15:10 | [diff] [blame] | 275 | if stdoutfile: |
| 276 | # Write to stdoutfile and poll to produce terminal output. |
| 277 | return run_command_with_output(cmd, env=env, stdoutfile=stdoutfile) |
| 278 | elif use_symbolization_script: |
| 279 | # See above comment regarding offline symbolization. |
John Abd-El-Malek | 4569c42 | 2014-10-09 05:10:53 | [diff] [blame] | 280 | # Need to pipe to the symbolizer script. |
| 281 | p1 = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE, |
| 282 | stderr=sys.stdout) |
glider | 9d91934 | 2015-02-06 17:42:27 | [diff] [blame] | 283 | p2 = subprocess.Popen( |
| 284 | get_sanitizer_symbolize_command(executable_path=cmd[0]), |
| 285 | env=env, stdin=p1.stdout) |
John Abd-El-Malek | 4569c42 | 2014-10-09 05:10:53 | [diff] [blame] | 286 | p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits. |
Ben Pastene | e5ece81 | 2018-06-20 22:39:34 | [diff] [blame^] | 287 | forward_signals([p1, p2]) |
vadimsh | 1eaeb298 | 2014-10-20 12:28:45 | [diff] [blame] | 288 | p1.wait() |
John Abd-El-Malek | 4569c42 | 2014-10-09 05:10:53 | [diff] [blame] | 289 | p2.wait() |
earthdok | 9bd5d58 | 2015-01-29 21:19:36 | [diff] [blame] | 290 | # Also feed the out-of-band JSON output to the symbolizer script. |
| 291 | symbolize_snippets_in_json(cmd, env) |
vadimsh | 1eaeb298 | 2014-10-20 12:28:45 | [diff] [blame] | 292 | return p1.returncode |
John Abd-El-Malek | 4569c42 | 2014-10-09 05:10:53 | [diff] [blame] | 293 | else: |
Ben Pastene | e5ece81 | 2018-06-20 22:39:34 | [diff] [blame^] | 294 | p = subprocess.Popen(cmd, env=env) |
| 295 | forward_signals([p]) |
| 296 | return p.wait() |
[email protected] | 50ec9f23 | 2012-03-16 04:18:23 | [diff] [blame] | 297 | except OSError: |
| 298 | print >> sys.stderr, 'Failed to start %s' % cmd |
| 299 | raise |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 300 | |
| 301 | |
| 302 | def main(): |
glider | b73f187 | 2014-10-09 16:24:56 | [diff] [blame] | 303 | return run_executable(sys.argv[1:], os.environ.copy()) |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 304 | |
| 305 | |
[email protected] | ed763a7 | 2012-08-29 03:51:22 | [diff] [blame] | 306 | if __name__ == '__main__': |
[email protected] | 0a88a65 | 2012-03-09 00:34:45 | [diff] [blame] | 307 | sys.exit(main()) |