2020-07-12 02:35:58 +03:00
|
|
|
#!/usr/bin/env @PYTHON_SHEBANG@
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# This file and its contents are supplied under the terms of the
|
|
|
|
# Common Development and Distribution License ("CDDL"), version 1.0.
|
|
|
|
# You may only use this file in accordance with the terms of version
|
|
|
|
# 1.0 of the CDDL.
|
|
|
|
#
|
|
|
|
# A full copy of the text of the CDDL should have accompanied this
|
|
|
|
# source. A copy of the CDDL is also available via the Internet at
|
|
|
|
# http://www.illumos.org/license/CDDL.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copyright (c) 2017 by Delphix. All rights reserved.
|
|
|
|
# Copyright (c) 2018 by Lawrence Livermore National Security, LLC.
|
|
|
|
#
|
2022-01-13 19:51:12 +03:00
|
|
|
# This script must remain compatible with Python 3.6+.
|
pyzfs: python3 support (build system)
Almost all of the Python code in the respository has been updated
to be compatibile with Python 2.6, Python 3.4, or newer. The only
exceptions are arc_summery3.py which requires Python 3, and pyzfs
which requires at least Python 2.7. This allows us to maintain a
single version of the code and support most default versions of
python. This change does the following:
* Sets the default shebang for all Python scripts to python3. If
only Python 2 is available, then at install time scripts which
are compatible with Python 2 will have their shebangs replaced
with /usr/bin/python. This is done for compatibility until
Python 2 goes end of life. Since only the installed versions
are changed this means Python 3 must be installed on the system
for test-runner when testing in-tree.
* Added --with-python=<2|3|3.4,etc> configure option which sets
the PYTHON environment variable to target a specific python
version. By default the newest installed version of Python
will be used or the preferred distribution version when
creating pacakges.
* Fixed --enable-pyzfs configure checks so they are run when
--enable-pyzfs=check and --enable-pyzfs=yes.
* Enabled pyzfs for Python 3.4 and newer, which is now supported.
* Renamed pyzfs package to python<VERSION>-pyzfs and updated to
install in the appropriate site location. For example, when
building with --with-python=3.4 a python34-pyzfs will be
created which installs in /usr/lib/python3.4/site-packages/.
* Renamed the following python scripts according to the Fedora
guidance for packaging utilities in /bin
- dbufstat.py -> dbufstat
- arcstat.py -> arcstat
- arc_summary.py -> arc_summary
- arc_summary3.py -> arc_summary3
* Updated python-cffi package name. On CentOS 6, CentOS 7, and
Amazon Linux it's called python-cffi, not python2-cffi. For
Python3 it's called python3-cffi or python3x-cffi.
* Install one version of arc_summary. Depending on the version
of Python available install either arc_summary2 or arc_summary3
as arc_summary. The user output is only slightly different.
Reviewed-by: John Ramsden <johnramsden@riseup.net>
Reviewed-by: Neal Gompa <ngompa@datto.com>
Reviewed-by: loli10K <ezomori.nozomu@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8096
2018-10-31 19:22:59 +03:00
|
|
|
#
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import sys
|
2021-12-01 20:38:53 +03:00
|
|
|
import argparse
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# This script parses the stdout of zfstest, which has this format:
|
|
|
|
#
|
|
|
|
# Test: /path/to/testa (run as root) [00:00] [PASS]
|
|
|
|
# Test: /path/to/testb (run as jkennedy) [00:00] [PASS]
|
|
|
|
# Test: /path/to/testc (run as root) [00:00] [FAIL]
|
|
|
|
# [...many more results...]
|
|
|
|
#
|
|
|
|
# Results Summary
|
|
|
|
# FAIL 22
|
|
|
|
# SKIP 32
|
|
|
|
# PASS 1156
|
|
|
|
#
|
|
|
|
# Running Time: 02:50:31
|
|
|
|
# Percent passed: 95.5%
|
|
|
|
# Log directory: /var/tmp/test_results/20180615T205926
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Common generic reasons for a test or test group to be skipped.
|
|
|
|
#
|
|
|
|
# Some test cases are known to fail in ways which are not harmful or dangerous.
|
|
|
|
# In these cases simply mark the test as a known failure until it can be
|
|
|
|
# updated and the issue resolved. Note that it's preferable to open a unique
|
|
|
|
# issue on the GitHub issue tracker for each test case failure.
|
|
|
|
#
|
|
|
|
known_reason = 'Known issue'
|
|
|
|
|
|
|
|
#
|
|
|
|
# Some tests require that a test user be able to execute the zfs utilities.
|
|
|
|
# This may not be possible when testing in-tree due to the default permissions
|
|
|
|
# on the user's home directory. When testing this can be resolved by granting
|
|
|
|
# group read access.
|
|
|
|
#
|
|
|
|
# chmod 0750 $HOME
|
|
|
|
#
|
|
|
|
exec_reason = 'Test user execute permissions required for utilities'
|
|
|
|
|
2019-06-22 03:35:11 +03:00
|
|
|
#
|
|
|
|
# Some tests require that the kernel supports renameat2 syscall.
|
|
|
|
#
|
|
|
|
renameat2_reason = 'Kernel renameat2 support required'
|
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
#
|
|
|
|
# Some tests require the O_TMPFILE flag which was first introduced in the
|
|
|
|
# 3.11 kernel.
|
|
|
|
#
|
|
|
|
tmpfile_reason = 'Kernel O_TMPFILE support required'
|
|
|
|
|
2021-07-26 23:08:52 +03:00
|
|
|
#
|
|
|
|
# Some tests require the statx(2) system call on Linux which was first
|
|
|
|
# introduced in the 4.11 kernel.
|
|
|
|
#
|
|
|
|
statx_reason = 'Kernel statx(2) system call required on Linux'
|
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
#
|
|
|
|
# Some tests require that the lsattr utility support the project id feature.
|
|
|
|
#
|
|
|
|
project_id_reason = 'lsattr with set/show project ID required'
|
|
|
|
|
|
|
|
#
|
|
|
|
# Some tests require that the kernel support user namespaces.
|
|
|
|
#
|
|
|
|
user_ns_reason = 'Kernel user namespace support required'
|
|
|
|
|
|
|
|
#
|
|
|
|
# Some rewind tests can fail since nothing guarantees that old MOS blocks
|
|
|
|
# are not overwritten. Snapshots protect datasets and data files but not
|
|
|
|
# the MOS. Reasonable efforts are made in the test case to increase the
|
|
|
|
# odds that some txgs will have their MOS data left untouched, but it is
|
|
|
|
# never a sure thing.
|
|
|
|
#
|
|
|
|
rewind_reason = 'Arbitrary pool rewind is not guaranteed'
|
|
|
|
|
2018-08-27 20:04:21 +03:00
|
|
|
#
|
|
|
|
# Some tests require a minimum version of the fio benchmark utility.
|
|
|
|
# Older distributions such as CentOS 6.x only provide fio-2.0.13.
|
|
|
|
#
|
|
|
|
fio_reason = 'Fio v2.3 or newer required'
|
|
|
|
|
2019-03-29 19:13:20 +03:00
|
|
|
#
|
|
|
|
# Some tests require that the DISKS provided support the discard operation.
|
|
|
|
# Normally this is not an issue because loop back devices are used for DISKS
|
|
|
|
# and they support discard (TRIM/UNMAP).
|
|
|
|
#
|
|
|
|
trim_reason = 'DISKS must support discard (TRIM/UNMAP)'
|
|
|
|
|
2021-08-22 18:22:07 +03:00
|
|
|
#
|
|
|
|
# Some tests on FreeBSD require the fspacectl(2) system call and the
|
|
|
|
# truncate(1) utility supporting the -d option. The system call was first
|
|
|
|
# introduced in FreeBSD version 1400032.
|
|
|
|
#
|
|
|
|
fspacectl_reason = 'fspacectl(2) and truncate -d support required'
|
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
#
|
2020-03-05 02:09:40 +03:00
|
|
|
# Some tests are not applicable to a platform or need to be updated to operate
|
|
|
|
# in the manor required by the platform. Any tests which are skipped for this
|
2018-06-21 00:03:13 +03:00
|
|
|
# reason will be suppressed in the final analysis output.
|
|
|
|
#
|
2020-03-05 02:09:40 +03:00
|
|
|
na_reason = "Not applicable"
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2021-01-27 15:18:01 +03:00
|
|
|
#
|
|
|
|
# Some test cases doesn't have all requirements to run on Github actions CI.
|
|
|
|
#
|
|
|
|
ci_reason = 'CI runner doesn\'t have all requirements'
|
|
|
|
|
2022-10-19 21:17:09 +03:00
|
|
|
#
|
|
|
|
# Idmapped mount is only supported in kernel version >= 5.12
|
|
|
|
#
|
|
|
|
idmap_reason = 'Idmapped mount needs kernel 5.12+'
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# These tests are known to fail, thus we use this list to prevent these
|
|
|
|
# failures from failing the job as a whole; only unexpected failures
|
|
|
|
# bubble up to cause this script to exit with a non-zero exit status.
|
|
|
|
#
|
|
|
|
# Format: { 'test-name': ['expected result', 'issue-number | reason'] }
|
|
|
|
#
|
|
|
|
# For each known failure it is recommended to link to a GitHub issue by
|
|
|
|
# setting the reason to the issue number. Alternately, one of the generic
|
|
|
|
# reasons listed above can be used.
|
|
|
|
#
|
|
|
|
known = {
|
2022-03-26 13:24:40 +03:00
|
|
|
'casenorm/mixed_none_lookup_ci': ['FAIL', 7633],
|
|
|
|
'casenorm/mixed_formd_lookup_ci': ['FAIL', 7633],
|
2021-12-06 20:45:17 +03:00
|
|
|
'cli_root/zpool_import/import_rewind_device_replaced':
|
|
|
|
['FAIL', rewind_reason],
|
2018-06-21 00:03:13 +03:00
|
|
|
'cli_user/misc/zfs_share_001_neg': ['SKIP', na_reason],
|
|
|
|
'cli_user/misc/zfs_unshare_001_neg': ['SKIP', na_reason],
|
|
|
|
'privilege/setup': ['SKIP', na_reason],
|
|
|
|
'refreserv/refreserv_004_pos': ['FAIL', known_reason],
|
|
|
|
'rootpool/setup': ['SKIP', na_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'rsend/rsend_008_pos': ['SKIP', 6066],
|
2018-06-21 00:03:13 +03:00
|
|
|
'vdev_zaps/vdev_zaps_007_pos': ['FAIL', known_reason],
|
|
|
|
}
|
|
|
|
|
2020-03-05 02:09:40 +03:00
|
|
|
if sys.platform.startswith('freebsd'):
|
|
|
|
known.update({
|
2022-03-01 19:47:30 +03:00
|
|
|
'cli_root/zfs_receive/receive-o-x_props_override':
|
|
|
|
['FAIL', known_reason],
|
2020-03-06 20:26:38 +03:00
|
|
|
'cli_root/zpool_wait/zpool_wait_trim_basic': ['SKIP', trim_reason],
|
|
|
|
'cli_root/zpool_wait/zpool_wait_trim_cancel': ['SKIP', trim_reason],
|
|
|
|
'cli_root/zpool_wait/zpool_wait_trim_flag': ['SKIP', trim_reason],
|
2022-03-06 03:39:54 +03:00
|
|
|
'cli_root/zfs_unshare/zfs_unshare_008_pos': ['SKIP', na_reason],
|
2020-03-05 02:09:40 +03:00
|
|
|
'link_count/link_count_001': ['SKIP', na_reason],
|
2022-03-26 13:25:05 +03:00
|
|
|
'casenorm/mixed_create_failure': ['FAIL', 13215],
|
2022-05-03 23:23:26 +03:00
|
|
|
'mmap/mmap_sync_001_pos': ['SKIP', na_reason],
|
2020-03-05 02:09:40 +03:00
|
|
|
})
|
2020-03-13 19:29:10 +03:00
|
|
|
elif sys.platform.startswith('linux'):
|
|
|
|
known.update({
|
2022-03-26 13:24:40 +03:00
|
|
|
'casenorm/mixed_formd_lookup': ['FAIL', 7633],
|
|
|
|
'casenorm/mixed_formd_delete': ['FAIL', 7633],
|
|
|
|
'casenorm/sensitive_formd_lookup': ['FAIL', 7633],
|
|
|
|
'casenorm/sensitive_formd_delete': ['FAIL', 7633],
|
2020-03-13 19:29:10 +03:00
|
|
|
'removal/removal_with_zdb': ['SKIP', known_reason],
|
2022-03-21 01:42:40 +03:00
|
|
|
'cli_root/zfs_unshare/zfs_unshare_002_pos': ['SKIP', na_reason],
|
2020-03-13 19:29:10 +03:00
|
|
|
})
|
|
|
|
|
2020-03-05 02:09:40 +03:00
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
#
|
|
|
|
# These tests may occasionally fail or be skipped. We want there failures
|
|
|
|
# to be reported but only unexpected failures should bubble up to cause
|
|
|
|
# this script to exit with a non-zero exit status.
|
|
|
|
#
|
|
|
|
# Format: { 'test-name': ['expected result', 'issue-number | reason'] }
|
|
|
|
#
|
|
|
|
# For each known failure it is recommended to link to a GitHub issue by
|
|
|
|
# setting the reason to the issue number. Alternately, one of the generic
|
|
|
|
# reasons listed above can be used.
|
|
|
|
#
|
|
|
|
maybe = {
|
|
|
|
'chattr/setup': ['SKIP', exec_reason],
|
2021-07-26 23:08:52 +03:00
|
|
|
'crtime/crtime_001_pos': ['SKIP', statx_reason],
|
2018-06-21 00:03:13 +03:00
|
|
|
'cli_root/zdb/zdb_006_pos': ['FAIL', known_reason],
|
2021-05-12 05:55:12 +03:00
|
|
|
'cli_root/zfs_destroy/zfs_destroy_dev_removal_condense':
|
|
|
|
['FAIL', known_reason],
|
2018-06-21 00:03:13 +03:00
|
|
|
'cli_root/zfs_get/zfs_get_004_pos': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'cli_root/zfs_get/zfs_get_009_pos': ['SKIP', 5479],
|
2021-05-12 05:55:12 +03:00
|
|
|
'cli_root/zfs_rollback/zfs_rollback_001_pos': ['FAIL', known_reason],
|
|
|
|
'cli_root/zfs_rollback/zfs_rollback_002_pos': ['FAIL', known_reason],
|
2018-06-21 00:03:13 +03:00
|
|
|
'cli_root/zfs_snapshot/zfs_snapshot_002_neg': ['FAIL', known_reason],
|
2022-03-11 03:42:32 +03:00
|
|
|
'cli_root/zfs_unshare/zfs_unshare_006_pos': ['SKIP', na_reason],
|
2018-06-21 00:03:13 +03:00
|
|
|
'cli_root/zpool_add/zpool_add_004_pos': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'cli_root/zpool_destroy/zpool_destroy_001_pos': ['SKIP', 6145],
|
|
|
|
'cli_root/zpool_import/zpool_import_missing_003_pos': ['SKIP', 6839],
|
2021-04-27 18:27:03 +03:00
|
|
|
'cli_root/zpool_initialize/zpool_initialize_import_export':
|
2022-03-26 13:24:40 +03:00
|
|
|
['FAIL', 11948],
|
2021-05-12 05:55:12 +03:00
|
|
|
'cli_root/zpool_labelclear/zpool_labelclear_removed':
|
|
|
|
['FAIL', known_reason],
|
2019-03-29 19:13:20 +03:00
|
|
|
'cli_root/zpool_trim/setup': ['SKIP', trim_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'cli_root/zpool_upgrade/zpool_upgrade_004_pos': ['FAIL', 6141],
|
2018-06-21 00:03:13 +03:00
|
|
|
'delegate/setup': ['SKIP', exec_reason],
|
2021-08-22 18:22:07 +03:00
|
|
|
'fallocate/fallocate_punch-hole': ['SKIP', fspacectl_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'history/history_004_pos': ['FAIL', 7026],
|
|
|
|
'history/history_005_neg': ['FAIL', 6680],
|
|
|
|
'history/history_006_neg': ['FAIL', 5657],
|
2018-06-21 00:03:13 +03:00
|
|
|
'history/history_008_pos': ['FAIL', known_reason],
|
|
|
|
'history/history_010_pos': ['SKIP', exec_reason],
|
2018-08-27 20:04:21 +03:00
|
|
|
'io/mmap': ['SKIP', fio_reason],
|
2018-06-21 00:03:13 +03:00
|
|
|
'largest_pool/largest_pool_001_pos': ['FAIL', known_reason],
|
2020-07-16 07:28:18 +03:00
|
|
|
'mmp/mmp_on_uberblocks': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'pool_checkpoint/checkpoint_discard_busy': ['FAIL', 11946],
|
2018-06-21 00:03:13 +03:00
|
|
|
'projectquota/setup': ['SKIP', exec_reason],
|
2021-05-12 05:55:12 +03:00
|
|
|
'removal/removal_condense_export': ['FAIL', known_reason],
|
2019-06-22 03:35:11 +03:00
|
|
|
'renameat2/setup': ['SKIP', renameat2_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'reservation/reservation_008_pos': ['FAIL', 7741],
|
|
|
|
'reservation/reservation_018_pos': ['FAIL', 5642],
|
2018-06-21 00:03:13 +03:00
|
|
|
'snapshot/clone_001_pos': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'snapshot/snapshot_009_pos': ['FAIL', 7961],
|
|
|
|
'snapshot/snapshot_010_pos': ['FAIL', 7961],
|
|
|
|
'snapused/snapused_004_pos': ['FAIL', 5513],
|
2018-06-21 00:03:13 +03:00
|
|
|
'tmpfile/setup': ['SKIP', tmpfile_reason],
|
2022-05-11 18:38:16 +03:00
|
|
|
'append/threadsappend_001_pos': ['FAIL', 6136],
|
2019-03-29 19:13:20 +03:00
|
|
|
'trim/setup': ['SKIP', trim_reason],
|
2018-06-21 00:03:13 +03:00
|
|
|
'upgrade/upgrade_projectquota_001_pos': ['SKIP', project_id_reason],
|
|
|
|
'user_namespace/setup': ['SKIP', user_ns_reason],
|
|
|
|
'userquota/setup': ['SKIP', exec_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'zvol/zvol_ENOSPC/zvol_ENOSPC_001_pos': ['FAIL', 5848],
|
2020-06-25 04:45:44 +03:00
|
|
|
'pam/setup': ['SKIP', "pamtester might be not available"],
|
2018-06-21 00:03:13 +03:00
|
|
|
}
|
|
|
|
|
2020-03-13 19:29:10 +03:00
|
|
|
if sys.platform.startswith('freebsd'):
|
|
|
|
maybe.update({
|
|
|
|
'cli_root/zfs_copies/zfs_copies_002_pos': ['FAIL', known_reason],
|
2020-04-14 21:36:28 +03:00
|
|
|
'cli_root/zfs_inherit/zfs_inherit_001_neg': ['FAIL', known_reason],
|
2020-07-13 19:19:18 +03:00
|
|
|
'cli_root/zfs_share/zfs_share_concurrent_shares':
|
|
|
|
['FAIL', known_reason],
|
2020-07-16 07:28:18 +03:00
|
|
|
'cli_root/zpool_import/zpool_import_012_pos': ['FAIL', known_reason],
|
2020-03-13 19:29:10 +03:00
|
|
|
'delegate/zfs_allow_003_pos': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'inheritance/inherit_001_pos': ['FAIL', 11829],
|
2020-03-13 19:29:10 +03:00
|
|
|
'resilver/resilver_restart_001': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'pool_checkpoint/checkpoint_big_rewind': ['FAIL', 12622],
|
|
|
|
'pool_checkpoint/checkpoint_indirect': ['FAIL', 12623],
|
2020-03-13 19:29:10 +03:00
|
|
|
})
|
2020-06-22 19:44:49 +03:00
|
|
|
elif sys.platform.startswith('linux'):
|
|
|
|
maybe.update({
|
|
|
|
'cli_root/zfs_rename/zfs_rename_002_pos': ['FAIL', known_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_003_pos': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'fault/auto_spare_shared': ['FAIL', 11889],
|
2022-04-12 03:26:01 +03:00
|
|
|
'fault/auto_spare_multiple': ['FAIL', 11889],
|
2021-01-24 02:42:42 +03:00
|
|
|
'io/io_uring': ['SKIP', 'io_uring support required'],
|
2020-07-19 19:56:21 +03:00
|
|
|
'limits/filesystem_limit': ['SKIP', known_reason],
|
|
|
|
'limits/snapshot_limit': ['SKIP', known_reason],
|
2021-05-12 05:55:12 +03:00
|
|
|
'mmp/mmp_active_import': ['FAIL', known_reason],
|
2020-08-18 08:31:18 +03:00
|
|
|
'mmp/mmp_exported_import': ['FAIL', known_reason],
|
|
|
|
'mmp/mmp_inactive_import': ['FAIL', known_reason],
|
2022-03-26 13:24:40 +03:00
|
|
|
'zvol/zvol_misc/zvol_misc_snapdev': ['FAIL', 12621],
|
2021-11-09 05:01:19 +03:00
|
|
|
'zvol/zvol_misc/zvol_misc_volmode': ['FAIL', known_reason],
|
2022-10-19 21:17:09 +03:00
|
|
|
'idmap_mount/idmap_mount_001': ['SKIP', idmap_reason],
|
|
|
|
'idmap_mount/idmap_mount_002': ['SKIP', idmap_reason],
|
|
|
|
'idmap_mount/idmap_mount_003': ['SKIP', idmap_reason],
|
|
|
|
'idmap_mount/idmap_mount_004': ['SKIP', idmap_reason],
|
2022-11-08 21:28:56 +03:00
|
|
|
'idmap_mount/idmap_mount_005': ['SKIP', idmap_reason],
|
2020-06-22 19:44:49 +03:00
|
|
|
})
|
2020-03-13 19:29:10 +03:00
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2021-01-27 15:18:01 +03:00
|
|
|
# Not all Github actions runners have scsi_debug module, so we may skip
|
|
|
|
# some tests which use it.
|
|
|
|
if os.environ.get('CI') == 'true':
|
|
|
|
known.update({
|
|
|
|
'cli_root/zpool_expand/zpool_expand_001_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_expand/zpool_expand_003_neg': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_expand/zpool_expand_005_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/setup': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_001_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_002_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_003_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_004_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_005_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_006_neg': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_reopen/zpool_reopen_007_pos': ['SKIP', ci_reason],
|
|
|
|
'cli_root/zpool_split/zpool_split_wholedisk': ['SKIP', ci_reason],
|
|
|
|
'fault/auto_offline_001_pos': ['SKIP', ci_reason],
|
|
|
|
'fault/auto_online_001_pos': ['SKIP', ci_reason],
|
2021-06-30 17:37:20 +03:00
|
|
|
'fault/auto_online_002_pos': ['SKIP', ci_reason],
|
2021-01-27 15:18:01 +03:00
|
|
|
'fault/auto_replace_001_pos': ['SKIP', ci_reason],
|
|
|
|
'fault/auto_spare_ashift': ['SKIP', ci_reason],
|
|
|
|
'fault/auto_spare_shared': ['SKIP', ci_reason],
|
|
|
|
'procfs/pool_state': ['SKIP', ci_reason],
|
|
|
|
})
|
|
|
|
|
|
|
|
maybe.update({
|
2022-03-26 13:24:40 +03:00
|
|
|
'events/events_002_pos': ['FAIL', 11546],
|
2021-01-27 15:18:01 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
def process_results(pathname):
|
|
|
|
try:
|
|
|
|
f = open(pathname)
|
2018-09-26 21:02:26 +03:00
|
|
|
except IOError as e:
|
2022-03-21 02:56:58 +03:00
|
|
|
print('Error opening file:', e)
|
2018-06-21 00:03:13 +03:00
|
|
|
sys.exit(1)
|
|
|
|
|
2022-11-18 22:43:18 +03:00
|
|
|
prefix = '/zfs-tests/tests/(?:functional|perf/regression)/'
|
2018-10-25 09:26:08 +03:00
|
|
|
pattern = \
|
2019-12-20 20:31:59 +03:00
|
|
|
r'^Test(?:\s+\(\S+\))?:' + \
|
2022-03-21 02:56:58 +03:00
|
|
|
rf'\s*\S*{prefix}(\S+)' + \
|
|
|
|
r'\s*\(run as (\S+)\)\s*\[(\S+)\]\s*\[(\S+)\]'
|
2018-10-25 09:26:08 +03:00
|
|
|
pattern_log = r'^\s*Log directory:\s*(\S*)'
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
d = {}
|
2022-03-21 02:56:58 +03:00
|
|
|
logdir = 'Could not determine log directory.'
|
2020-05-14 19:41:29 +03:00
|
|
|
for line in f.readlines():
|
|
|
|
m = re.match(pattern, line)
|
2018-06-21 00:03:13 +03:00
|
|
|
if m and len(m.groups()) == 4:
|
|
|
|
d[m.group(1)] = m.group(4)
|
|
|
|
continue
|
|
|
|
|
2020-05-14 19:41:29 +03:00
|
|
|
m = re.match(pattern_log, line)
|
2018-06-21 00:03:13 +03:00
|
|
|
if m:
|
2022-03-21 02:56:58 +03:00
|
|
|
logdir = m.group(1)
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2022-03-21 02:56:58 +03:00
|
|
|
return d, logdir
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
|
2021-12-01 20:38:53 +03:00
|
|
|
class ListMaybesAction(argparse.Action):
|
|
|
|
def __init__(self,
|
|
|
|
option_strings,
|
|
|
|
dest="SUPPRESS",
|
|
|
|
default="SUPPRESS",
|
|
|
|
help="list flaky tests and exit"):
|
|
|
|
super(ListMaybesAction, self).__init__(
|
|
|
|
option_strings=option_strings,
|
|
|
|
dest=dest,
|
|
|
|
default=default,
|
|
|
|
nargs=0,
|
|
|
|
help=help)
|
|
|
|
|
|
|
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
|
|
for test in maybe:
|
|
|
|
print(test)
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
if __name__ == "__main__":
|
2021-12-01 20:38:53 +03:00
|
|
|
parser = argparse.ArgumentParser(description='Analyze ZTS logs')
|
|
|
|
parser.add_argument('logfile')
|
|
|
|
parser.add_argument('--list-maybes', action=ListMaybesAction)
|
|
|
|
parser.add_argument('--no-maybes', action='store_false', dest='maybes')
|
|
|
|
args = parser.parse_args()
|
|
|
|
|
2022-03-21 02:56:58 +03:00
|
|
|
results, logdir = process_results(args.logfile)
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2022-03-21 02:56:58 +03:00
|
|
|
if not results:
|
2018-09-26 21:02:26 +03:00
|
|
|
print("\n\nNo test results were found.")
|
2022-03-21 02:56:58 +03:00
|
|
|
print("Log directory:", logdir)
|
2018-06-21 00:03:13 +03:00
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
expected = []
|
|
|
|
unexpected = []
|
2021-12-01 20:38:53 +03:00
|
|
|
all_maybes = True
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2018-09-26 21:02:26 +03:00
|
|
|
for test in list(results.keys()):
|
2018-06-21 00:03:13 +03:00
|
|
|
if results[test] == "PASS":
|
|
|
|
continue
|
|
|
|
|
|
|
|
setup = test.replace(os.path.basename(test), "setup")
|
|
|
|
if results[test] == "SKIP" and test != setup:
|
|
|
|
if setup in known and known[setup][0] == "SKIP":
|
|
|
|
continue
|
|
|
|
if setup in maybe and maybe[setup][0] == "SKIP":
|
|
|
|
continue
|
|
|
|
|
2021-12-01 20:38:53 +03:00
|
|
|
if (test in known and results[test] in known[test][0]):
|
2018-06-21 00:03:13 +03:00
|
|
|
expected.append(test)
|
2021-12-01 20:38:53 +03:00
|
|
|
elif test in maybe and results[test] in maybe[test][0]:
|
|
|
|
if results[test] == 'SKIP' or args.maybes:
|
|
|
|
expected.append(test)
|
|
|
|
elif not args.maybes:
|
|
|
|
unexpected.append(test)
|
|
|
|
else:
|
|
|
|
unexpected.append(test)
|
|
|
|
all_maybes = False
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2018-09-26 21:02:26 +03:00
|
|
|
print("\nTests with results other than PASS that are expected:")
|
2018-06-21 00:03:13 +03:00
|
|
|
for test in sorted(expected):
|
2020-03-02 20:42:22 +03:00
|
|
|
issue_url = 'https://github.com/openzfs/zfs/issues/'
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
# Include the reason why the result is expected, given the following:
|
2020-03-05 02:09:40 +03:00
|
|
|
# 1. Suppress test results which set the "Not applicable" reason.
|
2018-06-21 00:03:13 +03:00
|
|
|
# 2. Numerical reasons are assumed to be GitHub issue numbers.
|
|
|
|
# 3. When an entire test group is skipped only report the setup reason.
|
|
|
|
if test in known:
|
|
|
|
if known[test][1] == na_reason:
|
|
|
|
continue
|
2022-03-26 13:24:40 +03:00
|
|
|
elif isinstance(known[test][1], int):
|
|
|
|
expect = f"{issue_url}{known[test][1]}"
|
2018-06-21 00:03:13 +03:00
|
|
|
else:
|
|
|
|
expect = known[test][1]
|
|
|
|
elif test in maybe:
|
2022-03-26 13:24:40 +03:00
|
|
|
if isinstance(maybe[test][1], int):
|
|
|
|
expect = f"{issue_url}{maybe[test][1]}"
|
2018-06-21 00:03:13 +03:00
|
|
|
else:
|
|
|
|
expect = maybe[test][1]
|
|
|
|
elif setup in known and known[setup][0] == "SKIP" and setup != test:
|
|
|
|
continue
|
|
|
|
elif setup in maybe and maybe[setup][0] == "SKIP" and setup != test:
|
|
|
|
continue
|
|
|
|
else:
|
|
|
|
expect = "UNKNOWN REASON"
|
2022-03-21 02:56:58 +03:00
|
|
|
print(f" {results[test]} {test} ({expect})")
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2018-09-26 21:02:26 +03:00
|
|
|
print("\nTests with result of PASS that are unexpected:")
|
2018-06-21 00:03:13 +03:00
|
|
|
for test in sorted(known.keys()):
|
|
|
|
# We probably should not be silently ignoring the case
|
|
|
|
# where "test" is not in "results".
|
|
|
|
if test not in results or results[test] != "PASS":
|
|
|
|
continue
|
2022-03-21 02:56:58 +03:00
|
|
|
print(f" {results[test]} {test} (expected {known[test][0]})")
|
2018-06-21 00:03:13 +03:00
|
|
|
|
2018-09-26 21:02:26 +03:00
|
|
|
print("\nTests with results other than PASS that are unexpected:")
|
2018-06-21 00:03:13 +03:00
|
|
|
for test in sorted(unexpected):
|
|
|
|
expect = "PASS" if test not in known else known[test][0]
|
2022-03-21 02:56:58 +03:00
|
|
|
print(f" {results[test]} {test} (expected {expect})")
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
if len(unexpected) == 0:
|
|
|
|
sys.exit(0)
|
2021-12-01 20:38:53 +03:00
|
|
|
elif not args.maybes and all_maybes:
|
|
|
|
sys.exit(2)
|
2018-06-21 00:03:13 +03:00
|
|
|
else:
|
|
|
|
sys.exit(1)
|