2015-07-01 22:23:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
# or http://www.opensolaris.org/os/licensing.
|
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
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 00:26:38 +00:00
|
|
|
BASE_DIR=$(dirname "$0")
|
2015-07-01 22:23:09 +00:00
|
|
|
SCRIPT_COMMON=common.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 00:26:38 +00:00
|
|
|
if [ -f "${BASE_DIR}/${SCRIPT_COMMON}" ]; then
|
|
|
|
. "${BASE_DIR}/${SCRIPT_COMMON}"
|
2015-07-01 22:23:09 +00:00
|
|
|
else
|
|
|
|
echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
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 00:26:38 +00:00
|
|
|
VERBOSE="no"
|
2015-07-01 22:23:09 +00:00
|
|
|
QUIET=
|
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 00:26:38 +00:00
|
|
|
CLEANUP="yes"
|
|
|
|
CLEANUPALL="no"
|
|
|
|
LOOPBACK="yes"
|
2018-12-07 18:51:42 +00:00
|
|
|
STACK_TRACER="no"
|
2016-07-13 23:48:01 +00:00
|
|
|
FILESIZE="4G"
|
2015-07-01 22:23:09 +00:00
|
|
|
RUNFILE=${RUNFILE:-"linux.run"}
|
|
|
|
FILEDIR=${FILEDIR:-/var/tmp}
|
|
|
|
DISKS=${DISKS:-""}
|
2017-02-24 18:59:24 +00:00
|
|
|
SINGLETEST=()
|
|
|
|
SINGLETESTUSER="root"
|
2017-11-07 22:55:31 +00:00
|
|
|
TAGS=""
|
2017-11-03 16:53:32 +00:00
|
|
|
ITERATIONS=1
|
2017-04-12 20:36:48 +00:00
|
|
|
ZFS_DBGMSG="$STF_SUITE/callbacks/zfs_dbgmsg.ksh"
|
|
|
|
ZFS_DMESG="$STF_SUITE/callbacks/zfs_dmesg.ksh"
|
Multi-modifier protection (MMP)
Add multihost=on|off pool property to control MMP. When enabled
a new thread writes uberblocks to the last slot in each label, at a
set frequency, to indicate to other hosts the pool is actively imported.
These uberblocks are the last synced uberblock with an updated
timestamp. Property defaults to off.
During tryimport, find the "best" uberblock (newest txg and timestamp)
repeatedly, checking for change in the found uberblock. Include the
results of the activity test in the config returned by tryimport.
These results are reported to user in "zpool import".
Allow the user to control the period between MMP writes, and the
duration of the activity test on import, via a new module parameter
zfs_multihost_interval. The period is specified in milliseconds. The
activity test duration is calculated from this value, and from the
mmp_delay in the "best" uberblock found initially.
Add a kstat interface to export statistics about Multiple Modifier
Protection (MMP) updates. Include the last synced txg number, the
timestamp, the delay since the last MMP update, the VDEV GUID, the VDEV
label that received the last MMP update, and the VDEV path. Abbreviated
output below.
$ cat /proc/spl/kstat/zfs/mypool/multihost
31 0 0x01 10 880 105092382393521 105144180101111
txg timestamp mmp_delay vdev_guid vdev_label vdev_path
20468 261337 250274925 68396651780 3 /dev/sda
20468 261339 252023374 6267402363293 1 /dev/sdc
20468 261340 252000858 6698080955233 1 /dev/sdx
20468 261341 251980635 783892869810 2 /dev/sdy
20468 261342 253385953 8923255792467 3 /dev/sdd
20468 261344 253336622 042125143176 0 /dev/sdab
20468 261345 253310522 1200778101278 2 /dev/sde
20468 261346 253286429 0950576198362 2 /dev/sdt
20468 261347 253261545 96209817917 3 /dev/sds
20468 261349 253238188 8555725937673 3 /dev/sdb
Add a new tunable zfs_multihost_history to specify the number of MMP
updates to store history for. By default it is set to zero meaning that
no MMP statistics are stored.
When using ztest to generate activity, for automated tests of the MMP
function, some test functions interfere with the test. For example, the
pool is exported to run zdb and then imported again. Add a new ztest
function, "-M", to alter ztest behavior to prevent this.
Add new tests to verify the new functionality. Tests provided by
Giuseppe Di Natale.
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Reviewed-by: Ned Bass <bass6@llnl.gov>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Closes #745
Closes #6279
2017-07-08 03:20:35 +00:00
|
|
|
ZFS_MMP="$STF_SUITE/callbacks/zfs_mmp.ksh"
|
|
|
|
TESTFAIL_CALLBACKS=${TESTFAIL_CALLBACKS:-"$ZFS_DBGMSG:$ZFS_DMESG:$ZFS_MMP"}
|
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 00:26:38 +00:00
|
|
|
LOSETUP=${LOSETUP:-/sbin/losetup}
|
|
|
|
DMSETUP=${DMSETUP:-/sbin/dmsetup}
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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() {
|
|
|
|
echo -e "$PROG: $1" >&2
|
|
|
|
cleanup
|
|
|
|
exit 1
|
|
|
|
}
|
2015-07-01 22:23:09 +00: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 00:26:38 +00:00
|
|
|
if [ "$CLEANUP" = "no" ]; then
|
2015-07-01 22:23:09 +00:00
|
|
|
return 0
|
|
|
|
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 00:26:38 +00:00
|
|
|
if [ "$LOOPBACK" = "yes" ]; then
|
2015-07-01 22:23:09 +00:00
|
|
|
for TEST_LOOPBACK in ${LOOPBACKS}; do
|
2017-03-09 18:20:15 +00:00
|
|
|
LOOP_DEV=$(basename "$TEST_LOOPBACK")
|
2017-04-06 00:18:22 +00:00
|
|
|
DM_DEV=$(sudo "${DMSETUP}" ls 2>/dev/null | \
|
2017-03-09 18:20:15 +00:00
|
|
|
grep "${LOOP_DEV}" | cut -f1)
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
if [ -n "$DM_DEV" ]; then
|
2017-04-06 00:18:22 +00:00
|
|
|
sudo "${DMSETUP}" remove "${DM_DEV}" ||
|
2015-07-01 22:23:09 +00:00
|
|
|
echo "Failed to remove: ${DM_DEV}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "${TEST_LOOPBACK}" ]; then
|
2017-04-06 00:18:22 +00:00
|
|
|
sudo "${LOSETUP}" -d "${TEST_LOOPBACK}" ||
|
2015-07-01 22:23:09 +00:00
|
|
|
echo "Failed to remove: ${TEST_LOOPBACK}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
for TEST_FILE in ${FILES}; do
|
2017-03-09 18:20:15 +00:00
|
|
|
rm -f "${TEST_FILE}" &>/dev/null
|
2015-07-01 22:23:09 +00:00
|
|
|
done
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
if [ "$STF_PATH_REMOVE" = "yes" ] && [ -d "$STF_PATH" ]; then
|
2017-04-06 00:18:22 +00:00
|
|
|
rm -Rf "$STF_PATH"
|
|
|
|
fi
|
2015-07-01 22:23:09 +00: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() {
|
2017-03-09 18:20:15 +00:00
|
|
|
local TEST_POOLS
|
2017-04-07 00:16:41 +00:00
|
|
|
TEST_POOLS=$(sudo "$ZPOOL" list -H -o name | grep testpool)
|
2017-03-09 18:20:15 +00:00
|
|
|
local TEST_LOOPBACKS
|
2017-04-06 00:18:22 +00:00
|
|
|
TEST_LOOPBACKS=$(sudo "${LOSETUP}" -a|grep file-vdev|cut -f1 -d:)
|
2017-03-09 18:20:15 +00:00
|
|
|
local TEST_FILES
|
|
|
|
TEST_FILES=$(ls /var/tmp/file-vdev* 2>/dev/null)
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
msg
|
|
|
|
msg "--- Cleanup ---"
|
2017-03-09 18:20:15 +00:00
|
|
|
msg "Removing pool(s): $(echo "${TEST_POOLS}" | tr '\n' ' ')"
|
2015-07-01 22:23:09 +00:00
|
|
|
for TEST_POOL in $TEST_POOLS; do
|
2017-04-07 00:16:41 +00:00
|
|
|
sudo "$ZPOOL" destroy "${TEST_POOL}"
|
2015-07-01 22:23:09 +00:00
|
|
|
done
|
|
|
|
|
2017-04-06 00:18:22 +00:00
|
|
|
msg "Removing dm(s): $(sudo "${DMSETUP}" ls |
|
2015-07-01 22:23:09 +00:00
|
|
|
grep loop | tr '\n' ' ')"
|
2017-04-06 00:18:22 +00:00
|
|
|
sudo "${DMSETUP}" remove_all
|
2015-07-01 22:23:09 +00:00
|
|
|
|
2017-03-09 18:20:15 +00:00
|
|
|
msg "Removing loopback(s): $(echo "${TEST_LOOPBACKS}" | tr '\n' ' ')"
|
2015-07-01 22:23:09 +00:00
|
|
|
for TEST_LOOPBACK in $TEST_LOOPBACKS; do
|
2017-04-06 00:18:22 +00:00
|
|
|
sudo "${LOSETUP}" -d "${TEST_LOOPBACK}"
|
2015-07-01 22:23:09 +00:00
|
|
|
done
|
|
|
|
|
2017-03-09 18:20:15 +00:00
|
|
|
msg "Removing files(s): $(echo "${TEST_FILES}" | tr '\n' ' ')"
|
2015-07-01 22:23:09 +00:00
|
|
|
for TEST_FILE in $TEST_FILES; do
|
2017-04-06 00:18:22 +00:00
|
|
|
sudo rm -f "${TEST_FILE}"
|
2015-07-01 22:23:09 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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 00:26:38 +00:00
|
|
|
# $RUNFILE_DIR/<name>
|
|
|
|
# $RUNFILE_DIR/<name>.run
|
2015-07-01 22:23:09 +00:00
|
|
|
# <name>
|
|
|
|
# <name>.run
|
|
|
|
#
|
|
|
|
find_runfile() {
|
|
|
|
local NAME=$1
|
|
|
|
local RESULT=""
|
|
|
|
|
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 00:26:38 +00:00
|
|
|
if [ -f "$RUNFILE_DIR/$NAME" ]; then
|
|
|
|
RESULT="$RUNFILE_DIR/$NAME"
|
|
|
|
elif [ -f "$RUNFILE_DIR/$NAME.run" ]; then
|
|
|
|
RESULT="$RUNFILE_DIR/$NAME.run"
|
2015-07-01 22:23:09 +00:00
|
|
|
elif [ -f "$NAME" ]; then
|
|
|
|
RESULT="$NAME"
|
|
|
|
elif [ -f "$NAME.run" ]; then
|
|
|
|
RESULT="$NAME.run"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "$RESULT"
|
|
|
|
}
|
|
|
|
|
2017-04-06 00:18:22 +00:00
|
|
|
#
|
|
|
|
# Symlink file if it appears under any of the given paths.
|
|
|
|
#
|
|
|
|
create_links() {
|
|
|
|
local dir_list="$1"
|
|
|
|
local file_list="$2"
|
|
|
|
|
2017-04-07 00:16:41 +00:00
|
|
|
[ -n "$STF_PATH" ] || fail "STF_PATH wasn't correctly set"
|
2017-04-06 00:18:22 +00:00
|
|
|
|
|
|
|
for i in $file_list; do
|
|
|
|
for j in $dir_list; do
|
|
|
|
[ ! -e "$STF_PATH/$i" ] || continue
|
|
|
|
|
2017-04-07 00:16:41 +00:00
|
|
|
if [ ! -d "$j/$i" ] && [ -e "$j/$i" ]; then
|
|
|
|
ln -s "$j/$i" "$STF_PATH/$i" || \
|
2017-04-06 00:18:22 +00:00
|
|
|
fail "Couldn't link $i"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2017-04-07 00:16:41 +00:00
|
|
|
[ ! -e "$STF_PATH/$i" ] && STF_MISSING_BIN="$STF_MISSING_BIN$i "
|
2017-04-06 00:18:22 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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 00:16:41 +00:00
|
|
|
. "$STF_SUITE/include/commands.cfg"
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
if [ "$INTREE" = "yes" ]; then
|
|
|
|
# Constrained path set to ./zfs/bin/
|
|
|
|
STF_PATH="$BIN_DIR"
|
|
|
|
STF_PATH_REMOVE="no"
|
|
|
|
STF_MISSING_BIN=""
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
chmod 755 "$STF_PATH" || fail "Couldn't chmod $STF_PATH"
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
|
|
|
|
# Special case links for standard zfs utilities
|
|
|
|
DIRS="$(find "$CMD_DIR" -type d \( ! -name .deps -a \
|
|
|
|
! -name .libs \) -print | tr '\n' ' ')"
|
|
|
|
create_links "$DIRS" "$ZFS_FILES"
|
|
|
|
|
|
|
|
# Special case links for zfs test suite utilities
|
|
|
|
DIRS="$(find "$STF_SUITE" -type d \( ! -name .deps -a \
|
|
|
|
! -name .libs \) -print | tr '\n' ' ')"
|
|
|
|
create_links "$DIRS" "$ZFSTEST_FILES"
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
# Constrained path set to /var/tmp/constrained_path.*
|
2017-04-06 00:18:22 +00:00
|
|
|
SYSTEMDIR=${SYSTEMDIR:-/var/tmp/constrained_path.XXXX}
|
|
|
|
STF_PATH=$(/bin/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 00:26:38 +00:00
|
|
|
STF_PATH_REMOVE="yes"
|
|
|
|
STF_MISSING_BIN=""
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
chmod 755 "$STF_PATH" || fail "Couldn't chmod $STF_PATH"
|
2017-04-06 00:18:22 +00:00
|
|
|
|
|
|
|
# Special case links for standard zfs utilities
|
|
|
|
create_links "/bin /usr/bin /sbin /usr/sbin" "$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 00:26:38 +00:00
|
|
|
# Special case links for zfs test suite utilities
|
|
|
|
create_links "$STF_SUITE/bin" "$ZFSTEST_FILES"
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
# Standard system utilities
|
|
|
|
create_links "/bin /usr/bin /sbin /usr/sbin" "$SYSTEM_FILES"
|
|
|
|
|
2017-04-06 00:18:22 +00:00
|
|
|
# Exceptions
|
2017-04-07 00:16:41 +00:00
|
|
|
ln -fs "$STF_PATH/awk" "$STF_PATH/nawk"
|
2017-09-08 22:07:00 +00:00
|
|
|
ln -fs /sbin/fsck.ext4 "$STF_PATH/fsck"
|
|
|
|
ln -fs /sbin/mkfs.ext4 "$STF_PATH/newfs"
|
2017-04-07 00:16:41 +00:00
|
|
|
ln -fs "$STF_PATH/gzip" "$STF_PATH/compress"
|
|
|
|
ln -fs "$STF_PATH/gunzip" "$STF_PATH/uncompress"
|
|
|
|
ln -fs "$STF_PATH/exportfs" "$STF_PATH/share"
|
|
|
|
ln -fs "$STF_PATH/exportfs" "$STF_PATH/unshare"
|
2018-12-13 20:25:04 +00:00
|
|
|
|
|
|
|
if [ -L "$STF_PATH/arc_summary3" ]; then
|
|
|
|
ln -fs "$STF_PATH/arc_summary3" "$STF_PATH/arc_summary"
|
|
|
|
fi
|
2017-04-06 00:18:22 +00:00
|
|
|
}
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
#
|
|
|
|
# Output a useful usage message.
|
|
|
|
#
|
|
|
|
usage() {
|
|
|
|
cat << EOF
|
|
|
|
USAGE:
|
2018-12-07 18:51:42 +00:00
|
|
|
$0 [hvqxkfS] [-s SIZE] [-r RUNFILE] [-t PATH] [-u USER]
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
DESCRIPTION:
|
|
|
|
ZFS Test Suite launch script
|
|
|
|
|
|
|
|
OPTIONS:
|
|
|
|
-h Show this message
|
|
|
|
-v Verbose zfs-tests.sh output
|
|
|
|
-q Quiet test-runner output
|
|
|
|
-x Remove all testpools, dm, lo, and files (unsafe)
|
|
|
|
-k Disable cleanup after test failure
|
|
|
|
-f Use files only, disables block device tests
|
2018-12-07 18:51:42 +00: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 00:26:38 +00:00
|
|
|
-c Only create and populate constrained path
|
2017-11-03 16:53:32 +00:00
|
|
|
-I NUM Number of iterations
|
2015-07-01 22:23:09 +00:00
|
|
|
-d DIR Use DIR for files and loopback devices
|
2016-07-13 23:48:01 +00:00
|
|
|
-s SIZE Use vdevs of SIZE (default: 4G)
|
2015-07-01 22:23:09 +00:00
|
|
|
-r RUNFILE Run tests in RUNFILE (default: linux.run)
|
2017-03-01 02:02:48 +00:00
|
|
|
-t PATH Run single test at PATH relative to test suite
|
2017-11-07 22:55:31 +00:00
|
|
|
-T TAGS Comma separated list of tags (default: 'functional')
|
2017-02-24 18:59:24 +00:00
|
|
|
-u USER Run single test as USER (default: root)
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
EXAMPLES:
|
|
|
|
# Run the default (linux) suite of tests and output the configuration used.
|
|
|
|
$0 -v
|
|
|
|
|
|
|
|
# Run a smaller suite of tests designed to run more quickly.
|
|
|
|
$0 -r linux-fast
|
|
|
|
|
|
|
|
# Cleanup a previous run of the test suite prior to testing, run the
|
|
|
|
# default (linux) suite of tests and perform no cleanup on exit.
|
2016-04-06 16:48:10 +00:00
|
|
|
$0 -x
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
2018-12-07 18:51:42 +00:00
|
|
|
while getopts 'hvqxkfScd:s:r:?t:T:u:I:' OPTION; do
|
2015-07-01 22:23:09 +00:00
|
|
|
case $OPTION in
|
|
|
|
h)
|
|
|
|
usage
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
v)
|
2017-03-09 18:20:15 +00:00
|
|
|
# shellcheck disable=SC2034
|
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 00:26:38 +00:00
|
|
|
VERBOSE="yes"
|
2015-07-01 22:23:09 +00:00
|
|
|
;;
|
|
|
|
q)
|
|
|
|
QUIET="-q"
|
|
|
|
;;
|
|
|
|
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 00:26:38 +00:00
|
|
|
CLEANUPALL="yes"
|
2015-07-01 22:23:09 +00: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 00:26:38 +00:00
|
|
|
CLEANUP="no"
|
2015-07-01 22:23:09 +00: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 00:26:38 +00:00
|
|
|
LOOPBACK="no"
|
|
|
|
;;
|
2018-12-07 18:51:42 +00: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 00:26:38 +00:00
|
|
|
c)
|
|
|
|
constrain_path
|
|
|
|
exit
|
2015-07-01 22:23:09 +00:00
|
|
|
;;
|
|
|
|
d)
|
|
|
|
FILEDIR="$OPTARG"
|
|
|
|
;;
|
2017-11-03 16:53:32 +00:00
|
|
|
I)
|
|
|
|
ITERATIONS="$OPTARG"
|
|
|
|
if [ "$ITERATIONS" -le 0 ]; then
|
|
|
|
fail "Iterations must be greater than 0."
|
|
|
|
fi
|
|
|
|
;;
|
2015-07-01 22:23:09 +00:00
|
|
|
s)
|
|
|
|
FILESIZE="$OPTARG"
|
|
|
|
;;
|
|
|
|
r)
|
|
|
|
RUNFILE="$OPTARG"
|
|
|
|
;;
|
2017-02-24 18:59:24 +00:00
|
|
|
t)
|
|
|
|
if [ ${#SINGLETEST[@]} -ne 0 ]; then
|
|
|
|
fail "-t can only be provided once."
|
|
|
|
fi
|
|
|
|
SINGLETEST+=("$OPTARG")
|
|
|
|
;;
|
2017-11-03 16:53:32 +00:00
|
|
|
T)
|
|
|
|
TAGS="$OPTARG"
|
|
|
|
;;
|
2017-02-24 18:59:24 +00:00
|
|
|
u)
|
|
|
|
SINGLETESTUSER="$OPTARG"
|
|
|
|
;;
|
2015-07-01 22:23:09 +00:00
|
|
|
?)
|
|
|
|
usage
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
shift $((OPTIND-1))
|
|
|
|
|
|
|
|
FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
|
|
|
|
LOOPBACKS=${LOOPBACKS:-""}
|
|
|
|
|
2017-02-24 18:59:24 +00:00
|
|
|
if [ ${#SINGLETEST[@]} -ne 0 ]; then
|
2017-11-07 22:55:31 +00: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 00:26:38 +00:00
|
|
|
RUNFILE_DIR="/var/tmp"
|
2017-02-24 18:59:24 +00:00
|
|
|
RUNFILE="zfs-tests.$$.run"
|
|
|
|
SINGLEQUIET="False"
|
|
|
|
|
|
|
|
if [ -n "$QUIET" ]; then
|
|
|
|
SINGLEQUIET="True"
|
|
|
|
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 00:26:38 +00:00
|
|
|
cat >$RUNFILE_DIR/$RUNFILE << EOF
|
2017-02-24 18:59:24 +00:00
|
|
|
[DEFAULT]
|
|
|
|
pre =
|
|
|
|
quiet = $SINGLEQUIET
|
|
|
|
pre_user = root
|
|
|
|
user = $SINGLETESTUSER
|
|
|
|
timeout = 600
|
|
|
|
post_user = root
|
|
|
|
post =
|
|
|
|
outputdir = /var/tmp/test_results
|
|
|
|
EOF
|
|
|
|
for t in "${SINGLETEST[@]}"
|
|
|
|
do
|
|
|
|
SINGLETESTDIR=$(dirname "$t")
|
|
|
|
SINGLETESTFILE=$(basename "$t")
|
|
|
|
SETUPSCRIPT=
|
|
|
|
CLEANUPSCRIPT=
|
|
|
|
|
2017-03-01 02:02:48 +00:00
|
|
|
if [ -f "$STF_SUITE/$SINGLETESTDIR/setup.ksh" ]; then
|
2017-02-24 18:59:24 +00:00
|
|
|
SETUPSCRIPT="setup"
|
|
|
|
fi
|
|
|
|
|
2017-03-01 02:02:48 +00:00
|
|
|
if [ -f "$STF_SUITE/$SINGLETESTDIR/cleanup.ksh" ]; then
|
2017-02-24 18:59:24 +00:00
|
|
|
CLEANUPSCRIPT="cleanup"
|
|
|
|
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 00:26:38 +00:00
|
|
|
cat >>$RUNFILE_DIR/$RUNFILE << EOF
|
2017-02-24 18:59:24 +00:00
|
|
|
|
|
|
|
[$SINGLETESTDIR]
|
|
|
|
tests = ['$SINGLETESTFILE']
|
|
|
|
pre = $SETUPSCRIPT
|
|
|
|
post = $CLEANUPSCRIPT
|
2017-11-07 22:55:31 +00:00
|
|
|
tags = ['functional']
|
2017-02-24 18:59:24 +00:00
|
|
|
EOF
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2017-11-07 22:55:31 +00:00
|
|
|
#
|
|
|
|
# Use default tag if none was specified
|
|
|
|
#
|
|
|
|
TAGS=${TAGS:='functional'}
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
#
|
|
|
|
# Attempt to locate the runfile describing the test workload.
|
|
|
|
#
|
|
|
|
if [ -n "$RUNFILE" ]; then
|
|
|
|
SAVED_RUNFILE="$RUNFILE"
|
|
|
|
RUNFILE=$(find_runfile "$RUNFILE")
|
|
|
|
[ -z "$RUNFILE" ] && fail "Cannot find runfile: $SAVED_RUNFILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -r "$RUNFILE" ]; then
|
|
|
|
fail "Cannot read runfile: $RUNFILE"
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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 18:20:15 +00:00
|
|
|
if [ "$(id -u)" = "0" ]; then
|
2015-07-01 22:23:09 +00:00
|
|
|
fail "This script must not be run as root."
|
|
|
|
fi
|
|
|
|
|
2017-03-09 18:20:15 +00:00
|
|
|
if [ "$(sudo whoami)" != "root" ]; then
|
2015-07-01 22:23:09 +00:00
|
|
|
fail "Passwordless sudo access required."
|
|
|
|
fi
|
|
|
|
|
2017-04-06 00:18:22 +00: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 00:26:38 +00:00
|
|
|
# Constrain the available binaries to a known set.
|
2017-04-06 00:18:22 +00:00
|
|
|
#
|
|
|
|
constrain_path
|
|
|
|
|
2016-04-06 16:48:10 +00:00
|
|
|
#
|
|
|
|
# Check if ksh exists
|
|
|
|
#
|
2017-04-07 00:16:41 +00:00
|
|
|
[ -e "$STF_PATH/ksh" ] || fail "This test suite requires ksh."
|
2017-05-18 19:57:21 +00:00
|
|
|
[ -e "$STF_SUITE/include/default.cfg" ] || fail \
|
|
|
|
"Missing $STF_SUITE/include/default.cfg file."
|
2016-04-06 16:48:10 +00:00
|
|
|
|
2015-07-01 22:23:09 +00: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 00:26:38 +00:00
|
|
|
# Verify the ZFS module stack is loaded.
|
2015-07-01 22:23:09 +00:00
|
|
|
#
|
2018-12-07 18:51:42 +00:00
|
|
|
if [ "$STACK_TRACER" = "yes" ]; then
|
|
|
|
sudo "${ZFS_SH}" -S &>/dev/null
|
|
|
|
else
|
|
|
|
sudo "${ZFS_SH}" &>/dev/null
|
|
|
|
fi
|
2015-07-01 22:23:09 +00: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 00:26:38 +00:00
|
|
|
if [ "$CLEANUPALL" = "yes" ]; then
|
2015-07-01 22:23:09 +00:00
|
|
|
cleanup_all
|
|
|
|
fi
|
|
|
|
|
|
|
|
#
|
|
|
|
# By default preserve any existing pools
|
2017-09-25 17:32:34 +00:00
|
|
|
# NOTE: Since 'zpool list' outputs a newline-delimited list convert $KEEP from
|
|
|
|
# space-delimited to newline-delimited.
|
2015-07-01 22:23:09 +00:00
|
|
|
#
|
|
|
|
if [ -z "${KEEP}" ]; then
|
2017-09-25 17:32:34 +00:00
|
|
|
KEEP="$(sudo "$ZPOOL" list -H -o name)"
|
2015-07-01 22:23:09 +00:00
|
|
|
if [ -z "${KEEP}" ]; then
|
|
|
|
KEEP="rpool"
|
|
|
|
fi
|
2017-09-25 17:32:34 +00:00
|
|
|
else
|
|
|
|
KEEP="$(echo -e "${KEEP//[[:blank:]]/\n}")"
|
2015-07-01 22:23:09 +00:00
|
|
|
fi
|
|
|
|
|
2017-09-25 17:32:34 +00: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.
|
|
|
|
#
|
|
|
|
__ZFS_POOL_EXCLUDE="$(echo "$KEEP" | sed ':a;N;s/\n/ /g;ba')"
|
2017-02-03 21:24:44 +00:00
|
|
|
|
2017-04-07 00:16:41 +00:00
|
|
|
. "$STF_SUITE/include/default.cfg"
|
2017-04-06 00:18:22 +00:00
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
msg
|
|
|
|
msg "--- Configuration ---"
|
|
|
|
msg "Runfile: $RUNFILE"
|
|
|
|
msg "STF_TOOLS: $STF_TOOLS"
|
|
|
|
msg "STF_SUITE: $STF_SUITE"
|
2017-04-06 00:18:22 +00:00
|
|
|
msg "STF_PATH: $STF_PATH"
|
2015-07-01 22:23:09 +00: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
|
|
|
|
#
|
|
|
|
# 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 18:20:15 +00:00
|
|
|
truncate -s "${FILESIZE}" "${TEST_FILE}" ||
|
2015-07-01 22:23:09 +00:00
|
|
|
fail "Failed creating: ${TEST_FILE} ($?)"
|
2018-01-03 21:45:35 +00:00
|
|
|
if [[ "$DISKS" ]]; then
|
|
|
|
DISKS="$DISKS $TEST_FILE"
|
|
|
|
else
|
|
|
|
DISKS="$TEST_FILE"
|
|
|
|
fi
|
2015-07-01 22:23:09 +00:00
|
|
|
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 00:26:38 +00:00
|
|
|
if [ "$LOOPBACK" = "yes" ]; then
|
2015-07-01 22:23:09 +00:00
|
|
|
DISKS=""
|
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 00:26:38 +00:00
|
|
|
|
|
|
|
test -x "$LOSETUP" || fail "$LOSETUP utility must be installed"
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
for TEST_FILE in ${FILES}; do
|
2017-04-06 00:18:22 +00:00
|
|
|
TEST_LOOPBACK=$(sudo "${LOSETUP}" -f)
|
|
|
|
sudo "${LOSETUP}" "${TEST_LOOPBACK}" "${TEST_FILE}" ||
|
2015-07-01 22:23:09 +00:00
|
|
|
fail "Failed: ${TEST_FILE} -> ${TEST_LOOPBACK}"
|
|
|
|
LOOPBACKS="${LOOPBACKS}${TEST_LOOPBACK} "
|
2017-03-09 18:20:15 +00:00
|
|
|
BASELOOPBACKS=$(basename "$TEST_LOOPBACK")
|
2018-01-03 21:45:35 +00:00
|
|
|
if [[ "$DISKS" ]]; then
|
|
|
|
DISKS="$DISKS $BASELOOPBACKS"
|
|
|
|
else
|
|
|
|
DISKS="$BASELOOPBACKS"
|
|
|
|
fi
|
2015-07-01 22:23:09 +00:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
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 00:26:38 +00:00
|
|
|
NUM_DISKS=$(echo "${DISKS}" | awk '{print NF}')
|
2017-03-09 18:20:15 +00:00
|
|
|
[ "$NUM_DISKS" -lt 3 ] && fail "Not enough disks ($NUM_DISKS/3 minimum)"
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Disable SELinux until the ZFS Test Suite has been updated accordingly.
|
|
|
|
#
|
2017-04-06 00:18:22 +00:00
|
|
|
if [ -x "$STF_PATH/setenforce" ]; then
|
|
|
|
sudo setenforce permissive &>/dev/null
|
2015-07-01 22:23:09 +00:00
|
|
|
fi
|
|
|
|
|
2017-04-12 20:36:48 +00:00
|
|
|
#
|
2017-07-03 21:21:12 +00:00
|
|
|
# Enable internal ZFS debug log and clear it.
|
2017-04-12 20:36:48 +00:00
|
|
|
#
|
|
|
|
if [ -e /sys/module/zfs/parameters/zfs_dbgmsg_enable ]; then
|
|
|
|
sudo /bin/sh -c "echo 1 >/sys/module/zfs/parameters/zfs_dbgmsg_enable"
|
|
|
|
sudo /bin/sh -c "echo 0 >/proc/spl/kstat/zfs/dbgmsg"
|
|
|
|
fi
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
msg "FILEDIR: $FILEDIR"
|
|
|
|
msg "FILES: $FILES"
|
|
|
|
msg "LOOPBACKS: $LOOPBACKS"
|
|
|
|
msg "DISKS: $DISKS"
|
|
|
|
msg "NUM_DISKS: $NUM_DISKS"
|
|
|
|
msg "FILESIZE: $FILESIZE"
|
2017-11-03 16:53:32 +00:00
|
|
|
msg "ITERATIONS: $ITERATIONS"
|
|
|
|
msg "TAGS: $TAGS"
|
2018-12-07 18:51:42 +00:00
|
|
|
msg "STACK_TRACER: $STACK_TRACER"
|
2015-07-01 22:23:09 +00:00
|
|
|
msg "Keep pool(s): $KEEP"
|
2017-04-06 00:18:22 +00:00
|
|
|
msg "Missing util(s): $STF_MISSING_BIN"
|
2015-07-01 22:23:09 +00:00
|
|
|
msg ""
|
|
|
|
|
|
|
|
export STF_TOOLS
|
|
|
|
export STF_SUITE
|
2017-04-06 00:18:22 +00:00
|
|
|
export STF_PATH
|
2015-07-01 22:23:09 +00:00
|
|
|
export DISKS
|
2017-09-25 17:32:34 +00:00
|
|
|
export FILEDIR
|
2015-07-01 22:23:09 +00:00
|
|
|
export KEEP
|
2017-02-03 21:24:44 +00:00
|
|
|
export __ZFS_POOL_EXCLUDE
|
2017-04-12 20:36:48 +00:00
|
|
|
export TESTFAIL_CALLBACKS
|
2017-04-06 00:18:22 +00:00
|
|
|
export PATH=$STF_PATH
|
2015-07-01 22:23:09 +00:00
|
|
|
|
2018-06-20 21:03:13 +00:00
|
|
|
RESULTS_FILE=$(mktemp -u -t zts-results.XXXX -p "$FILEDIR")
|
|
|
|
REPORT_FILE=$(mktemp -u -t zts-report.XXXX -p "$FILEDIR")
|
|
|
|
|
|
|
|
#
|
|
|
|
# Run all the tests as specified.
|
|
|
|
#
|
2017-11-03 16:53:32 +00:00
|
|
|
msg "${TEST_RUNNER} ${QUIET} -c ${RUNFILE} -T ${TAGS} -i ${STF_SUITE}" \
|
|
|
|
"-I ${ITERATIONS}"
|
|
|
|
${TEST_RUNNER} ${QUIET} -c "${RUNFILE}" -T "${TAGS}" -i "${STF_SUITE}" \
|
2018-06-20 21:03:13 +00:00
|
|
|
-I "${ITERATIONS}" 2>&1 | tee "$RESULTS_FILE"
|
|
|
|
|
|
|
|
#
|
|
|
|
# Analyze the results.
|
|
|
|
#
|
|
|
|
set -o pipefail
|
|
|
|
${ZTS_REPORT} "$RESULTS_FILE" | tee "$REPORT_FILE"
|
2015-07-01 22:23:09 +00:00
|
|
|
RESULT=$?
|
2018-06-20 21:03:13 +00:00
|
|
|
set +o pipefail
|
|
|
|
|
|
|
|
RESULTS_DIR=$(awk '/^Log directory/ { print $3 }' "$RESULTS_FILE")
|
|
|
|
if [ -d "$RESULTS_DIR" ]; then
|
|
|
|
cat "$RESULTS_FILE" "$REPORT_FILE" >"$RESULTS_DIR/results"
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f "$RESULTS_FILE" "$REPORT_FILE"
|
2015-07-01 22:23:09 +00:00
|
|
|
|
2017-02-24 18:59:24 +00:00
|
|
|
if [ ${#SINGLETEST[@]} -ne 0 ]; then
|
2017-03-01 02:02:48 +00:00
|
|
|
rm -f "$RUNFILE" &>/dev/null
|
2017-02-24 18:59:24 +00:00
|
|
|
fi
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
exit ${RESULT}
|