1#!/usr/bin/env @PYTHON_SHEBANG@ 2 3# 4# This file and its contents are supplied under the terms of the 5# Common Development and Distribution License ("CDDL"), version 1.0. 6# You may only use this file in accordance with the terms of version 7# 1.0 of the CDDL. 8# 9# A full copy of the text of the CDDL should have accompanied this 10# source. A copy of the CDDL is also available via the Internet at 11# http://www.illumos.org/license/CDDL. 12# 13 14# 15# Copyright (c) 2017 by Delphix. All rights reserved. 16# Copyright (c) 2018 by Lawrence Livermore National Security, LLC. 17# 18# This script must remain compatible with Python 3.6+. 19# 20 21import os 22import re 23import sys 24import argparse 25 26# 27# This script parses the stdout of zfstest, which has this format: 28# 29# Test: /path/to/testa (run as root) [00:00] [PASS] 30# Test: /path/to/testb (run as jkennedy) [00:00] [PASS] 31# Test: /path/to/testc (run as root) [00:00] [FAIL] 32# [...many more results...] 33# 34# Results Summary 35# FAIL 22 36# SKIP 32 37# PASS 1156 38# 39# Running Time: 02:50:31 40# Percent passed: 95.5% 41# Log directory: /var/tmp/test_results/20180615T205926 42# 43 44# 45# Common generic reasons for a test or test group to be skipped. 46# 47# Some test cases are known to fail in ways which are not harmful or dangerous. 48# In these cases simply mark the test as a known failure until it can be 49# updated and the issue resolved. Note that it's preferable to open a unique 50# issue on the GitHub issue tracker for each test case failure. 51# 52known_reason = 'Known issue' 53 54# 55# Some tests require that a test user be able to execute the zfs utilities. 56# This may not be possible when testing in-tree due to the default permissions 57# on the user's home directory. When testing this can be resolved by granting 58# group read access. 59# 60# chmod 0750 $HOME 61# 62exec_reason = 'Test user execute permissions required for utilities' 63 64# 65# Some tests require that the kernel supports renameat2 syscall. 66# 67renameat2_reason = 'Kernel renameat2 support required' 68 69# 70# Some tests require the O_TMPFILE flag which was first introduced in the 71# 3.11 kernel. 72# 73tmpfile_reason = 'Kernel O_TMPFILE support required' 74 75# 76# Some tests require the statx(2) system call on Linux which was first 77# introduced in the 4.11 kernel. 78# 79statx_reason = 'Kernel statx(2) system call required on Linux' 80 81# 82# Some tests require that the lsattr utility support the project id feature. 83# 84project_id_reason = 'lsattr with set/show project ID required' 85 86# 87# Some tests require that the kernel support user namespaces. 88# 89user_ns_reason = 'Kernel user namespace support required' 90 91# 92# Some rewind tests can fail since nothing guarantees that old MOS blocks 93# are not overwritten. Snapshots protect datasets and data files but not 94# the MOS. Reasonable efforts are made in the test case to increase the 95# odds that some txgs will have their MOS data left untouched, but it is 96# never a sure thing. 97# 98rewind_reason = 'Arbitrary pool rewind is not guaranteed' 99 100# 101# Some tests require a minimum version of the fio benchmark utility. 102# Older distributions such as CentOS 6.x only provide fio-2.0.13. 103# 104fio_reason = 'Fio v2.3 or newer required' 105 106# 107# Some tests require that the DISKS provided support the discard operation. 108# Normally this is not an issue because loop back devices are used for DISKS 109# and they support discard (TRIM/UNMAP). 110# 111trim_reason = 'DISKS must support discard (TRIM/UNMAP)' 112 113# 114# Some tests on FreeBSD require the fspacectl(2) system call and the 115# truncate(1) utility supporting the -d option. The system call was first 116# introduced in FreeBSD version 1400032. 117# 118fspacectl_reason = 'fspacectl(2) and truncate -d support required' 119 120# 121# Some tests are not applicable to a platform or need to be updated to operate 122# in the manor required by the platform. Any tests which are skipped for this 123# reason will be suppressed in the final analysis output. 124# 125na_reason = "Not applicable" 126 127# 128# Some test cases doesn't have all requirements to run on Github actions CI. 129# 130ci_reason = 'CI runner doesn\'t have all requirements' 131 132# 133# Idmapped mount is only supported in kernel version >= 5.12 134# 135idmap_reason = 'Idmapped mount needs kernel 5.12+' 136 137# 138# copy_file_range() is not supported by all kernels 139# 140cfr_reason = 'Kernel copy_file_range support required' 141 142if sys.platform.startswith('freebsd'): 143 cfr_cross_reason = 'copy_file_range(2) cross-filesystem needs FreeBSD 14+' 144else: 145 cfr_cross_reason = 'copy_file_range(2) cross-filesystem needs kernel 5.3+' 146 147# 148# These tests are known to fail, thus we use this list to prevent these 149# failures from failing the job as a whole; only unexpected failures 150# bubble up to cause this script to exit with a non-zero exit status. 151# 152# Format: { 'test-name': ['expected result', 'issue-number | reason'] } 153# 154# For each known failure it is recommended to link to a GitHub issue by 155# setting the reason to the issue number. Alternately, one of the generic 156# reasons listed above can be used. 157# 158known = { 159 'casenorm/mixed_none_lookup_ci': ['FAIL', 7633], 160 'casenorm/mixed_formd_lookup_ci': ['FAIL', 7633], 161 'cli_root/zpool_import/import_rewind_device_replaced': 162 ['FAIL', rewind_reason], 163 'cli_user/misc/zfs_share_001_neg': ['SKIP', na_reason], 164 'cli_user/misc/zfs_unshare_001_neg': ['SKIP', na_reason], 165 'pool_checkpoint/checkpoint_discard_busy': ['SKIP', 12053], 166 'privilege/setup': ['SKIP', na_reason], 167 'refreserv/refreserv_004_pos': ['FAIL', known_reason], 168 'rootpool/setup': ['SKIP', na_reason], 169 'rsend/rsend_008_pos': ['SKIP', 6066], 170 'vdev_zaps/vdev_zaps_007_pos': ['FAIL', known_reason], 171} 172 173if sys.platform.startswith('freebsd'): 174 known.update({ 175 'cli_root/zfs_receive/receive-o-x_props_override': 176 ['FAIL', known_reason], 177 'cli_root/zpool_resilver/zpool_resilver_concurrent': 178 ['SKIP', na_reason], 179 'cli_root/zpool_wait/zpool_wait_trim_basic': ['SKIP', trim_reason], 180 'cli_root/zpool_wait/zpool_wait_trim_cancel': ['SKIP', trim_reason], 181 'cli_root/zpool_wait/zpool_wait_trim_flag': ['SKIP', trim_reason], 182 'cli_root/zfs_unshare/zfs_unshare_008_pos': ['SKIP', na_reason], 183 'cp_files/cp_files_002_pos': ['SKIP', na_reason], 184 'link_count/link_count_001': ['SKIP', na_reason], 185 'mmap/mmap_sync_001_pos': ['SKIP', na_reason], 186 'rsend/send_raw_ashift': ['SKIP', 14961], 187 }) 188elif sys.platform.startswith('linux'): 189 known.update({ 190 'casenorm/mixed_formd_lookup': ['FAIL', 7633], 191 'casenorm/mixed_formd_delete': ['FAIL', 7633], 192 'casenorm/sensitive_formd_lookup': ['FAIL', 7633], 193 'casenorm/sensitive_formd_delete': ['FAIL', 7633], 194 'removal/removal_with_zdb': ['SKIP', known_reason], 195 'cli_root/zfs_unshare/zfs_unshare_002_pos': ['SKIP', na_reason], 196 }) 197 198 199# 200# These tests may occasionally fail or be skipped. We want there failures 201# to be reported but only unexpected failures should bubble up to cause 202# this script to exit with a non-zero exit status. 203# 204# Format: { 'test-name': ['expected result', 'issue-number | reason'] } 205# 206# For each known failure it is recommended to link to a GitHub issue by 207# setting the reason to the issue number. Alternately, one of the generic 208# reasons listed above can be used. 209# 210maybe = { 211 'append/threadsappend_001_pos': ['FAIL', 6136], 212 'chattr/setup': ['SKIP', exec_reason], 213 'crtime/crtime_001_pos': ['SKIP', statx_reason], 214 'cli_root/zdb/zdb_006_pos': ['FAIL', known_reason], 215 'cli_root/zfs_destroy/zfs_destroy_dev_removal_condense': 216 ['FAIL', known_reason], 217 'cli_root/zfs_get/zfs_get_004_pos': ['FAIL', known_reason], 218 'cli_root/zfs_get/zfs_get_009_pos': ['SKIP', 5479], 219 'cli_root/zfs_rollback/zfs_rollback_001_pos': ['FAIL', known_reason], 220 'cli_root/zfs_rollback/zfs_rollback_002_pos': ['FAIL', known_reason], 221 'cli_root/zfs_share/zfs_share_concurrent_shares': ['FAIL', known_reason], 222 'cli_root/zfs_snapshot/zfs_snapshot_002_neg': ['FAIL', known_reason], 223 'cli_root/zfs_unshare/zfs_unshare_006_pos': ['SKIP', na_reason], 224 'cli_root/zpool_add/zpool_add_004_pos': ['FAIL', known_reason], 225 'cli_root/zpool_destroy/zpool_destroy_001_pos': ['SKIP', 6145], 226 'cli_root/zpool_import/zpool_import_missing_003_pos': ['SKIP', 6839], 227 'cli_root/zpool_initialize/zpool_initialize_import_export': 228 ['FAIL', 11948], 229 'cli_root/zpool_labelclear/zpool_labelclear_removed': 230 ['FAIL', known_reason], 231 'cli_root/zpool_trim/setup': ['SKIP', trim_reason], 232 'cli_root/zpool_upgrade/zpool_upgrade_004_pos': ['FAIL', 6141], 233 'delegate/setup': ['SKIP', exec_reason], 234 'fallocate/fallocate_punch-hole': ['SKIP', fspacectl_reason], 235 'history/history_004_pos': ['FAIL', 7026], 236 'history/history_005_neg': ['FAIL', 6680], 237 'history/history_006_neg': ['FAIL', 5657], 238 'history/history_008_pos': ['FAIL', known_reason], 239 'history/history_010_pos': ['SKIP', exec_reason], 240 'io/mmap': ['SKIP', fio_reason], 241 'largest_pool/largest_pool_001_pos': ['FAIL', known_reason], 242 'mmp/mmp_on_uberblocks': ['FAIL', known_reason], 243 'pam/setup': ['SKIP', "pamtester might be not available"], 244 'pool_checkpoint/checkpoint_discard_busy': ['FAIL', 11946], 245 'projectquota/setup': ['SKIP', exec_reason], 246 'removal/removal_condense_export': ['FAIL', known_reason], 247 'renameat2/setup': ['SKIP', renameat2_reason], 248 'reservation/reservation_008_pos': ['FAIL', 7741], 249 'reservation/reservation_018_pos': ['FAIL', 5642], 250 'snapshot/clone_001_pos': ['FAIL', known_reason], 251 'snapshot/snapshot_009_pos': ['FAIL', 7961], 252 'snapshot/snapshot_010_pos': ['FAIL', 7961], 253 'snapused/snapused_004_pos': ['FAIL', 5513], 254 'tmpfile/setup': ['SKIP', tmpfile_reason], 255 'trim/setup': ['SKIP', trim_reason], 256 'upgrade/upgrade_projectquota_001_pos': ['SKIP', project_id_reason], 257 'upgrade/upgrade_projectquota_002_pos': ['SKIP', project_id_reason], 258 'user_namespace/setup': ['SKIP', user_ns_reason], 259 'userquota/setup': ['SKIP', exec_reason], 260 'vdev_zaps/vdev_zaps_004_pos': ['FAIL', known_reason], 261 'zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos': ['FAIL', 5848], 262} 263 264if sys.platform.startswith('freebsd'): 265 maybe.update({ 266 'cli_root/zfs_copies/zfs_copies_002_pos': ['FAIL', known_reason], 267 'cli_root/zfs_inherit/zfs_inherit_001_neg': ['FAIL', known_reason], 268 'cli_root/zpool_import/zpool_import_012_pos': ['FAIL', known_reason], 269 'delegate/zfs_allow_003_pos': ['FAIL', known_reason], 270 'inheritance/inherit_001_pos': ['FAIL', 11829], 271 'pool_checkpoint/checkpoint_big_rewind': ['FAIL', 12622], 272 'pool_checkpoint/checkpoint_indirect': ['FAIL', 12623], 273 'resilver/resilver_restart_001': ['FAIL', known_reason], 274 'snapshot/snapshot_002_pos': ['FAIL', '14831'], 275 'bclone/bclone_crossfs_corner_cases': ['SKIP', cfr_cross_reason], 276 'bclone/bclone_crossfs_corner_cases_limited': 277 ['SKIP', cfr_cross_reason], 278 'bclone/bclone_crossfs_data': ['SKIP', cfr_cross_reason], 279 'bclone/bclone_crossfs_embedded': ['SKIP', cfr_cross_reason], 280 'bclone/bclone_crossfs_hole': ['SKIP', cfr_cross_reason], 281 'bclone/bclone_diffprops_all': ['SKIP', cfr_cross_reason], 282 'bclone/bclone_diffprops_checksum': ['SKIP', cfr_cross_reason], 283 'bclone/bclone_diffprops_compress': ['SKIP', cfr_cross_reason], 284 'bclone/bclone_diffprops_copies': ['SKIP', cfr_cross_reason], 285 'bclone/bclone_diffprops_recordsize': ['SKIP', cfr_cross_reason], 286 'bclone/bclone_prop_sync': ['SKIP', cfr_cross_reason], 287 'block_cloning/block_cloning_cross_enc_dataset': 288 ['SKIP', cfr_cross_reason], 289 'block_cloning/block_cloning_copyfilerange_cross_dataset': 290 ['SKIP', cfr_cross_reason] 291 }) 292elif sys.platform.startswith('linux'): 293 maybe.update({ 294 'bclone/bclone_crossfs_corner_cases': ['SKIP', cfr_cross_reason], 295 'bclone/bclone_crossfs_corner_cases_limited': 296 ['SKIP', cfr_cross_reason], 297 'bclone/bclone_crossfs_data': ['SKIP', cfr_cross_reason], 298 'bclone/bclone_crossfs_embedded': ['SKIP', cfr_cross_reason], 299 'bclone/bclone_crossfs_hole': ['SKIP', cfr_cross_reason], 300 'bclone/bclone_diffprops_all': ['SKIP', cfr_cross_reason], 301 'bclone/bclone_diffprops_checksum': ['SKIP', cfr_cross_reason], 302 'bclone/bclone_diffprops_compress': ['SKIP', cfr_cross_reason], 303 'bclone/bclone_diffprops_copies': ['SKIP', cfr_cross_reason], 304 'bclone/bclone_diffprops_recordsize': ['SKIP', cfr_cross_reason], 305 'bclone/bclone_prop_sync': ['SKIP', cfr_cross_reason], 306 'bclone/bclone_samefs_corner_cases': ['SKIP', cfr_reason], 307 'bclone/bclone_samefs_corner_cases_limited': ['SKIP', cfr_reason], 308 'bclone/bclone_samefs_data': ['SKIP', cfr_reason], 309 'bclone/bclone_samefs_embedded': ['SKIP', cfr_reason], 310 'bclone/bclone_samefs_hole': ['SKIP', cfr_reason], 311 'block_cloning/block_cloning_clone_mmap_cached': ['SKIP', cfr_reason], 312 'block_cloning/block_cloning_clone_mmap_write': 313 ['SKIP', cfr_reason], 314 'block_cloning/block_cloning_copyfilerange': 315 ['SKIP', cfr_reason], 316 'block_cloning/block_cloning_copyfilerange_cross_dataset': 317 ['SKIP', cfr_cross_reason], 318 'block_cloning/block_cloning_copyfilerange_fallback': 319 ['SKIP', cfr_reason], 320 'block_cloning/block_cloning_copyfilerange_fallback_same_txg': 321 ['SKIP', cfr_cross_reason], 322 'block_cloning/block_cloning_copyfilerange_partial': 323 ['SKIP', cfr_reason], 324 'block_cloning/block_cloning_cross_enc_dataset': 325 ['SKIP', cfr_cross_reason], 326 'block_cloning/block_cloning_disabled_copyfilerange': 327 ['SKIP', cfr_reason], 328 'block_cloning/block_cloning_lwb_buffer_overflow': 329 ['SKIP', cfr_reason], 330 'block_cloning/block_cloning_replay': 331 ['SKIP', cfr_reason], 332 'block_cloning/block_cloning_replay_encrypted': 333 ['SKIP', cfr_reason], 334 'block_cloning/block_cloning_rlimit_fsize': 335 ['SKIP', cfr_reason], 336 'cli_root/zfs_rename/zfs_rename_002_pos': ['FAIL', known_reason], 337 'cli_root/zpool_reopen/zpool_reopen_003_pos': ['FAIL', known_reason], 338 'cp_files/cp_files_002_pos': ['SKIP', cfr_reason], 339 'fault/auto_online_002_pos': ['FAIL', 11889], 340 'fault/auto_replace_001_pos': ['FAIL', 14851], 341 'fault/auto_spare_002_pos': ['FAIL', 11889], 342 'fault/auto_spare_multiple': ['FAIL', 11889], 343 'fault/auto_spare_shared': ['FAIL', 11889], 344 'fault/decompress_fault': ['FAIL', 11889], 345 'idmap_mount/idmap_mount_001': ['SKIP', idmap_reason], 346 'idmap_mount/idmap_mount_002': ['SKIP', idmap_reason], 347 'idmap_mount/idmap_mount_003': ['SKIP', idmap_reason], 348 'idmap_mount/idmap_mount_004': ['SKIP', idmap_reason], 349 'idmap_mount/idmap_mount_005': ['SKIP', idmap_reason], 350 'io/io_uring': ['SKIP', 'io_uring support required'], 351 'limits/filesystem_limit': ['SKIP', known_reason], 352 'limits/snapshot_limit': ['SKIP', known_reason], 353 'mmp/mmp_active_import': ['FAIL', known_reason], 354 'mmp/mmp_exported_import': ['FAIL', known_reason], 355 'mmp/mmp_inactive_import': ['FAIL', known_reason], 356 }) 357 358# Not all Github actions runners have scsi_debug module, so we may skip 359# some tests which use it. 360if os.environ.get('CI') == 'true': 361 known.update({ 362 'cli_root/zpool_expand/zpool_expand_001_pos': ['SKIP', ci_reason], 363 'cli_root/zpool_expand/zpool_expand_003_neg': ['SKIP', ci_reason], 364 'cli_root/zpool_expand/zpool_expand_005_pos': ['SKIP', ci_reason], 365 'cli_root/zpool_reopen/setup': ['SKIP', ci_reason], 366 'cli_root/zpool_reopen/zpool_reopen_001_pos': ['SKIP', ci_reason], 367 'cli_root/zpool_reopen/zpool_reopen_002_pos': ['SKIP', ci_reason], 368 'cli_root/zpool_reopen/zpool_reopen_003_pos': ['SKIP', ci_reason], 369 'cli_root/zpool_reopen/zpool_reopen_004_pos': ['SKIP', ci_reason], 370 'cli_root/zpool_reopen/zpool_reopen_005_pos': ['SKIP', ci_reason], 371 'cli_root/zpool_reopen/zpool_reopen_006_neg': ['SKIP', ci_reason], 372 'cli_root/zpool_reopen/zpool_reopen_007_pos': ['SKIP', ci_reason], 373 'cli_root/zpool_split/zpool_split_wholedisk': ['SKIP', ci_reason], 374 'fault/auto_offline_001_pos': ['SKIP', ci_reason], 375 'fault/auto_online_001_pos': ['SKIP', ci_reason], 376 'fault/auto_online_002_pos': ['SKIP', ci_reason], 377 'fault/auto_replace_001_pos': ['SKIP', ci_reason], 378 'fault/auto_replace_002_pos': ['SKIP', ci_reason], 379 'fault/auto_spare_ashift': ['SKIP', ci_reason], 380 'fault/auto_spare_shared': ['SKIP', ci_reason], 381 'fault/suspend_resume_single': ['SKIP', ci_reason], 382 'procfs/pool_state': ['SKIP', ci_reason], 383 }) 384 385 maybe.update({ 386 'events/events_002_pos': ['FAIL', 11546], 387 }) 388 389 390def process_results(pathname): 391 try: 392 f = open(pathname) 393 except IOError as e: 394 print('Error opening file:', e) 395 sys.exit(1) 396 397 prefix = '/zfs-tests/tests/(?:functional|perf/regression)/' 398 pattern = \ 399 r'^Test(?:\s+\(\S+\))?:' + \ 400 rf'\s*\S*{prefix}(\S+)' + \ 401 r'\s*\(run as (\S+)\)\s*\[(\S+)\]\s*\[(\S+)\]' 402 pattern_log = r'^\s*Log directory:\s*(\S*)' 403 404 d = {} 405 logdir = 'Could not determine log directory.' 406 for line in f.readlines(): 407 m = re.match(pattern, line) 408 if m and len(m.groups()) == 4: 409 d[m.group(1)] = m.group(4) 410 continue 411 412 m = re.match(pattern_log, line) 413 if m: 414 logdir = m.group(1) 415 416 return d, logdir 417 418 419class ListMaybesAction(argparse.Action): 420 def __init__(self, 421 option_strings, 422 dest="SUPPRESS", 423 default="SUPPRESS", 424 help="list flaky tests and exit"): 425 super(ListMaybesAction, self).__init__( 426 option_strings=option_strings, 427 dest=dest, 428 default=default, 429 nargs=0, 430 help=help) 431 432 def __call__(self, parser, namespace, values, option_string=None): 433 for test in maybe: 434 print(test) 435 sys.exit(0) 436 437 438if __name__ == "__main__": 439 parser = argparse.ArgumentParser(description='Analyze ZTS logs') 440 parser.add_argument('logfile') 441 parser.add_argument('--list-maybes', action=ListMaybesAction) 442 parser.add_argument('--no-maybes', action='store_false', dest='maybes') 443 args = parser.parse_args() 444 445 results, logdir = process_results(args.logfile) 446 447 if not results: 448 print("\n\nNo test results were found.") 449 print("Log directory:", logdir) 450 sys.exit(0) 451 452 expected = [] 453 unexpected = [] 454 all_maybes = True 455 456 for test in list(results.keys()): 457 if results[test] == "PASS": 458 continue 459 460 setup = test.replace(os.path.basename(test), "setup") 461 if results[test] == "SKIP" and test != setup: 462 if setup in known and known[setup][0] == "SKIP": 463 continue 464 if setup in maybe and maybe[setup][0] == "SKIP": 465 continue 466 467 if (test in known and results[test] in known[test][0]): 468 expected.append(test) 469 elif test in maybe and results[test] in maybe[test][0]: 470 if results[test] == 'SKIP' or args.maybes: 471 expected.append(test) 472 elif not args.maybes: 473 unexpected.append(test) 474 else: 475 unexpected.append(test) 476 all_maybes = False 477 478 print("\nTests with results other than PASS that are expected:") 479 for test in sorted(expected): 480 issue_url = 'https://github.com/openzfs/zfs/issues/' 481 482 # Include the reason why the result is expected, given the following: 483 # 1. Suppress test results which set the "Not applicable" reason. 484 # 2. Numerical reasons are assumed to be GitHub issue numbers. 485 # 3. When an entire test group is skipped only report the setup reason. 486 if test in known: 487 if known[test][1] == na_reason: 488 continue 489 elif isinstance(known[test][1], int): 490 expect = f"{issue_url}{known[test][1]}" 491 else: 492 expect = known[test][1] 493 elif test in maybe: 494 if isinstance(maybe[test][1], int): 495 expect = f"{issue_url}{maybe[test][1]}" 496 else: 497 expect = maybe[test][1] 498 elif setup in known and known[setup][0] == "SKIP" and setup != test: 499 continue 500 elif setup in maybe and maybe[setup][0] == "SKIP" and setup != test: 501 continue 502 else: 503 expect = "UNKNOWN REASON" 504 print(f" {results[test]} {test} ({expect})") 505 506 print("\nTests with result of PASS that are unexpected:") 507 for test in sorted(known.keys()): 508 # We probably should not be silently ignoring the case 509 # where "test" is not in "results". 510 if test not in results or results[test] != "PASS": 511 continue 512 print(f" {results[test]} {test} (expected {known[test][0]})") 513 514 print("\nTests with results other than PASS that are unexpected:") 515 for test in sorted(unexpected): 516 expect = "PASS" if test not in known else known[test][0] 517 print(f" {results[test]} {test} (expected {expect})") 518 519 if len(unexpected) == 0: 520 sys.exit(0) 521 elif not args.maybes and all_maybes: 522 sys.exit(2) 523 else: 524 sys.exit(1) 525