2020-08-07 21:10:48 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
#
|
|
|
|
# CDDL HEADER START
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the terms of the
|
|
|
|
# Common Development and Distribution License (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
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
|
|
|
|
# Use is subject to license terms.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copyright (c) 2016 by Delphix. All rights reserved.
|
2017-02-13 23:30:22 +00:00
|
|
|
# Copyright (c) 2017 Lawrence Livermore National Security, LLC.
|
2015-07-01 22:23:09 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
. $STF_SUITE/include/commands.cfg
|
|
|
|
|
2017-04-06 00:18:22 +00:00
|
|
|
# ZFS Directories
|
2017-05-18 19:57:21 +00:00
|
|
|
export ZEDLET_ETC_DIR=${ZEDLET_ETC_DIR:-@sysconfdir@/zfs/zed.d}
|
2018-06-07 16:59:59 +00:00
|
|
|
export ZEDLET_LIBEXEC_DIR=${ZEDLET_LIBEXEC_DIR:-@zfsexecdir@/zed.d}
|
2017-05-18 19:57:21 +00:00
|
|
|
export ZPOOL_SCRIPT_DIR=${ZPOOL_SCRIPT_DIR:-@sysconfdir@/zfs/zpool.d}
|
2021-02-18 05:30:45 +00:00
|
|
|
export ZPOOL_COMPAT_DIR=${ZPOOL_COMPAT_DIR:-@datadir@/zfs/compatibility.d}
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
# Define run length constants
|
|
|
|
export RT_LONG="3"
|
|
|
|
export RT_MEDIUM="2"
|
|
|
|
export RT_SHORT="1"
|
|
|
|
|
|
|
|
# Define macro for zone test
|
|
|
|
export ZONE_POOL="zonepool"
|
|
|
|
export ZONE_CTR="zonectr"
|
|
|
|
|
|
|
|
# ensure we're running in the C locale, since
|
|
|
|
# localised messages may result in test failures
|
|
|
|
export LC_ALL="C"
|
|
|
|
export LANG="C"
|
|
|
|
|
|
|
|
#
|
|
|
|
# pattern to ignore from 'zpool list'.
|
|
|
|
#
|
|
|
|
export NO_POOLS="no pools available"
|
|
|
|
|
|
|
|
# pattern to ignore from 'zfs list'.
|
|
|
|
export NO_DATASETS="no datasets available"
|
|
|
|
|
2017-09-25 17:32:34 +00:00
|
|
|
# Default directory used for test files
|
|
|
|
# NOTE: remove trailing "/", some functions rely on this to do pattern matching
|
|
|
|
export TEST_BASE_DIR="$(dirname ${FILEDIR:-/var/tmp}/.)"
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
# Default to compression ON
|
|
|
|
export COMPRESSION_PROP=on
|
|
|
|
|
|
|
|
# Default to using the checksum
|
|
|
|
export CHECKSUM_PROP=on
|
|
|
|
|
|
|
|
# some common variables used by test scripts :
|
2016-08-03 21:26:15 +00:00
|
|
|
export FIO_SCRIPTS=$STF_SUITE/tests/perf/fio
|
|
|
|
export PERF_SCRIPTS=$STF_SUITE/tests/perf/scripts
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
# some test pool names
|
2017-04-12 15:47:42 +00:00
|
|
|
export TESTPOOL=testpool
|
|
|
|
export TESTPOOL1=testpool1
|
|
|
|
export TESTPOOL2=testpool2
|
|
|
|
export TESTPOOL3=testpool3
|
2016-08-03 21:26:15 +00:00
|
|
|
export PERFPOOL=perfpool
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
# some test file system names
|
2017-04-12 15:47:42 +00:00
|
|
|
export TESTFS=testfs
|
|
|
|
export TESTFS1=testfs1
|
|
|
|
export TESTFS2=testfs2
|
|
|
|
export TESTFS3=testfs3
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
# some test directory names
|
2017-04-12 15:47:42 +00:00
|
|
|
export TESTDIR=${TEST_BASE_DIR%%/}/testdir
|
|
|
|
export TESTDIR0=${TEST_BASE_DIR%%/}/testdir0
|
|
|
|
export TESTDIR1=${TEST_BASE_DIR%%/}/testdir1
|
|
|
|
export TESTDIR2=${TEST_BASE_DIR%%/}/testdir2
|
|
|
|
|
|
|
|
# some test sub file system names
|
|
|
|
export TESTSUBFS=subfs
|
|
|
|
export TESTSUBFS1=subfs1
|
|
|
|
export TESTSUBFS2=subfs2
|
2015-07-01 22:23:09 +00:00
|
|
|
|
2017-02-13 23:30:22 +00:00
|
|
|
# some temp files
|
|
|
|
export TEMPFILE=${TEST_BASE_DIR%%/}/tempfile$$
|
|
|
|
export TEMPFILE0=${TEST_BASE_DIR%%/}/tempfile0$$
|
|
|
|
export TEMPFILE1=${TEST_BASE_DIR%%/}/tempfile1$$
|
|
|
|
export TEMPFILE2=${TEST_BASE_DIR%%/}/tempfile2$$
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
export ZFSROOT=
|
|
|
|
|
2017-04-12 15:47:42 +00:00
|
|
|
export TESTSNAP=testsnap
|
|
|
|
export TESTSNAP1=testsnap1
|
|
|
|
export TESTSNAP2=testsnap2
|
|
|
|
export TESTCLONE=testclone
|
|
|
|
export TESTCLONE1=testclone1
|
|
|
|
export TESTCLONE2=testclone2
|
|
|
|
export TESTCLCT=testclct
|
|
|
|
export TESTCTR=testctr
|
|
|
|
export TESTCTR1=testctr1
|
|
|
|
export TESTCTR2=testctr2
|
|
|
|
export TESTVOL=testvol
|
|
|
|
export TESTVOL1=testvol1
|
|
|
|
export TESTVOL2=testvol2
|
|
|
|
export TESTFILE0=testfile0
|
|
|
|
export TESTFILE1=testfile1
|
|
|
|
export TESTFILE2=testfile2
|
|
|
|
export TESTBKMARK=testbkmark
|
2015-07-01 22:23:09 +00:00
|
|
|
|
|
|
|
export LONGPNAME="poolname50charslong_012345678901234567890123456789"
|
|
|
|
export LONGFSNAME="fsysname50charslong_012345678901234567890123456789"
|
|
|
|
export SNAPFS="$TESTPOOL/$TESTFS@$TESTSNAP"
|
|
|
|
export SNAPFS1="$TESTPOOL/$TESTVOL@$TESTSNAP"
|
|
|
|
|
|
|
|
export VOLSIZE=150m
|
|
|
|
export BIGVOLSIZE=1eb
|
|
|
|
|
|
|
|
# Default to limit disks to be checked
|
|
|
|
export MAX_FINDDISKSNUM=6
|
|
|
|
|
2016-07-13 23:48:01 +00:00
|
|
|
# Default minimum size for file based vdevs in the test suite
|
|
|
|
export MINVDEVSIZE=$((256 * 1024 * 1024))
|
|
|
|
|
|
|
|
# Minimum vdev size possible as defined in the OS
|
|
|
|
export SPA_MINDEVSIZE=$((64 * 1024 * 1024))
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
# For iscsi target support
|
|
|
|
export ISCSITGTFILE=/tmp/iscsitgt_file
|
|
|
|
export ISCSITGT_FMRI=svc:/system/iscsitgt:default
|
|
|
|
|
|
|
|
export ZFS_VERSION=5
|
|
|
|
export ZFS_ALL_VERSIONS="1 2 3 4 5"
|
|
|
|
|
|
|
|
for i in $ZFS_ALL_VERSIONS; do
|
|
|
|
eval 'export ZFS_VERSION_$i="v${i}-fs"'
|
|
|
|
done
|
|
|
|
|
2016-07-22 15:07:04 +00:00
|
|
|
export MAX_PARTITIONS=8
|
|
|
|
|
2022-02-03 22:35:38 +00:00
|
|
|
if [ "@ASAN_ENABLED@" = "yes" ]; then
|
|
|
|
export ASAN_OPTIONS=abort_on_error=true:halt_on_error=true:allocator_may_return_null=true:disable_coredump=false:detect_stack_use_after_return=true
|
|
|
|
|
|
|
|
# TODO
|
|
|
|
# disable memory leaks detection
|
|
|
|
# there are quite many of them and they are not as
|
|
|
|
# destructive to CLI programs as they are to daemons
|
|
|
|
export ASAN_OPTIONS="$ASAN_OPTIONS:detect_leaks=false"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "@UBSAN_ENABLED@" = "yes" ]; then
|
|
|
|
export UBSAN_OPTIONS=abort_on_error=true:halt_on_error=true:print_stacktrace=true
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2020-08-07 21:10:48 +00:00
|
|
|
case $(uname -o) in
|
|
|
|
GNU/Linux)
|
2015-07-01 22:23:09 +00:00
|
|
|
unpack_opts="--sparse -xf"
|
|
|
|
pack_opts="--sparse -cf"
|
|
|
|
verbose=" -v"
|
|
|
|
unpack_preserve=" -xpf"
|
|
|
|
pack_preserve=" -cpf"
|
|
|
|
|
|
|
|
ZVOL_DEVDIR="/dev/zvol"
|
|
|
|
ZVOL_RDEVDIR="/dev/zvol"
|
2020-01-31 16:51:23 +00:00
|
|
|
DEV_DSKDIR="/dev"
|
2015-07-01 22:23:09 +00:00
|
|
|
DEV_RDSKDIR="/dev"
|
2016-07-22 15:07:04 +00:00
|
|
|
DEV_MPATHDIR="/dev/mapper"
|
Enable remaining tests
Enable most of the remaining test cases which were previously
disabled. The required fixes are as follows:
* cache_001_pos - No changes required.
* cache_010_neg - Updated to use losetup under Linux. Loopback
cache devices are allowed, ZVOLs as cache devices are not.
Disabled until all the builders pass reliably.
* cachefile_001_pos, cachefile_002_pos, cachefile_003_pos,
cachefile_004_pos - Set set_device_dir path in cachefile.cfg,
updated CPATH1 and CPATH2 to reference unique files.
* zfs_clone_005_pos - Wait for udev to create volumes.
* zfs_mount_007_pos - Updated mount options to expected Linux names.
* zfs_mount_009_neg, zfs_mount_all_001_pos - No changes required.
* zfs_unmount_005_pos, zfs_unmount_009_pos, zfs_unmount_all_001_pos -
Updated to expect -f to not unmount busy mount points under Linux.
* rsend_019_pos - Observed to occasionally take a long time on both
32-bit systems and the kmemleak builder.
* zfs_written_property_001_pos - Switched sync(1) to sync_pool.
* devices_001_pos, devices_002_neg - Updated create_dev_file() helper
for Linux.
* exec_002_neg.ksh - Fixed mmap_exec.c to preserve errno. Updated
test case to expect EPERM from Linux as described by mmap(2).
* grow_pool_001_pos - Adding missing setup.ksh and cleanup.ksh
scripts from OpenZFS.
* grow_replicas_001_pos.ksh - Added missing $SLICE_* variables.
* history_004_pos, history_006_neg, history_008_pos - Fixed by
previous commits and were not enabled. No changes required.
* zfs_allow_010_pos - Added missing spaces after assorted zfs
commands in delegate_common.kshlib.
* inuse_* - Illumos dump device tests skipped. Remaining test
cases updated to correctly create required partitions.
* large_files_001_pos - Fixed largest_file.c to accept EINVAL
as well as EFBIG as described in write(2).
* link_count_001 - Added nproc to required commands.
* umountall_001 - Updated to use umount -a.
* online_offline_001_* - Pull in OpenZFS change to file_trunc.c
to make the '-c 0' option run the test in a loop. Included
online_offline.cfg file in all test cases.
* rename_dirs_001_pos - Updated to use the rename_dir test binary,
pkill restricted to exact matches and total runtime reduced.
* slog_013_neg, write_dirs_002_pos - No changes required.
* slog_013_pos.ksh - Updated to use losetup under Linux.
* slog_014_pos.ksh - ZED will not be running, manually degrade
the damaged vdev as expected.
* nopwrite_varying_compression, nopwrite_volume - Forced pool
sync with sync_pool to ensure up to date property values.
* Fixed typos in ZED log messages. Refactored zed_* helper
functions to resolve all-syslog exit=1 errors in zedlog.
* zfs_copies_005_neg, zfs_get_004_pos, zpool_add_004_pos,
zpool_destroy_001_pos, largest_pool_001_pos, clone_001_pos.ksh,
clone_001_pos, - Skip until layering pools on zvols is solid.
* largest_pool_001_pos - Limited to 7eb pool, maximum
supported size in 8eb-1 on Linux.
* zpool_expand_001_pos, zpool_expand_003_neg - Requires
additional support from the ZED, updated skip reason.
* zfs_rollback_001_pos, zfs_rollback_002_pos - Properly cleanup
busy mount points under Linux between test loops.
* privilege_001_pos, privilege_003_pos, rollback_003_pos,
threadsappend_001_pos - Skip with log_unsupported.
* snapshot_016_pos - No changes required.
* snapshot_008_pos - Increased LIMIT from 512K to 2M and added
sync_pool to avoid false positives.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6128
2017-05-19 00:21:15 +00:00
|
|
|
|
2017-03-02 16:47:26 +00:00
|
|
|
ZEDLET_DIR="/var/tmp/zed"
|
2017-10-23 16:45:59 +00:00
|
|
|
ZED_LOG="$ZEDLET_DIR/zed.log"
|
|
|
|
ZED_DEBUG_LOG="$ZEDLET_DIR/zed.debug.log"
|
Enable remaining tests
Enable most of the remaining test cases which were previously
disabled. The required fixes are as follows:
* cache_001_pos - No changes required.
* cache_010_neg - Updated to use losetup under Linux. Loopback
cache devices are allowed, ZVOLs as cache devices are not.
Disabled until all the builders pass reliably.
* cachefile_001_pos, cachefile_002_pos, cachefile_003_pos,
cachefile_004_pos - Set set_device_dir path in cachefile.cfg,
updated CPATH1 and CPATH2 to reference unique files.
* zfs_clone_005_pos - Wait for udev to create volumes.
* zfs_mount_007_pos - Updated mount options to expected Linux names.
* zfs_mount_009_neg, zfs_mount_all_001_pos - No changes required.
* zfs_unmount_005_pos, zfs_unmount_009_pos, zfs_unmount_all_001_pos -
Updated to expect -f to not unmount busy mount points under Linux.
* rsend_019_pos - Observed to occasionally take a long time on both
32-bit systems and the kmemleak builder.
* zfs_written_property_001_pos - Switched sync(1) to sync_pool.
* devices_001_pos, devices_002_neg - Updated create_dev_file() helper
for Linux.
* exec_002_neg.ksh - Fixed mmap_exec.c to preserve errno. Updated
test case to expect EPERM from Linux as described by mmap(2).
* grow_pool_001_pos - Adding missing setup.ksh and cleanup.ksh
scripts from OpenZFS.
* grow_replicas_001_pos.ksh - Added missing $SLICE_* variables.
* history_004_pos, history_006_neg, history_008_pos - Fixed by
previous commits and were not enabled. No changes required.
* zfs_allow_010_pos - Added missing spaces after assorted zfs
commands in delegate_common.kshlib.
* inuse_* - Illumos dump device tests skipped. Remaining test
cases updated to correctly create required partitions.
* large_files_001_pos - Fixed largest_file.c to accept EINVAL
as well as EFBIG as described in write(2).
* link_count_001 - Added nproc to required commands.
* umountall_001 - Updated to use umount -a.
* online_offline_001_* - Pull in OpenZFS change to file_trunc.c
to make the '-c 0' option run the test in a loop. Included
online_offline.cfg file in all test cases.
* rename_dirs_001_pos - Updated to use the rename_dir test binary,
pkill restricted to exact matches and total runtime reduced.
* slog_013_neg, write_dirs_002_pos - No changes required.
* slog_013_pos.ksh - Updated to use losetup under Linux.
* slog_014_pos.ksh - ZED will not be running, manually degrade
the damaged vdev as expected.
* nopwrite_varying_compression, nopwrite_volume - Forced pool
sync with sync_pool to ensure up to date property values.
* Fixed typos in ZED log messages. Refactored zed_* helper
functions to resolve all-syslog exit=1 errors in zedlog.
* zfs_copies_005_neg, zfs_get_004_pos, zpool_add_004_pos,
zpool_destroy_001_pos, largest_pool_001_pos, clone_001_pos.ksh,
clone_001_pos, - Skip until layering pools on zvols is solid.
* largest_pool_001_pos - Limited to 7eb pool, maximum
supported size in 8eb-1 on Linux.
* zpool_expand_001_pos, zpool_expand_003_neg - Requires
additional support from the ZED, updated skip reason.
* zfs_rollback_001_pos, zfs_rollback_002_pos - Properly cleanup
busy mount points under Linux between test loops.
* privilege_001_pos, privilege_003_pos, rollback_003_pos,
threadsappend_001_pos - Skip with log_unsupported.
* snapshot_016_pos - No changes required.
* snapshot_008_pos - Increased LIMIT from 512K to 2M and added
sync_pool to avoid false positives.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6128
2017-05-19 00:21:15 +00:00
|
|
|
VDEVID_CONF="$ZEDLET_DIR/vdev_id.conf"
|
|
|
|
VDEVID_CONF_ETC="/etc/zfs/vdev_id.conf"
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
NEWFS_DEFAULT_FS="ext2"
|
2020-01-31 16:51:23 +00:00
|
|
|
SLICE_PREFIX=""
|
2020-08-07 21:10:48 +00:00
|
|
|
;;
|
|
|
|
FreeBSD)
|
2019-12-18 20:29:43 +00:00
|
|
|
unpack_opts="xv"
|
|
|
|
pack_opts="cf"
|
|
|
|
verbose="v"
|
|
|
|
unpack_preserve="xpf"
|
|
|
|
pack_preserve="cpf"
|
|
|
|
|
|
|
|
ZVOL_DEVDIR="/dev/zvol"
|
|
|
|
ZVOL_RDEVDIR="/dev/zvol"
|
|
|
|
DEV_DSKDIR="/dev"
|
|
|
|
DEV_RDSKDIR="/dev"
|
|
|
|
DEV_MPATHDIR="/dev/multipath"
|
|
|
|
|
|
|
|
NEWFS_DEFAULT_FS="ufs"
|
2020-01-31 16:51:23 +00:00
|
|
|
SLICE_PREFIX="p"
|
2020-08-07 21:10:48 +00:00
|
|
|
;;
|
|
|
|
illumos)
|
|
|
|
export AUTO_SNAP=$(svcs -a | \
|
|
|
|
awk '/auto-snapshot/ && /online/ { print $3 }')
|
|
|
|
# finally, if we're running in a local zone
|
|
|
|
# we take some additional actions
|
|
|
|
if [ "$(zonename 2>/dev/null)" != "global" ]; then
|
|
|
|
reexport_pool
|
|
|
|
fi
|
|
|
|
|
2015-07-01 22:23:09 +00:00
|
|
|
unpack_opts="xv"
|
|
|
|
pack_opts="cf"
|
|
|
|
verbose="v"
|
|
|
|
unpack_preserve="xpf"
|
|
|
|
pack_preserve="cpf"
|
|
|
|
|
|
|
|
ZVOL_DEVDIR="/dev/zvol/dsk"
|
|
|
|
ZVOL_RDEVDIR="/dev/zvol/rdsk"
|
|
|
|
DEV_DSKDIR="/dev/dsk"
|
|
|
|
DEV_RDSKDIR="/dev/rdsk"
|
|
|
|
|
|
|
|
NEWFS_DEFAULT_FS="ufs"
|
2020-01-31 16:51:23 +00:00
|
|
|
SLICE_PREFIX="s"
|
2020-08-07 21:10:48 +00:00
|
|
|
;;
|
|
|
|
esac
|
2015-07-01 22:23:09 +00:00
|
|
|
export unpack_opts pack_opts verbose unpack_preserve pack_preserve \
|
2020-01-23 17:38:09 +00:00
|
|
|
ZVOL_DEVDIR ZVOL_RDEVDIR DEV_DSKDIR DEV_RDSKDIR DEV_MPATHDIR \
|
|
|
|
ZEDLET_DIR ZED_LOG ZED_DEBUG_LOG VDEVID_CONF VDEVID_CONF_ETC \
|
2020-01-31 16:51:23 +00:00
|
|
|
NEWFS_DEFAULT_FS SLICE_PREFIX
|