ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
#!/usr/bin/env bash
|
2022-01-13 21:09:19 +03:00
|
|
|
# shellcheck disable=SC2154
|
ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
# shellcheck disable=SC2292
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
|
|
|
# CDDL HEADER START
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the terms of the
|
|
|
|
# Common Development and Distribution License, Version 1.0 only
|
|
|
|
# (the "License"). You may not use this file except in compliance
|
|
|
|
# with the License.
|
|
|
|
#
|
|
|
|
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
2022-07-12 00:16:13 +03:00
|
|
|
# or https://opensource.org/licenses/CDDL-1.0.
|
2015-07-02 01:23:09 +03:00
|
|
|
# See the License for the specific language governing permissions
|
|
|
|
# and limitations under the License.
|
|
|
|
#
|
|
|
|
# When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
# If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
# fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
# information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
#
|
|
|
|
# CDDL HEADER END
|
|
|
|
#
|
|
|
|
|
2021-12-01 20:38:53 +03:00
|
|
|
#
|
|
|
|
# Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
|
|
|
|
#
|
|
|
|
|
2022-04-06 01:15:45 +03:00
|
|
|
SCRIPT_COMMON=${SCRIPT_COMMON:-${0%/*}/common.sh}
|
|
|
|
. "${SCRIPT_COMMON}" || exit
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
PROG=zfs-tests.sh
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
VERBOSE="no"
|
2019-08-26 04:30:39 +03:00
|
|
|
QUIET=""
|
2024-04-16 19:13:01 +03:00
|
|
|
DEBUG=""
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
CLEANUP="yes"
|
|
|
|
CLEANUPALL="no"
|
2022-03-23 18:15:02 +03:00
|
|
|
KMSG=""
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
LOOPBACK="yes"
|
2018-12-07 21:51:42 +03:00
|
|
|
STACK_TRACER="no"
|
2016-07-14 02:48:01 +03:00
|
|
|
FILESIZE="4G"
|
2019-10-09 20:39:26 +03:00
|
|
|
DEFAULT_RUNFILES="common.run,$(uname | tr '[:upper:]' '[:lower:]').run"
|
|
|
|
RUNFILES=${RUNFILES:-$DEFAULT_RUNFILES}
|
2015-07-02 01:23:09 +03:00
|
|
|
FILEDIR=${FILEDIR:-/var/tmp}
|
|
|
|
DISKS=${DISKS:-""}
|
2020-08-08 00:10:48 +03:00
|
|
|
SINGLETEST=""
|
2017-02-24 21:59:24 +03:00
|
|
|
SINGLETESTUSER="root"
|
2017-11-08 01:55:31 +03:00
|
|
|
TAGS=""
|
2017-11-03 19:53:32 +03:00
|
|
|
ITERATIONS=1
|
2017-04-12 23:36:48 +03:00
|
|
|
ZFS_DBGMSG="$STF_SUITE/callbacks/zfs_dbgmsg.ksh"
|
|
|
|
ZFS_DMESG="$STF_SUITE/callbacks/zfs_dmesg.ksh"
|
2022-03-04 02:09:08 +03:00
|
|
|
UNAME=$(uname)
|
2021-12-01 20:38:53 +03:00
|
|
|
RERUN=""
|
2022-02-24 21:21:13 +03:00
|
|
|
KMEMLEAK=""
|
2019-12-18 23:29:43 +03:00
|
|
|
|
|
|
|
# Override some defaults if on FreeBSD
|
|
|
|
if [ "$UNAME" = "FreeBSD" ] ; then
|
|
|
|
TESTFAIL_CALLBACKS=${TESTFAIL_CALLBACKS:-"$ZFS_DMESG"}
|
|
|
|
LOSETUP=/sbin/mdconfig
|
|
|
|
DMSETUP=/sbin/gpart
|
|
|
|
else
|
|
|
|
ZFS_MMP="$STF_SUITE/callbacks/zfs_mmp.ksh"
|
|
|
|
TESTFAIL_CALLBACKS=${TESTFAIL_CALLBACKS:-"$ZFS_DBGMSG:$ZFS_DMESG:$ZFS_MMP"}
|
|
|
|
LOSETUP=${LOSETUP:-/sbin/losetup}
|
|
|
|
DMSETUP=${DMSETUP:-/sbin/dmsetup}
|
|
|
|
fi
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Log an informational message when additional verbosity is enabled.
|
|
|
|
#
|
|
|
|
msg() {
|
|
|
|
if [ "$VERBOSE" = "yes" ]; then
|
|
|
|
echo "$@"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Log a failure message, cleanup, and return an error.
|
|
|
|
#
|
|
|
|
fail() {
|
2020-08-08 00:10:48 +03:00
|
|
|
echo "$PROG: $1" >&2
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
cleanup
|
|
|
|
exit 1
|
|
|
|
}
|
2015-07-02 01:23:09 +03:00
|
|
|
|
2019-12-18 23:29:43 +03:00
|
|
|
cleanup_freebsd_loopback() {
|
|
|
|
for TEST_LOOPBACK in ${LOOPBACKS}; do
|
|
|
|
if [ -c "/dev/${TEST_LOOPBACK}" ]; then
|
|
|
|
sudo "${LOSETUP}" -d -u "${TEST_LOOPBACK}" ||
|
|
|
|
echo "Failed to destroy: ${TEST_LOOPBACK}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
cleanup_linux_loopback() {
|
|
|
|
for TEST_LOOPBACK in ${LOOPBACKS}; do
|
2021-11-11 23:27:37 +03:00
|
|
|
LOOP_DEV="${TEST_LOOPBACK##*/}"
|
2019-12-18 23:29:43 +03:00
|
|
|
DM_DEV=$(sudo "${DMSETUP}" ls 2>/dev/null | \
|
2022-03-14 03:39:03 +03:00
|
|
|
awk -v l="${LOOP_DEV}" '$0 ~ l {print $1}')
|
2019-12-18 23:29:43 +03:00
|
|
|
|
|
|
|
if [ -n "$DM_DEV" ]; then
|
|
|
|
sudo "${DMSETUP}" remove "${DM_DEV}" ||
|
|
|
|
echo "Failed to remove: ${DM_DEV}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${TEST_LOOPBACK}" ]; then
|
|
|
|
sudo "${LOSETUP}" -d "${TEST_LOOPBACK}" ||
|
|
|
|
echo "Failed to remove: ${TEST_LOOPBACK}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
|
|
|
# Attempt to remove loopback devices and files which where created earlier
|
|
|
|
# by this script to run the test framework. The '-k' option may be passed
|
|
|
|
# to the script to suppress cleanup for debugging purposes.
|
|
|
|
#
|
|
|
|
cleanup() {
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
if [ "$CLEANUP" = "no" ]; then
|
2015-07-02 01:23:09 +03:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2019-12-18 23:29:43 +03:00
|
|
|
if [ "$LOOPBACK" = "yes" ]; then
|
|
|
|
if [ "$UNAME" = "FreeBSD" ] ; then
|
|
|
|
cleanup_freebsd_loopback
|
|
|
|
else
|
|
|
|
cleanup_linux_loopback
|
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
fi
|
|
|
|
|
2022-03-14 03:39:03 +03:00
|
|
|
# shellcheck disable=SC2086
|
|
|
|
rm -f ${FILES} >/dev/null 2>&1
|
2017-04-06 03:18:22 +03:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
if [ "$STF_PATH_REMOVE" = "yes" ] && [ -d "$STF_PATH" ]; then
|
2017-04-06 03:18:22 +03:00
|
|
|
rm -Rf "$STF_PATH"
|
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
#
|
|
|
|
# Attempt to remove all testpools (testpool.XXX), unopened dm devices,
|
|
|
|
# loopback devices, and files. This is a useful way to cleanup a previous
|
|
|
|
# test run failure which has left the system in an unknown state. This can
|
|
|
|
# be dangerous and should only be used in a dedicated test environment.
|
|
|
|
#
|
|
|
|
cleanup_all() {
|
2022-03-14 03:39:03 +03:00
|
|
|
TEST_POOLS=$(ASAN_OPTIONS=detect_leaks=false "$ZPOOL" list -Ho name | grep testpool)
|
2019-12-18 23:29:43 +03:00
|
|
|
if [ "$UNAME" = "FreeBSD" ] ; then
|
|
|
|
TEST_LOOPBACKS=$(sudo "${LOSETUP}" -l)
|
|
|
|
else
|
2022-03-14 03:39:03 +03:00
|
|
|
TEST_LOOPBACKS=$("${LOSETUP}" -a | awk -F: '/file-vdev/ {print $1}')
|
2019-12-18 23:29:43 +03:00
|
|
|
fi
|
2022-03-14 03:39:03 +03:00
|
|
|
TEST_FILES=$(ls "${FILEDIR}"/file-vdev* /var/tmp/file-vdev* 2>/dev/null)
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
msg
|
|
|
|
msg "--- Cleanup ---"
|
2022-03-14 03:39:03 +03:00
|
|
|
# shellcheck disable=2116,2086
|
|
|
|
msg "Removing pool(s): $(echo ${TEST_POOLS})"
|
2015-07-02 01:23:09 +03:00
|
|
|
for TEST_POOL in $TEST_POOLS; do
|
2022-02-04 01:35:38 +03:00
|
|
|
sudo env ASAN_OPTIONS=detect_leaks=false "$ZPOOL" destroy "${TEST_POOL}"
|
2015-07-02 01:23:09 +03:00
|
|
|
done
|
|
|
|
|
2019-12-18 23:29:43 +03:00
|
|
|
if [ "$UNAME" != "FreeBSD" ] ; then
|
2022-03-14 03:39:03 +03:00
|
|
|
msg "Removing all dm(s): $(sudo "${DMSETUP}" ls |
|
2019-12-18 23:29:43 +03:00
|
|
|
grep loop | tr '\n' ' ')"
|
|
|
|
sudo "${DMSETUP}" remove_all
|
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
|
2022-03-14 03:39:03 +03:00
|
|
|
# shellcheck disable=2116,2086
|
|
|
|
msg "Removing loopback(s): $(echo ${TEST_LOOPBACKS})"
|
2015-07-02 01:23:09 +03:00
|
|
|
for TEST_LOOPBACK in $TEST_LOOPBACKS; do
|
2019-12-18 23:29:43 +03:00
|
|
|
if [ "$UNAME" = "FreeBSD" ] ; then
|
|
|
|
sudo "${LOSETUP}" -d -u "${TEST_LOOPBACK}"
|
|
|
|
else
|
|
|
|
sudo "${LOSETUP}" -d "${TEST_LOOPBACK}"
|
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
done
|
|
|
|
|
2022-03-14 03:39:03 +03:00
|
|
|
# shellcheck disable=2116,2086
|
|
|
|
msg "Removing files(s): $(echo ${TEST_FILES})"
|
|
|
|
# shellcheck disable=2086
|
|
|
|
sudo rm -f ${TEST_FILES}
|
2015-07-02 01:23:09 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Takes a name as the only arguments and looks for the following variations
|
|
|
|
# on that name. If one is found it is returned.
|
|
|
|
#
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
# $RUNFILE_DIR/<name>
|
|
|
|
# $RUNFILE_DIR/<name>.run
|
2015-07-02 01:23:09 +03:00
|
|
|
# <name>
|
|
|
|
# <name>.run
|
|
|
|
#
|
|
|
|
find_runfile() {
|
2020-08-08 00:10:48 +03:00
|
|
|
NAME=$1
|
2015-07-02 01:23:09 +03:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
if [ -f "$RUNFILE_DIR/$NAME" ]; then
|
2022-03-14 03:39:03 +03:00
|
|
|
echo "$RUNFILE_DIR/$NAME"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
elif [ -f "$RUNFILE_DIR/$NAME.run" ]; then
|
2022-03-14 03:39:03 +03:00
|
|
|
echo "$RUNFILE_DIR/$NAME.run"
|
2015-07-02 01:23:09 +03:00
|
|
|
elif [ -f "$NAME" ]; then
|
2022-03-14 03:39:03 +03:00
|
|
|
echo "$NAME"
|
2015-07-02 01:23:09 +03:00
|
|
|
elif [ -f "$NAME.run" ]; then
|
2022-03-14 03:39:03 +03:00
|
|
|
echo "$NAME.run"
|
|
|
|
else
|
|
|
|
return 1
|
2015-07-02 01:23:09 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
# Given a TAGS with a format like "1/3" or "2/3" then divide up the test list
|
|
|
|
# into portions and print that portion. So "1/3" for "the first third of the
|
|
|
|
# test tags".
|
|
|
|
#
|
|
|
|
#
|
|
|
|
split_tags() {
|
|
|
|
# Get numerator and denominator
|
|
|
|
NUM=$(echo "$TAGS" | cut -d/ -f1)
|
|
|
|
DEN=$(echo "$TAGS" | cut -d/ -f2)
|
|
|
|
# At the point this is called, RUNFILES will contain a comma separated
|
|
|
|
# list of full paths to the runfiles, like:
|
|
|
|
#
|
|
|
|
# "/home/hutter/qemu/tests/runfiles/common.run,/home/hutter/qemu/tests/runfiles/linux.run"
|
|
|
|
#
|
|
|
|
# So to get tags for our selected tests we do:
|
|
|
|
#
|
|
|
|
# 1. Remove unneeded chars: [],\
|
|
|
|
# 2. Print out the last field of each tag line. This will be the tag
|
|
|
|
# for the test (like 'zpool_add').
|
|
|
|
# 3. Remove duplicates between the runfiles. If the same tag is defined
|
|
|
|
# in multiple runfiles, then when you do '-T <tag>' ZTS is smart
|
|
|
|
# enough to know to run the tag in each runfile. So '-T zpool_add'
|
|
|
|
# will run the zpool_add from common.run and linux.run.
|
|
|
|
# 4. Ignore the 'functional' tag since we only want individual tests
|
|
|
|
# 5. Print out the tests in our faction of all tests. This uses modulus
|
|
|
|
# so "1/3" will run tests 1,3,6,9 etc. That way the tests are
|
|
|
|
# interleaved so, say, "3/4" isn't running all the zpool_* tests that
|
|
|
|
# appear alphabetically at the end.
|
|
|
|
# 6. Remove trailing comma from list
|
|
|
|
#
|
|
|
|
# TAGS will then look like:
|
|
|
|
#
|
|
|
|
# "append,atime,bootfs,cachefile,checksum,cp_files,deadman,dos_attributes, ..."
|
|
|
|
|
|
|
|
# Change the comma to a space for easy processing
|
|
|
|
_RUNFILES=${RUNFILES//","/" "}
|
|
|
|
# shellcheck disable=SC2002,SC2086
|
|
|
|
cat $_RUNFILES | tr -d "[],\'" | awk '/tags = /{print $NF}' | sort | \
|
|
|
|
uniq | grep -v functional | \
|
|
|
|
awk -v num="$NUM" -v den="$DEN" '{ if(NR % den == (num - 1)) {printf "%s,",$0}}' | \
|
|
|
|
sed -E 's/,$//'
|
|
|
|
}
|
|
|
|
|
2017-04-06 03:18:22 +03:00
|
|
|
#
|
|
|
|
# Symlink file if it appears under any of the given paths.
|
|
|
|
#
|
|
|
|
create_links() {
|
2020-08-08 00:10:48 +03:00
|
|
|
dir_list="$1"
|
|
|
|
file_list="$2"
|
2017-04-06 03:18:22 +03:00
|
|
|
|
2017-04-07 03:16:41 +03:00
|
|
|
[ -n "$STF_PATH" ] || fail "STF_PATH wasn't correctly set"
|
2017-04-06 03:18:22 +03:00
|
|
|
|
|
|
|
for i in $file_list; do
|
|
|
|
for j in $dir_list; do
|
|
|
|
[ ! -e "$STF_PATH/$i" ] || continue
|
|
|
|
|
2017-04-07 03:16:41 +03:00
|
|
|
if [ ! -d "$j/$i" ] && [ -e "$j/$i" ]; then
|
2020-04-14 21:36:28 +03:00
|
|
|
ln -sf "$j/$i" "$STF_PATH/$i" || \
|
2017-04-06 03:18:22 +03:00
|
|
|
fail "Couldn't link $i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2020-08-08 00:10:48 +03:00
|
|
|
[ ! -e "$STF_PATH/$i" ] && \
|
|
|
|
STF_MISSING_BIN="$STF_MISSING_BIN $i"
|
2017-04-06 03:18:22 +03:00
|
|
|
done
|
2020-08-08 00:10:48 +03:00
|
|
|
STF_MISSING_BIN=${STF_MISSING_BIN# }
|
2017-04-06 03:18:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Constrain the path to limit the available binaries to a known set.
|
|
|
|
# When running in-tree a top level ./bin/ directory is created for
|
|
|
|
# convenience, otherwise a temporary directory is used.
|
|
|
|
#
|
|
|
|
constrain_path() {
|
2017-04-07 03:16:41 +03:00
|
|
|
. "$STF_SUITE/include/commands.cfg"
|
2017-04-06 03:18:22 +03:00
|
|
|
|
2020-01-29 22:23:20 +03:00
|
|
|
# On FreeBSD, base system zfs utils are in /sbin and OpenZFS utils
|
|
|
|
# install to /usr/local/sbin. To avoid testing the wrong utils we
|
|
|
|
# need /usr/local to come before / in the path search order.
|
|
|
|
SYSTEM_DIRS="/usr/local/bin /usr/local/sbin"
|
2020-11-28 22:15:57 +03:00
|
|
|
SYSTEM_DIRS="$SYSTEM_DIRS /usr/bin /usr/sbin /bin /sbin $LIBEXEC_DIR"
|
2019-12-18 23:29:43 +03:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
if [ "$INTREE" = "yes" ]; then
|
2022-04-09 05:09:55 +03:00
|
|
|
# Constrained path set to $(top_builddir)/tests/zfs-tests/bin
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
STF_PATH="$BIN_DIR"
|
|
|
|
STF_PATH_REMOVE="no"
|
|
|
|
STF_MISSING_BIN=""
|
2017-04-06 03:18:22 +03:00
|
|
|
if [ ! -d "$STF_PATH" ]; then
|
|
|
|
mkdir "$STF_PATH"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
chmod 755 "$STF_PATH" || fail "Couldn't chmod $STF_PATH"
|
2017-04-06 03:18:22 +03:00
|
|
|
fi
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
|
|
|
|
# Special case links for standard zfs utilities
|
2022-04-09 05:09:55 +03:00
|
|
|
create_links "$CMD_DIR" "$ZFS_FILES"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
|
|
|
|
# Special case links for zfs test suite utilities
|
2022-04-09 05:09:55 +03:00
|
|
|
create_links "$CMD_DIR/tests/zfs-tests/cmd" "$ZFSTEST_FILES"
|
2017-04-06 03:18:22 +03:00
|
|
|
else
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
# Constrained path set to /var/tmp/constrained_path.*
|
2020-12-03 21:01:16 +03:00
|
|
|
SYSTEMDIR=${SYSTEMDIR:-/var/tmp/constrained_path.XXXXXX}
|
2019-12-18 23:29:43 +03:00
|
|
|
STF_PATH=$(mktemp -d "$SYSTEMDIR")
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
STF_PATH_REMOVE="yes"
|
|
|
|
STF_MISSING_BIN=""
|
2017-04-06 03:18:22 +03:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
chmod 755 "$STF_PATH" || fail "Couldn't chmod $STF_PATH"
|
2017-04-06 03:18:22 +03:00
|
|
|
|
|
|
|
# Special case links for standard zfs utilities
|
2019-12-18 23:29:43 +03:00
|
|
|
create_links "$SYSTEM_DIRS" "$ZFS_FILES"
|
2017-04-06 03:18:22 +03:00
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
# Special case links for zfs test suite utilities
|
|
|
|
create_links "$STF_SUITE/bin" "$ZFSTEST_FILES"
|
2017-04-06 03:18:22 +03:00
|
|
|
fi
|
|
|
|
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
# Standard system utilities
|
2019-12-18 23:29:43 +03:00
|
|
|
SYSTEM_FILES="$SYSTEM_FILES_COMMON"
|
|
|
|
if [ "$UNAME" = "FreeBSD" ] ; then
|
2020-08-08 00:10:48 +03:00
|
|
|
SYSTEM_FILES="$SYSTEM_FILES $SYSTEM_FILES_FREEBSD"
|
2019-12-18 23:29:43 +03:00
|
|
|
else
|
2020-08-08 00:10:48 +03:00
|
|
|
SYSTEM_FILES="$SYSTEM_FILES $SYSTEM_FILES_LINUX"
|
2019-12-18 23:29:43 +03:00
|
|
|
fi
|
|
|
|
create_links "$SYSTEM_DIRS" "$SYSTEM_FILES"
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
|
2017-04-06 03:18:22 +03:00
|
|
|
# Exceptions
|
2019-12-18 23:29:43 +03:00
|
|
|
if [ "$UNAME" = "Linux" ] ; then
|
|
|
|
ln -fs /sbin/fsck.ext4 "$STF_PATH/fsck"
|
|
|
|
ln -fs /sbin/mkfs.ext4 "$STF_PATH/newfs"
|
|
|
|
ln -fs "$STF_PATH/gzip" "$STF_PATH/compress"
|
|
|
|
ln -fs "$STF_PATH/gunzip" "$STF_PATH/uncompress"
|
|
|
|
elif [ "$UNAME" = "FreeBSD" ] ; then
|
|
|
|
ln -fs /usr/local/bin/ksh93 "$STF_PATH/ksh"
|
|
|
|
fi
|
2017-04-06 03:18:22 +03:00
|
|
|
}
|
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
|
|
|
# Output a useful usage message.
|
|
|
|
#
|
|
|
|
usage() {
|
|
|
|
cat << EOF
|
|
|
|
USAGE:
|
2020-09-08 19:04:36 +03:00
|
|
|
$0 [-hvqxkfS] [-s SIZE] [-r RUNFILES] [-t PATH] [-u USER]
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
DESCRIPTION:
|
|
|
|
ZFS Test Suite launch script
|
|
|
|
|
|
|
|
OPTIONS:
|
|
|
|
-h Show this message
|
|
|
|
-v Verbose zfs-tests.sh output
|
|
|
|
-q Quiet test-runner output
|
2024-04-16 19:13:01 +03:00
|
|
|
-D Debug; show all test output immediately (noisy)
|
2015-07-02 01:23:09 +03:00
|
|
|
-x Remove all testpools, dm, lo, and files (unsafe)
|
|
|
|
-k Disable cleanup after test failure
|
2022-03-23 18:15:02 +03:00
|
|
|
-K Log test names to /dev/kmsg
|
2015-07-02 01:23:09 +03:00
|
|
|
-f Use files only, disables block device tests
|
2018-12-07 21:51:42 +03:00
|
|
|
-S Enable stack tracer (negative performance impact)
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
-c Only create and populate constrained path
|
2021-12-01 20:38:53 +03:00
|
|
|
-R Automatically rerun failing tests
|
2022-02-24 21:21:13 +03:00
|
|
|
-m Enable kmemleak reporting (Linux only)
|
2018-02-12 02:11:59 +03:00
|
|
|
-n NFSFILE Use the nfsfile to determine the NFS configuration
|
2017-11-03 19:53:32 +03:00
|
|
|
-I NUM Number of iterations
|
2022-03-09 16:17:11 +03:00
|
|
|
-d DIR Use world-writable DIR for files and loopback devices
|
2016-07-14 02:48:01 +03:00
|
|
|
-s SIZE Use vdevs of SIZE (default: 4G)
|
2019-10-09 20:39:26 +03:00
|
|
|
-r RUNFILES Run tests in RUNFILES (default: ${DEFAULT_RUNFILES})
|
2024-04-15 23:44:12 +03:00
|
|
|
-t PATH|NAME Run single test at PATH relative to test suite,
|
|
|
|
or search for test by NAME
|
2017-11-08 01:55:31 +03:00
|
|
|
-T TAGS Comma separated list of tags (default: 'functional')
|
ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
Alternately, specify a fraction like "1/3" or "2/3" to
|
|
|
|
run the first third of tests or 2nd third of the tests. This
|
|
|
|
is useful for splitting up the test amongst different
|
|
|
|
runners.
|
2017-02-24 21:59:24 +03:00
|
|
|
-u USER Run single test as USER (default: root)
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
EXAMPLES:
|
ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
# Run the default ${DEFAULT_RUNFILES//\.run/} suite of tests and output the configuration used.
|
2015-07-02 01:23:09 +03:00
|
|
|
$0 -v
|
|
|
|
|
|
|
|
# Run a smaller suite of tests designed to run more quickly.
|
|
|
|
$0 -r linux-fast
|
|
|
|
|
2020-01-24 08:11:06 +03:00
|
|
|
# Run a single test
|
|
|
|
$0 -t tests/functional/cli_root/zfs_bookmark/zfs_bookmark_cliargs.ksh
|
|
|
|
|
2024-04-15 23:44:12 +03:00
|
|
|
# Run a single test by name
|
|
|
|
$0 -t zfs_bookmark_cliargs
|
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
# Cleanup a previous run of the test suite prior to testing, run the
|
ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
# default ${DEFAULT_RUNFILES//\.run//} suite of tests and perform no cleanup on exit.
|
2016-04-06 19:48:10 +03:00
|
|
|
$0 -x
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2024-04-16 19:13:01 +03:00
|
|
|
while getopts 'hvqxkKfScRmn:d:Ds:r:?t:T:u:I:' OPTION; do
|
2015-07-02 01:23:09 +03:00
|
|
|
case $OPTION in
|
|
|
|
h)
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
v)
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
VERBOSE="yes"
|
2015-07-02 01:23:09 +03:00
|
|
|
;;
|
|
|
|
q)
|
2019-08-26 04:30:39 +03:00
|
|
|
QUIET="yes"
|
2015-07-02 01:23:09 +03:00
|
|
|
;;
|
|
|
|
x)
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
CLEANUPALL="yes"
|
2015-07-02 01:23:09 +03:00
|
|
|
;;
|
|
|
|
k)
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
CLEANUP="no"
|
2015-07-02 01:23:09 +03:00
|
|
|
;;
|
2022-03-23 18:15:02 +03:00
|
|
|
K)
|
|
|
|
KMSG="yes"
|
|
|
|
;;
|
2015-07-02 01:23:09 +03:00
|
|
|
f)
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
LOOPBACK="no"
|
|
|
|
;;
|
2018-12-07 21:51:42 +03:00
|
|
|
S)
|
|
|
|
STACK_TRACER="yes"
|
|
|
|
;;
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
c)
|
|
|
|
constrain_path
|
|
|
|
exit
|
2015-07-02 01:23:09 +03:00
|
|
|
;;
|
2021-12-01 20:38:53 +03:00
|
|
|
R)
|
|
|
|
RERUN="yes"
|
|
|
|
;;
|
2022-02-24 21:21:13 +03:00
|
|
|
m)
|
|
|
|
KMEMLEAK="yes"
|
|
|
|
;;
|
2018-02-12 02:11:59 +03:00
|
|
|
n)
|
|
|
|
nfsfile=$OPTARG
|
2020-08-08 00:10:48 +03:00
|
|
|
[ -f "$nfsfile" ] || fail "Cannot read file: $nfsfile"
|
2018-02-12 02:11:59 +03:00
|
|
|
export NFS=1
|
|
|
|
. "$nfsfile"
|
|
|
|
;;
|
2015-07-02 01:23:09 +03:00
|
|
|
d)
|
|
|
|
FILEDIR="$OPTARG"
|
|
|
|
;;
|
2024-04-16 19:13:01 +03:00
|
|
|
D)
|
|
|
|
DEBUG="yes"
|
|
|
|
;;
|
2017-11-03 19:53:32 +03:00
|
|
|
I)
|
|
|
|
ITERATIONS="$OPTARG"
|
|
|
|
if [ "$ITERATIONS" -le 0 ]; then
|
|
|
|
fail "Iterations must be greater than 0."
|
|
|
|
fi
|
|
|
|
;;
|
2015-07-02 01:23:09 +03:00
|
|
|
s)
|
|
|
|
FILESIZE="$OPTARG"
|
|
|
|
;;
|
|
|
|
r)
|
2019-10-09 20:39:26 +03:00
|
|
|
RUNFILES="$OPTARG"
|
2015-07-02 01:23:09 +03:00
|
|
|
;;
|
2017-02-24 21:59:24 +03:00
|
|
|
t)
|
2020-08-08 00:10:48 +03:00
|
|
|
if [ -n "$SINGLETEST" ]; then
|
2017-02-24 21:59:24 +03:00
|
|
|
fail "-t can only be provided once."
|
|
|
|
fi
|
2020-08-08 00:10:48 +03:00
|
|
|
SINGLETEST="$OPTARG"
|
2017-02-24 21:59:24 +03:00
|
|
|
;;
|
2017-11-03 19:53:32 +03:00
|
|
|
T)
|
|
|
|
TAGS="$OPTARG"
|
|
|
|
;;
|
2017-02-24 21:59:24 +03:00
|
|
|
u)
|
|
|
|
SINGLETESTUSER="$OPTARG"
|
|
|
|
;;
|
2015-07-02 01:23:09 +03:00
|
|
|
?)
|
|
|
|
usage
|
|
|
|
exit
|
|
|
|
;;
|
2022-01-13 21:09:19 +03:00
|
|
|
*)
|
|
|
|
;;
|
2015-07-02 01:23:09 +03:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift $((OPTIND-1))
|
|
|
|
|
|
|
|
FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
|
|
|
|
LOOPBACKS=${LOOPBACKS:-""}
|
|
|
|
|
2020-08-08 00:10:48 +03:00
|
|
|
if [ -n "$SINGLETEST" ]; then
|
2017-11-08 01:55:31 +03:00
|
|
|
if [ -n "$TAGS" ]; then
|
|
|
|
fail "-t and -T are mutually exclusive."
|
|
|
|
fi
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
RUNFILE_DIR="/var/tmp"
|
2019-10-09 20:39:26 +03:00
|
|
|
RUNFILES="zfs-tests.$$.run"
|
2022-03-24 16:47:22 +03:00
|
|
|
[ -n "$QUIET" ] && SINGLEQUIET="True" || SINGLEQUIET="False"
|
2017-02-24 21:59:24 +03:00
|
|
|
|
2022-01-13 21:09:19 +03:00
|
|
|
cat >"${RUNFILE_DIR}/${RUNFILES}" << EOF
|
2017-02-24 21:59:24 +03:00
|
|
|
[DEFAULT]
|
|
|
|
pre =
|
|
|
|
quiet = $SINGLEQUIET
|
|
|
|
pre_user = root
|
|
|
|
user = $SINGLETESTUSER
|
|
|
|
timeout = 600
|
|
|
|
post_user = root
|
|
|
|
post =
|
|
|
|
outputdir = /var/tmp/test_results
|
|
|
|
EOF
|
2024-04-15 23:44:12 +03:00
|
|
|
if [ "$SINGLETEST" = "${SINGLETEST%/*}" ] ; then
|
|
|
|
NEWSINGLETEST=$(find "$STF_SUITE" -name "$SINGLETEST*" -print -quit)
|
|
|
|
if [ -z "$NEWSINGLETEST" ] ; then
|
|
|
|
fail "couldn't find test matching '$SINGLETEST'"
|
|
|
|
fi
|
|
|
|
SINGLETEST=$NEWSINGLETEST
|
|
|
|
fi
|
2017-02-24 21:59:24 +03:00
|
|
|
|
2024-04-15 23:44:12 +03:00
|
|
|
SINGLETESTDIR="${SINGLETEST%/*}"
|
2022-03-24 16:47:22 +03:00
|
|
|
SETUPDIR="$SINGLETESTDIR"
|
|
|
|
[ "${SETUPDIR#/}" = "$SETUPDIR" ] && SETUPDIR="$STF_SUITE/$SINGLETESTDIR"
|
|
|
|
[ -x "$SETUPDIR/setup.ksh" ] && SETUPSCRIPT="setup" || SETUPSCRIPT=
|
|
|
|
[ -x "$SETUPDIR/cleanup.ksh" ] && CLEANUPSCRIPT="cleanup" || CLEANUPSCRIPT=
|
2020-08-08 00:10:48 +03:00
|
|
|
|
2022-03-24 16:47:22 +03:00
|
|
|
SINGLETESTFILE="${SINGLETEST##*/}"
|
2022-01-13 21:09:19 +03:00
|
|
|
cat >>"${RUNFILE_DIR}/${RUNFILES}" << EOF
|
2017-02-24 21:59:24 +03:00
|
|
|
|
|
|
|
[$SINGLETESTDIR]
|
|
|
|
tests = ['$SINGLETESTFILE']
|
|
|
|
pre = $SETUPSCRIPT
|
|
|
|
post = $CLEANUPSCRIPT
|
2017-11-08 01:55:31 +03:00
|
|
|
tags = ['functional']
|
2017-02-24 21:59:24 +03:00
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|
2017-11-08 01:55:31 +03:00
|
|
|
#
|
|
|
|
# Use default tag if none was specified
|
|
|
|
#
|
|
|
|
TAGS=${TAGS:='functional'}
|
|
|
|
|
ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
|
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
2019-10-09 20:39:26 +03:00
|
|
|
# Attempt to locate the runfiles describing the test workload.
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
2019-10-09 20:39:26 +03:00
|
|
|
R=""
|
|
|
|
IFS=,
|
|
|
|
for RUNFILE in $RUNFILES; do
|
|
|
|
if [ -n "$RUNFILE" ]; then
|
|
|
|
SAVED_RUNFILE="$RUNFILE"
|
2022-03-14 03:39:03 +03:00
|
|
|
RUNFILE=$(find_runfile "$RUNFILE") ||
|
|
|
|
fail "Cannot find runfile: $SAVED_RUNFILE"
|
2020-08-08 00:10:48 +03:00
|
|
|
R="$R,$RUNFILE"
|
2019-10-09 20:39:26 +03:00
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
|
2019-10-09 20:39:26 +03:00
|
|
|
if [ ! -r "$RUNFILE" ]; then
|
|
|
|
fail "Cannot read runfile: $RUNFILE"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
unset IFS
|
2020-08-08 00:10:48 +03:00
|
|
|
RUNFILES=${R#,}
|
2015-07-02 01:23:09 +03:00
|
|
|
|
ZTS: Use QEMU for tests on Linux and FreeBSD
This commit adds functional tests for these systems:
- AlmaLinux 8, AlmaLinux 9, ArchLinux
- CentOS Stream 9, Fedora 39, Fedora 40
- Debian 11, Debian 12
- FreeBSD 13, FreeBSD 14, FreeBSD 15
- Ubuntu 20.04, Ubuntu 22.04, Ubuntu 24.04
- enabled by default:
- AlmaLinux 8, AlmaLinux 9
- Debian 11, Debian 12
- Fedora 39, Fedora 40
- FreeBSD 13, FreeBSD 14
Workflow for each operating system:
- install qemu on the github runner
- download current cloud image of operating system
- start and init that image via cloud-init
- install dependencies and poweroff system
- start system and build openzfs and then poweroff again
- clone build system and start 2 instances of it
- run functional testings and complete in around 3h
- when tests are done, do some logfile preparing
- show detailed results for each system
- in the end, generate the job summary
Real-world benefits from this PR:
1. The github runner scripts are in the zfs repo itself. That means
you can just open a PR against zfs, like "Add Fedora 41 tester", and
see the results directly in the PR. ZFS admins no longer need
manually to login to the buildbot server to update the buildbot config
with new version of Fedora/Almalinux.
2. Github runners allow you to run the entire test suite against your
private branch before submitting a formal PR to openzfs. Just open a
PR against your private zfs repo, and the exact same
Fedora/Alma/FreeBSD runners will fire up and run ZTS. This can be
useful if you want to iterate on a ZTS change before submitting a
formal PR.
3. buildbot is incredibly cumbersome. Our buildbot config files alone
are ~1500 lines (not including any build/setup scripts)!
It's a huge pain to setup.
4. We're running the super ancient buildbot 0.8.12. It's so ancient
it requires python2. We actually have to build python2 from source
for almalinux9 just to get it to run. Ugrading to a more modern
buildbot is a huge undertaking, and the UI on the newer versions is
worse.
5. Buildbot uses EC2 instances. EC2 is a pain because:
* It costs money
* They throttle IOPS and CPU usage, leading to mysterious,
* hard-to-diagnose, failures and timeouts in ZTS.
* EC2 is high maintenance. We have to setup security groups, SSH
* keys, networking, users, etc, in AWS and it's a pain. We also
* have to periodically go in an kill zombie EC2 instances that
* buildbot is unable to kill off.
6. Buildbot doesn't always handle failures well. One of the things we
saw in the past was the FreeBSD builders would often die, and each
builder death would take up a "slot" in buildbot. So we would
periodically have to restart buildbot via a cron job to get the slots
back.
7. This PR divides up the ZTS test list into two parts, launches two
VMs, and on each VM runs half the test suite. The test results are
then merged and shown in the sumary page. So we're basically
parallelizing ZTS on the same github runner. This leads to lower
overall ZTS runtimes (2.5-3 hours vs 4+ hours on buildbot), and one
unified set of results per runner, which is nice.
8. Since the tests are running on a VM, we have much more control over
what happens. We can capture the serial console output even if the
test completely brings down the VM. In the future, we could also
restart the test on the VM where it left off, so that if a single test
panics the VM, we can just restart it and run the remaining ZTS tests
(this functionaly is not yet implemented though, just an idea).
9. Using the runners, users can manually kill or restart a test run
via the github IU. That really isn't possible with buildbot unless
you're an admin.
10. Anecdotally, the tests seem to be more stable and constant under
the QEMU runners.
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Tony Hutter <hutter2@llnl.gov>
Closes #16537
2024-06-17 17:52:58 +03:00
|
|
|
# The tag can be a fraction to indicate which portion of ZTS to run, Like
|
|
|
|
#
|
|
|
|
# "1/3": Run first one third of all tests in runfiles
|
|
|
|
# "2/3": Run second one third of all test in runfiles
|
|
|
|
# "6/10": Run 6th tenth of all tests in runfiles
|
|
|
|
#
|
|
|
|
# This is useful for splitting up the test across multiple runners.
|
|
|
|
#
|
|
|
|
# After this code block, TAGS will be transformed from something like
|
|
|
|
# "1/3" to a comma separate taglist, like:
|
|
|
|
#
|
|
|
|
# "append,atime,bootfs,cachefile,checksum,cp_files,deadman,dos_attributes, ..."
|
|
|
|
#
|
|
|
|
if echo "$TAGS" | grep -Eq '^[0-9]+/[0-9]+$' ; then
|
|
|
|
TAGS=$(split_tags)
|
|
|
|
fi
|
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
|
|
|
# This script should not be run as root. Instead the test user, which may
|
|
|
|
# be a normal user account, needs to be configured such that it can
|
|
|
|
# run commands via sudo passwordlessly.
|
|
|
|
#
|
2017-03-09 21:20:15 +03:00
|
|
|
if [ "$(id -u)" = "0" ]; then
|
2015-07-02 01:23:09 +03:00
|
|
|
fail "This script must not be run as root."
|
|
|
|
fi
|
|
|
|
|
2022-03-14 03:39:03 +03:00
|
|
|
if [ "$(sudo id -un)" != "root" ]; then
|
2015-07-02 01:23:09 +03:00
|
|
|
fail "Passwordless sudo access required."
|
|
|
|
fi
|
|
|
|
|
2017-04-06 03:18:22 +03:00
|
|
|
#
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
# Constrain the available binaries to a known set.
|
2017-04-06 03:18:22 +03:00
|
|
|
#
|
|
|
|
constrain_path
|
|
|
|
|
2016-04-06 19:48:10 +03:00
|
|
|
#
|
|
|
|
# Check if ksh exists
|
|
|
|
#
|
2019-12-18 23:29:43 +03:00
|
|
|
if [ "$UNAME" = "FreeBSD" ]; then
|
|
|
|
sudo ln -fs /usr/local/bin/ksh93 /bin/ksh
|
|
|
|
fi
|
2017-04-07 03:16:41 +03:00
|
|
|
[ -e "$STF_PATH/ksh" ] || fail "This test suite requires ksh."
|
2017-05-18 22:57:21 +03:00
|
|
|
[ -e "$STF_SUITE/include/default.cfg" ] || fail \
|
|
|
|
"Missing $STF_SUITE/include/default.cfg file."
|
2016-04-06 19:48:10 +03:00
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
# Verify the ZFS module stack is loaded.
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
2018-12-07 21:51:42 +03:00
|
|
|
if [ "$STACK_TRACER" = "yes" ]; then
|
2020-08-08 00:10:48 +03:00
|
|
|
sudo "${ZFS_SH}" -S >/dev/null 2>&1
|
2018-12-07 21:51:42 +03:00
|
|
|
else
|
2020-08-08 00:10:48 +03:00
|
|
|
sudo "${ZFS_SH}" >/dev/null 2>&1
|
2018-12-07 21:51:42 +03:00
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Attempt to cleanup all previous state for a new test run.
|
|
|
|
#
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
if [ "$CLEANUPALL" = "yes" ]; then
|
2015-07-02 01:23:09 +03:00
|
|
|
cleanup_all
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# By default preserve any existing pools
|
|
|
|
#
|
|
|
|
if [ -z "${KEEP}" ]; then
|
2022-03-14 03:39:03 +03:00
|
|
|
KEEP="$(ASAN_OPTIONS=detect_leaks=false "$ZPOOL" list -Ho name | tr -s '[:space:]' ' ')"
|
2015-07-02 01:23:09 +03:00
|
|
|
if [ -z "${KEEP}" ]; then
|
|
|
|
KEEP="rpool"
|
|
|
|
fi
|
2017-09-25 20:32:34 +03:00
|
|
|
else
|
2022-03-14 03:39:03 +03:00
|
|
|
KEEP="$(echo "$KEEP" | tr -s '[:space:]' ' ')"
|
2015-07-02 01:23:09 +03:00
|
|
|
fi
|
|
|
|
|
2017-09-25 20:32:34 +03:00
|
|
|
#
|
|
|
|
# NOTE: The following environment variables are undocumented
|
|
|
|
# and should be used for testing purposes only:
|
|
|
|
#
|
|
|
|
# __ZFS_POOL_EXCLUDE - don't iterate over the pools it lists
|
|
|
|
# __ZFS_POOL_RESTRICT - iterate only over the pools it lists
|
|
|
|
#
|
|
|
|
# See libzfs/libzfs_config.c for more information.
|
|
|
|
#
|
2022-03-14 03:39:03 +03:00
|
|
|
__ZFS_POOL_EXCLUDE="$KEEP"
|
2017-02-04 00:24:44 +03:00
|
|
|
|
2017-04-07 03:16:41 +03:00
|
|
|
. "$STF_SUITE/include/default.cfg"
|
2017-04-06 03:18:22 +03:00
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
|
|
|
# No DISKS have been provided so a basic file or loopback based devices
|
|
|
|
# must be created for the test suite to use.
|
|
|
|
#
|
|
|
|
if [ -z "${DISKS}" ]; then
|
2021-07-27 00:47:08 +03:00
|
|
|
#
|
|
|
|
# If this is a performance run, prevent accidental use of
|
|
|
|
# loopback devices.
|
|
|
|
#
|
|
|
|
[ "$TAGS" = "perf" ] && fail "Running perf tests without disks."
|
|
|
|
|
2015-07-02 01:23:09 +03:00
|
|
|
#
|
|
|
|
# Create sparse files for the test suite. These may be used
|
|
|
|
# directory or have loopback devices layered on them.
|
|
|
|
#
|
|
|
|
for TEST_FILE in ${FILES}; do
|
|
|
|
[ -f "$TEST_FILE" ] && fail "Failed file exists: ${TEST_FILE}"
|
2017-03-09 21:20:15 +03:00
|
|
|
truncate -s "${FILESIZE}" "${TEST_FILE}" ||
|
2015-07-02 01:23:09 +03:00
|
|
|
fail "Failed creating: ${TEST_FILE} ($?)"
|
|
|
|
done
|
|
|
|
|
|
|
|
#
|
|
|
|
# If requested setup loopback devices backed by the sparse files.
|
|
|
|
#
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
if [ "$LOOPBACK" = "yes" ]; then
|
|
|
|
test -x "$LOSETUP" || fail "$LOSETUP utility must be installed"
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
for TEST_FILE in ${FILES}; do
|
2019-12-18 23:29:43 +03:00
|
|
|
if [ "$UNAME" = "FreeBSD" ] ; then
|
|
|
|
MDDEVICE=$(sudo "${LOSETUP}" -a -t vnode -f "${TEST_FILE}")
|
|
|
|
if [ -z "$MDDEVICE" ] ; then
|
|
|
|
fail "Failed: ${TEST_FILE} -> loopback"
|
|
|
|
fi
|
2020-08-08 00:10:48 +03:00
|
|
|
DISKS="$DISKS $MDDEVICE"
|
|
|
|
LOOPBACKS="$LOOPBACKS $MDDEVICE"
|
2018-01-04 00:45:35 +03:00
|
|
|
else
|
2022-03-14 03:39:03 +03:00
|
|
|
TEST_LOOPBACK=$(sudo "${LOSETUP}" --show -f "${TEST_FILE}") ||
|
2019-12-18 23:29:43 +03:00
|
|
|
fail "Failed: ${TEST_FILE} -> ${TEST_LOOPBACK}"
|
2021-11-11 23:27:37 +03:00
|
|
|
BASELOOPBACK="${TEST_LOOPBACK##*/}"
|
2020-08-08 00:10:48 +03:00
|
|
|
DISKS="$DISKS $BASELOOPBACK"
|
|
|
|
LOOPBACKS="$LOOPBACKS $TEST_LOOPBACK"
|
2018-01-04 00:45:35 +03:00
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
done
|
2020-08-08 00:10:48 +03:00
|
|
|
DISKS=${DISKS# }
|
|
|
|
LOOPBACKS=${LOOPBACKS# }
|
|
|
|
else
|
|
|
|
DISKS="$FILES"
|
2015-07-02 01:23:09 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-07-27 00:47:08 +03:00
|
|
|
#
|
|
|
|
# It may be desirable to test with fewer disks than the default when running
|
|
|
|
# the performance tests, but the functional tests require at least three.
|
|
|
|
#
|
Retire legacy test infrastructure
* Removed zpios kmod, utility, headers and man page.
* Removed unused scripts zpios-profile/*, zpios-test/*,
zpool-config/*, smb.sh, zpios-sanity.sh, zpios-survey.sh,
zpios.sh, and zpool-create.sh.
* Removed zfs-script-config.sh.in. When building 'make' generates
a common.sh with in-tree path information from the common.sh.in
template. This file and sourced by the test scripts and used
for in-tree testing, it is not included in the packages. When
building packages 'make install' uses the same template to
create a new common.sh which is appropriate for the packaging.
* Removed unused functions/variables from scripts/common.sh.in.
Only minimal path information and configuration environment
variables remain.
* Removed unused scripts from scripts/ directory.
* Remaining shell scripts in the scripts directory updated to
cleanly pass shellcheck and added to checked scripts.
* Renamed tests/test-runner/cmd/ to tests/test-runner/bin/ to
match install location name.
* Removed last traces of the --enable-debug-dmu-tx configure
options which was retired some time ago.
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6509
2017-08-16 03:26:38 +03:00
|
|
|
NUM_DISKS=$(echo "${DISKS}" | awk '{print NF}')
|
2021-07-27 00:47:08 +03:00
|
|
|
if [ "$TAGS" != "perf" ]; then
|
|
|
|
[ "$NUM_DISKS" -lt 3 ] && fail "Not enough disks ($NUM_DISKS/3 minimum)"
|
|
|
|
fi
|
2015-07-02 01:23:09 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Disable SELinux until the ZFS Test Suite has been updated accordingly.
|
|
|
|
#
|
2022-03-14 03:39:03 +03:00
|
|
|
if command -v setenforce >/dev/null; then
|
2020-08-08 00:10:48 +03:00
|
|
|
sudo setenforce permissive >/dev/null 2>&1
|
2015-07-02 01:23:09 +03:00
|
|
|
fi
|
|
|
|
|
2017-04-12 23:36:48 +03:00
|
|
|
#
|
2017-07-04 00:21:12 +03:00
|
|
|
# Enable internal ZFS debug log and clear it.
|
2017-04-12 23:36:48 +03:00
|
|
|
#
|
|
|
|
if [ -e /sys/module/zfs/parameters/zfs_dbgmsg_enable ]; then
|
2022-03-14 03:39:03 +03:00
|
|
|
sudo sh -c "echo 1 >/sys/module/zfs/parameters/zfs_dbgmsg_enable"
|
|
|
|
sudo sh -c "echo 0 >/proc/spl/kstat/zfs/dbgmsg"
|
2017-04-12 23:36:48 +03:00
|
|
|
fi
|
|
|
|
|
2021-07-27 00:47:08 +03:00
|
|
|
msg
|
|
|
|
msg "--- Configuration ---"
|
|
|
|
msg "Runfiles: $RUNFILES"
|
|
|
|
msg "STF_TOOLS: $STF_TOOLS"
|
|
|
|
msg "STF_SUITE: $STF_SUITE"
|
|
|
|
msg "STF_PATH: $STF_PATH"
|
2015-07-02 01:23:09 +03:00
|
|
|
msg "FILEDIR: $FILEDIR"
|
|
|
|
msg "FILES: $FILES"
|
|
|
|
msg "LOOPBACKS: $LOOPBACKS"
|
|
|
|
msg "DISKS: $DISKS"
|
|
|
|
msg "NUM_DISKS: $NUM_DISKS"
|
|
|
|
msg "FILESIZE: $FILESIZE"
|
2017-11-03 19:53:32 +03:00
|
|
|
msg "ITERATIONS: $ITERATIONS"
|
|
|
|
msg "TAGS: $TAGS"
|
2018-12-07 21:51:42 +03:00
|
|
|
msg "STACK_TRACER: $STACK_TRACER"
|
2015-07-02 01:23:09 +03:00
|
|
|
msg "Keep pool(s): $KEEP"
|
2017-04-06 03:18:22 +03:00
|
|
|
msg "Missing util(s): $STF_MISSING_BIN"
|
2015-07-02 01:23:09 +03:00
|
|
|
msg ""
|
|
|
|
|
|
|
|
export STF_TOOLS
|
|
|
|
export STF_SUITE
|
2017-04-06 03:18:22 +03:00
|
|
|
export STF_PATH
|
2015-07-02 01:23:09 +03:00
|
|
|
export DISKS
|
2017-09-25 20:32:34 +03:00
|
|
|
export FILEDIR
|
2015-07-02 01:23:09 +03:00
|
|
|
export KEEP
|
2017-02-04 00:24:44 +03:00
|
|
|
export __ZFS_POOL_EXCLUDE
|
2017-04-12 23:36:48 +03:00
|
|
|
export TESTFAIL_CALLBACKS
|
2015-07-02 01:23:09 +03:00
|
|
|
|
2022-02-26 22:19:05 +03:00
|
|
|
mktemp_file() {
|
|
|
|
if [ "$UNAME" = "FreeBSD" ]; then
|
|
|
|
mktemp -u "${FILEDIR}/$1.XXXXXX"
|
|
|
|
else
|
|
|
|
mktemp -ut "$1.XXXXXX" -p "$FILEDIR"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
mkdir -p "$FILEDIR" || :
|
|
|
|
RESULTS_FILE=$(mktemp_file zts-results)
|
|
|
|
REPORT_FILE=$(mktemp_file zts-report)
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Run all the tests as specified.
|
|
|
|
#
|
2022-02-24 21:21:13 +03:00
|
|
|
msg "${TEST_RUNNER}" \
|
|
|
|
"${QUIET:+-q}" \
|
2024-04-16 19:13:01 +03:00
|
|
|
"${DEBUG:+-D}" \
|
2022-02-24 21:21:13 +03:00
|
|
|
"${KMEMLEAK:+-m}" \
|
2022-03-23 18:15:02 +03:00
|
|
|
"${KMSG:+-K}" \
|
2019-10-09 20:39:26 +03:00
|
|
|
"-c \"${RUNFILES}\"" \
|
2019-08-26 04:30:39 +03:00
|
|
|
"-T \"${TAGS}\"" \
|
|
|
|
"-i \"${STF_SUITE}\"" \
|
|
|
|
"-I \"${ITERATIONS}\""
|
2022-03-14 03:39:03 +03:00
|
|
|
{ PATH=$STF_PATH \
|
|
|
|
${TEST_RUNNER} \
|
2022-02-24 21:21:13 +03:00
|
|
|
${QUIET:+-q} \
|
2024-04-16 19:13:01 +03:00
|
|
|
${DEBUG:+-D} \
|
2022-02-24 21:21:13 +03:00
|
|
|
${KMEMLEAK:+-m} \
|
2022-03-23 18:15:02 +03:00
|
|
|
${KMSG:+-K} \
|
2019-10-09 20:39:26 +03:00
|
|
|
-c "${RUNFILES}" \
|
2019-08-26 04:30:39 +03:00
|
|
|
-T "${TAGS}" \
|
|
|
|
-i "${STF_SUITE}" \
|
|
|
|
-I "${ITERATIONS}" \
|
2022-02-03 01:17:46 +03:00
|
|
|
2>&1; echo $? >"$REPORT_FILE"; } | tee "$RESULTS_FILE"
|
|
|
|
read -r RUNRESULT <"$REPORT_FILE"
|
|
|
|
|
2018-06-21 00:03:13 +03:00
|
|
|
#
|
|
|
|
# Analyze the results.
|
|
|
|
#
|
2021-12-01 20:38:53 +03:00
|
|
|
${ZTS_REPORT} ${RERUN:+--no-maybes} "$RESULTS_FILE" >"$REPORT_FILE"
|
2015-07-02 01:23:09 +03:00
|
|
|
RESULT=$?
|
2021-12-01 20:38:53 +03:00
|
|
|
|
|
|
|
if [ "$RESULT" -eq "2" ] && [ -n "$RERUN" ]; then
|
|
|
|
MAYBES="$($ZTS_REPORT --list-maybes)"
|
2022-02-26 22:19:05 +03:00
|
|
|
TEMP_RESULTS_FILE=$(mktemp_file zts-results-tmp)
|
|
|
|
TEST_LIST=$(mktemp_file test-list)
|
2021-12-01 20:38:53 +03:00
|
|
|
grep "^Test:.*\[FAIL\]" "$RESULTS_FILE" >"$TEMP_RESULTS_FILE"
|
|
|
|
for test_name in $MAYBES; do
|
|
|
|
grep "$test_name " "$TEMP_RESULTS_FILE" >>"$TEST_LIST"
|
|
|
|
done
|
2022-03-14 03:39:03 +03:00
|
|
|
{ PATH=$STF_PATH \
|
|
|
|
${TEST_RUNNER} \
|
|
|
|
${QUIET:+-q} \
|
2024-04-16 19:13:01 +03:00
|
|
|
${DEBUG:+-D} \
|
2022-03-14 03:39:03 +03:00
|
|
|
${KMEMLEAK:+-m} \
|
2021-12-01 20:38:53 +03:00
|
|
|
-c "${RUNFILES}" \
|
|
|
|
-T "${TAGS}" \
|
|
|
|
-i "${STF_SUITE}" \
|
|
|
|
-I "${ITERATIONS}" \
|
|
|
|
-l "${TEST_LIST}" \
|
2022-02-03 01:17:46 +03:00
|
|
|
2>&1; echo $? >"$REPORT_FILE"; } | tee "$RESULTS_FILE"
|
|
|
|
read -r RUNRESULT <"$REPORT_FILE"
|
2021-12-01 20:38:53 +03:00
|
|
|
#
|
|
|
|
# Analyze the results.
|
|
|
|
#
|
|
|
|
${ZTS_REPORT} --no-maybes "$RESULTS_FILE" >"$REPORT_FILE"
|
|
|
|
RESULT=$?
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2020-08-08 00:10:48 +03:00
|
|
|
cat "$REPORT_FILE"
|
2018-06-21 00:03:13 +03:00
|
|
|
|
|
|
|
RESULTS_DIR=$(awk '/^Log directory/ { print $3 }' "$RESULTS_FILE")
|
|
|
|
if [ -d "$RESULTS_DIR" ]; then
|
|
|
|
cat "$RESULTS_FILE" "$REPORT_FILE" >"$RESULTS_DIR/results"
|
|
|
|
fi
|
|
|
|
|
2022-03-26 13:19:17 +03:00
|
|
|
rm -f "$RESULTS_FILE" "$REPORT_FILE" "$TEST_LIST" "$TEMP_RESULTS_FILE"
|
2015-07-02 01:23:09 +03:00
|
|
|
|
2020-08-08 00:10:48 +03:00
|
|
|
if [ -n "$SINGLETEST" ]; then
|
|
|
|
rm -f "$RUNFILES" >/dev/null 2>&1
|
2017-02-24 21:59:24 +03:00
|
|
|
fi
|
|
|
|
|
2022-02-03 01:17:46 +03:00
|
|
|
[ "$RUNRESULT" -gt 3 ] && exit "$RUNRESULT" || exit "$RESULT"
|