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
This commit is contained in:
Brian Behlendorf
2017-05-18 20:21:15 -04:00
parent f871ab6ea2
commit 95401cb6f7
85 changed files with 798 additions and 353 deletions
@@ -61,7 +61,10 @@ log_assert "'zfs clone -o property=value -V size volume' can successfully" \
log_must zfs snapshot $SNAPFS1
typeset -i i=0
while (( $i < ${#RW_VOL_CLONE_PROP[*]} )); do
log_must zfs clone -o ${RW_VOL_CLONE_PROP[$i]} $SNAPFS1 $TESTPOOL/$TESTCLONE
log_must zfs clone -o ${RW_VOL_CLONE_PROP[$i]} $SNAPFS1 \
$TESTPOOL/$TESTCLONE
block_device_wait
datasetexists $TESTPOOL/$TESTCLONE || \
log_fail "zfs clone $TESTPOOL/$TESTCLONE fail."
propertycheck $TESTPOOL/$TESTCLONE ${RW_VOL_CLONE_PROP[i]} || \
@@ -43,6 +43,11 @@
verify_runnable "global"
# See issue: https://github.com/zfsonlinux/zfs/issues/6145
if is_linux; then
log_unsupported "Test case occasionally fails"
fi
function cleanup
{
if poolexists $ZPOOL_VERSION_1_NAME; then
@@ -57,11 +62,12 @@ function cleanup
log_assert "Verify that copies cannot be set with pool version 1"
log_onexit cleanup
cp $STF_SUITE/tests/functional/cli_root/zpool_upgrade/blockfiles/$ZPOOL_VERSION_1_FILES $TESTDIR
cp $STF_SUITE/tests/functional/cli_root/zpool_upgrade/$ZPOOL_VERSION_1_FILES $TESTDIR
bunzip2 $TESTDIR/$ZPOOL_VERSION_1_FILES
log_must zpool import -d $TESTDIR $ZPOOL_VERSION_1_NAME
log_must zfs create $ZPOOL_VERSION_1_NAME/$TESTFS
log_must zfs create -V 1m $ZPOOL_VERSION_1_NAME/$TESTVOL
block_device_wait
for val in 3 2 1; do
for ds in $ZPOOL_VERSION_1_NAME/$TESTFS $ZPOOL_VERSION_1_NAME/$TESTVOL; do
@@ -43,6 +43,11 @@
verify_runnable "both"
# See issue: https://github.com/zfsonlinux/zfs/issues/6145
if is_linux; then
log_unsupported "Test case occasionally fails"
fi
function cleanup
{
[[ -e $propfile ]] && rm -f $propfile
@@ -53,6 +53,8 @@ set -A bad_combine "ALL" "\-R all" "-P all" "-h all" "-rph all" "-RpH all" "-Pr
"all -rph $TESTPOOL" "all,available,reservation $TESTPOOL" \
"all $TESTPOOL?" "all $TESTPOOL*" "all nonexistpool"
export POSIXLY_CORRECT=1
typeset -i i=0
while (( i < ${#bad_combine[*]} ))
do
@@ -61,4 +63,6 @@ do
(( i = i + 1 ))
done
unset POSIXLY_CORRECT
log_pass "'zfs get all' fails with invalid combinations scenarios as expected."
@@ -76,11 +76,19 @@ function get_reverse_option
typeset prop=$2
# Define property value: "reverse if value=on" "reverse if value=off"
set -A values "noatime" "atime" \
"nodevices" "devices" \
"noexec" "exec" \
"rw" "ro" \
"nosetuid" "setuid"
if is_linux; then
set -A values "noatime" "atime" \
"nodev" "dev" \
"noexec" "exec" \
"rw" "ro" \
"nosuid" "suid"
else
set -A values "noatime" "atime" \
"nodevices" "devices" \
"noexec" "exec" \
"rw" "ro" \
"nosetuid" "setuid"
fi
typeset -i i=0
while (( i < ${#properties[@]} )); do
@@ -72,8 +72,7 @@ for i in 1 2 3; do
log_must zfs snapshot $TESTPOOL/$TESTFS1@snap$i
log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/testfile.$i bs=1M \
count=$blocks
log_must sync
log_must sleep 10
sync_pool
written=$(get_prop written $TESTPOOL/$TESTFS1)
((expected_written=blocks * mb_block))
within_percent $written $expected_written 99.5 || \
@@ -117,8 +116,7 @@ log_note "delete data"
before_written=$(get_prop written $TESTPOOL/$TESTFS1)
log_must rm /$TESTPOOL/$TESTFS1/testfile.3
snap3_size=0
log_must sync
log_must sleep 10
sync_pool
written=$(get_prop written $TESTPOOL/$TESTFS1)
writtenat3=$(get_prop written@snap3 $TESTPOOL/$TESTFS1)
[[ $written -eq $writtenat3 ]] || \
@@ -140,8 +138,7 @@ log_note "write data"
blocks=20
log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/testfile.3 bs=1M \
count=$blocks
log_must sync
log_must sleep 10
sync_pool
written=$(get_prop written $TESTPOOL/$TESTFS1)
writtenat1=$(get_prop written@snap1 $TESTPOOL/$TESTFS1)
writtenat2=$(get_prop written@snap2 $TESTPOOL/$TESTFS1)
@@ -167,7 +164,7 @@ log_must zfs clone $TESTPOOL/$TESTFS1@snap1 $TESTPOOL/$TESTFS1/snap1.clone
log_must dd if=/dev/urandom of=/$TESTPOOL/$TESTFS1/snap1.clone/testfile bs=1M \
count=40
after_clone=$(get_prop written $TESTPOOL/$TESTFS1)
[[ $before_clone -eq $after_clone ]] || \
within_percent $before_clone $after_clone 99.5 || \
log_fail "unexpected written for clone $before_clone $after_clone"
log_note "deleted snapshot"
@@ -177,8 +174,7 @@ typeset -l snap_before_written2=$(get_prop_mb written $TESTPOOL/$TESTFS1@snap2)
typeset -l snap_before_written3=$(get_prop_mb written $TESTPOOL/$TESTFS1@snap3)
log_must zfs destroy $TESTPOOL/$TESTFS1@snap2
log_mustnot snapexists $TESTPOOL/$TESTFS1@snap2
log_must sync
log_must sleep 10
sync_pool
written1=$(get_prop_mb written@snap1 $TESTPOOL/$TESTFS1)
written3=$(get_prop_mb written@snap3 $TESTPOOL/$TESTFS1)
[[ $before_written1 -eq $written1 && $before_written3 -eq $written3 ]] || \
@@ -204,8 +200,7 @@ for ds in $datasets; do
[[ $writtenat -ne 0 ]] && \
log_fail "Unexpected written@ value"
log_must dd if=/dev/urandom of=/$ds/testfile bs=1M count=$blocks
log_must sync
log_must sleep 10
sync_pool
writtenat=$(get_prop written@now $ds)
((expected_writtenat = blocks * mb_block))
within_percent $writtenat $expected_writtenat 0.1 || \
@@ -219,8 +214,7 @@ for ds in $datasets; do
log_must zfs snapshot $ds@current
log_must dd if=/dev/urandom of=/$ds/testfile bs=1M \
count=$blocks
log_must sync
log_must sleep 10
sync_pool
done
recursive_output=$(zfs get -r written@current $TESTPOOL | \
grep -v $TESTFS1@ | grep -v $TESTFS2@ | grep -v $TESTFS3@ | \
@@ -72,10 +72,15 @@ function test_n_check #opt num_snap_clone num_rollback
log_fail "Unsupported testing condition."
# Clean up the test environment
if pgrep -x dd 2>/dev/null; then
pkill -x dd
fi
datasetexists $FS && log_must zfs destroy -Rf $FS
if datasetexists $VOL; then
df -lhF ufs "$ZVOL_DEVDIR/$VOL" > /dev/null 2>&1
(( $? == 0 )) && log_must umount -f $TESTDIR1
if ismounted $TESTDIR1 $NEWFS_DEFAULT_FS; then
log_must umount -f $TESTDIR1
fi
log_must zfs destroy -Rf $VOL
fi
@@ -117,7 +122,9 @@ function test_n_check #opt num_snap_clone num_rollback
fi
if [[ $dtst == $VOL ]]; then
log_must umount -f $TESTDIR1
if ismounted $TESTDIR1 $NEWFS_DEFAULT_FS; then
log_must umount -f $TESTDIR1
fi
log_must zfs rollback $opt $dtst@$snap_point
log_must mount \
$ZVOL_DEVDIR/$TESTPOOL/$TESTVOL $TESTDIR1
@@ -83,7 +83,7 @@ function setup_snap_env
# Make sure the ufs|ext2 filesystem hasn't been mounted,
# then mount the new ufs|ext2 filesystem.
if ! ismounted "$ZVOL_DEVDIR/$VOL" $NEWFS_DEFAULT_FS; then
if ! ismounted $TESTDIR1 $NEWFS_DEFAULT_FS; then
log_must mount \
$ZVOL_DEVDIR/$TESTPOOL/$TESTVOL $TESTDIR1
fi
@@ -133,6 +133,7 @@ function setup_snap_env
if [[ $createclone == "true" ]]; then
if datasetnonexists $clone; then
log_must zfs clone $snap $clone
block_device_wait
fi
fi
(( ind += 1 ))
@@ -157,7 +158,7 @@ function cleanup_env
typeset dtst
typeset snap
pkill ${DD##*/}
pkill -x dd
if ismounted $TESTDIR1 $NEWFS_DEFAULT_FS; then
log_must umount -f $TESTDIR1
@@ -46,7 +46,7 @@ verify_runnable "both"
function cleanup
{
poolexists $TESTPOOL && log_must zpool export $TESTPOOL
poolexists $TESTPOOL && log_must_busy zpool export $TESTPOOL
log_must zpool import $TESTPOOL
datasetexists $TESTPOOL@snap && \
@@ -101,7 +101,11 @@ typeset -i i=0
while (( i < ${#options[*]} )); do
if [[ ${options[i]} == "-f" ]]; then
do_unmount_multiple "${options[i]}"
if is_linux; then
do_unmount_multiple "${options[i]}" 1
else
do_unmount_multiple "${options[i]}"
fi
else
do_unmount_multiple "${options[i]}" 1
fi
@@ -96,8 +96,13 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do
log_must cd .zfs/snapshot/$TESTSNAP
log_mustnot zfs unmount -a
log_must zfs unmount -fa
log_mustnot ls
if is_linux; then
log_mustnot zfs unmount -fa
log_must ls
else
log_must zfs unmount -fa
log_mustnot ls
fi
log_must cd /
log_must zfs mount -a
@@ -105,8 +110,13 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do
log_must cd .zfs/snapshot/$TESTSNAP
if is_global_zone || [[ $fs != $TESTPOOL ]] ; then
log_must zfs destroy -rf $fs
log_mustnot ls
if is_linux; then
log_mustnot zfs destroy -rf $fs
log_must ls
else
log_must zfs destroy -rf $fs
log_mustnot ls
fi
log_must cd /
fi
@@ -114,8 +124,13 @@ for fs in $TESTPOOL/$TESTFS $TESTPOOL ; do
done
if is_global_zone ; then
log_must zpool destroy -f $TESTPOOL
log_mustnot ls
if is_linux; then
log_mustnot zpool destroy -f $TESTPOOL
log_must ls
else
log_must zpool destroy -f $TESTPOOL
log_mustnot ls
fi
log_must cd /
fi
@@ -181,6 +181,10 @@ for opt in "-a" "-fa"; do
fi
export __ZFS_POOL_RESTRICT="$TESTPOOL"
if [[ $opt == "-fa" ]] && is_linux; then
log_mustnot zfs unmount $opt
cd /tmp
fi
log_must zfs unmount $opt
unset __ZFS_POOL_RESTRICT
@@ -44,6 +44,10 @@
verify_runnable "global"
if is_linux; then
log_unsupported "zfs set sharenfs=off won't unshare if already off"
fi
function cleanup
{
typeset -i i=0
@@ -41,6 +41,10 @@
verify_runnable "global"
if is_linux; then
log_unsupported "some distros come with Samba "user shares" disabled"
fi
function cleanup
{
log_must zfs unshare -a
@@ -45,9 +45,9 @@
verify_runnable "global"
# See issue: https://github.com/zfsonlinux/zfs/issues/6065
# https://github.com/zfsonlinux/zfs/issues/6145
if is_linux; then
log_unsupported "Creating a pool containing a zvol may deadlock"
log_unsupported "Test case occasionally fails"
fi
function cleanup
@@ -45,6 +45,11 @@
verify_runnable "global"
# https://github.com/zfsonlinux/zfs/issues/6145
if is_linux; then
log_unsupported "Test case occasionally fails"
fi
function cleanup
{
poolexists $TESTPOOL2 && destroy_pool $TESTPOOL2
@@ -72,15 +77,10 @@ log_onexit cleanup
partition_disk $SLICE_SIZE $DISK 2
create_pool "$TESTPOOL" "${DISK}${SLICE_PREFIX}${SLICE0}"
if is_linux; then
# Layering a pool on a zvol can deadlock and isn't supported.
create_pool "$TESTPOOL2" "${DISK}${SLICE_PREFIX}${SLICE1}"
else
create_pool "$TESTPOOL1" "${DISK}${SLICE_PREFIX}${SLICE1}"
log_must zfs create -s -V $VOLSIZE $TESTPOOL1/$TESTVOL
create_pool "$TESTPOOL2" "${ZVOL_DEVDIR}/$TESTPOOL1/$TESTVOL"
fi
create_pool "$TESTPOOL1" "${DISK}${SLICE_PREFIX}${SLICE1}"
log_must zfs create -s -V $VOLSIZE $TESTPOOL1/$TESTVOL
block_device_wait
create_pool "$TESTPOOL2" "${ZVOL_DEVDIR}/$TESTPOOL1/$TESTVOL"
typeset -i i=0
while (( i < ${#datasets[*]} )); do
@@ -29,4 +29,7 @@
verify_runnable "global"
zed_stop
zed_cleanup
default_cleanup
@@ -29,6 +29,9 @@
verify_runnable "global"
zed_setup
zed_start
DISK=${DISKS%% *}
default_setup $DISK
@@ -48,9 +48,9 @@
verify_runnable "global"
# See issue: https://github.com/zfsonlinux/zfs/issues/6065
# See issue: https://github.com/zfsonlinux/zfs/issues/5771
if is_linux; then
log_unsupported "Creating a pool containing a zvol may deadlock"
log_unsupported "Requires additional ZED support"
fi
function cleanup
@@ -73,6 +73,7 @@ log_assert "zpool can be autoexpanded after set autoexpand=on on LUN expansion"
for i in 1 2 3; do
log_must zfs create -V $org_size $VFS/vol$i
done
block_device_wait
for type in " " mirror raidz raidz2; do
@@ -48,9 +48,9 @@
verify_runnable "global"
# See issue: https://github.com/zfsonlinux/zfs/issues/6065
# See issue: https://github.com/zfsonlinux/zfs/issues/5771
if is_linux; then
log_unsupported "Creating a pool containing a zvol may deadlock"
log_unsupported "Requires additional ZED support"
fi
function cleanup
@@ -73,6 +73,7 @@ log_assert "zpool can not expand if set autoexpand=off after LUN expansion"
for i in 1 2 3; do
log_must zfs create -V $org_size $VFS/vol$i
done
block_device_wait
for type in " " mirror raidz raidz2; do
log_must zpool create $TESTPOOL1 $type ${ZVOL_DEVDIR}/$VFS/vol1 \
@@ -43,6 +43,11 @@
verify_runnable "global"
# https://github.com/zfsonlinux/zfs/issues/6141
if is_linux; then
log_unsupported "Test case occasionally fails"
fi
function cleanup
{
for config in $CONFIGS; do