diff options
author | Matthew Ahrens <[email protected]> | 2016-05-15 08:09:13 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-02-15 12:12:48 -0800 |
commit | 3d3fe9f9bb4364718cb8c54d8c86bccc84ae3141 (patch) | |
tree | c3ed44ad5d34127065f04bd043cd15648c1f29e0 /tests | |
parent | f9caf08a7497d3ad64bd4878c0fd8b5c78d21751 (diff) |
OpenZFS 6404 - zvol_swap_006_pos can occasionally fail due to swaplen being < 16
Authored by: Matthew Ahrens <[email protected]>
6405 zvol test setup is non deterministic
Reviewed by: George Wilson <[email protected]>
Reviewed by: John Kennedy <[email protected]>
Reviewed by: Will Andrews <[email protected]>
Approved by: Dan McDonald <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Ported-by: George Melikov <[email protected]>
OpenZFS-issue: https://www.illumos.org/issues/6404
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/24e268f
Closes #5792
Porting notes:
- Converted zfs to $ZFS until OpenZFS 7290 is ported.
openzfs/openzfs@1d32ba6
Diffstat (limited to 'tests')
9 files changed, 34 insertions, 16 deletions
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib b/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib index 30149799a..94da0d4b4 100644 --- a/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib +++ b/tests/zfs-tests/tests/functional/zvol/zvol_common.shlib @@ -25,7 +25,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -48,8 +48,6 @@ function default_zvol_setup # disk_device volume_size log_must $ZFS create -V $size $TESTPOOL/$TESTVOL block_device_wait - - set_dumpsize $TESTPOOL/$TESTVOL } # diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh index 9c474515d..eff2745f5 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_001_neg.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -44,6 +44,8 @@ verify_runnable "global" +volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL) + function cleanup { typeset dumpdev=$(get_dumpdevice) @@ -51,6 +53,7 @@ function cleanup if [[ $dumpdev != $savedumpdev ]] ; then safe_dumpadm $savedumpdev fi + $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL } log_assert "Verify that a ZFS volume can act as dump device." diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh index 3a5aa9fc4..8cf1e8704 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_002_pos.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -43,6 +43,8 @@ verify_runnable "global" +volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL) + function cleanup { snapexists $TESTPOOL/$TESTVOL@snap && \ @@ -52,6 +54,7 @@ function cleanup (( $? == 0 )) && log_must $UMOUNT $TESTDIR [[ -e $TESTDIR ]] && $RM -rf $TESTDIR + $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL } log_assert "Verify that ZFS volume snapshot could be fscked" @@ -61,6 +64,8 @@ TESTVOL='testvol' BLOCKSZ=$(( 1024 * 1024 )) NUM_WRITES=40 +log_must $ZFS set volsize=128m $TESTPOOL/$TESTVOL + $ECHO "y" | $NEWFS -v ${ZVOL_RDEVDIR}/$TESTPOOL/$TESTVOL >/dev/null 2>&1 (( $? != 0 )) && log_fail "Unable to newfs(1M) $TESTPOOL/$TESTVOL" diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh index 3fd270029..1913a75a3 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_003_neg.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -45,6 +45,8 @@ verify_runnable "global" +volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL) + function cleanup { typeset dumpdev=$(get_dumpdevice) @@ -55,6 +57,7 @@ function cleanup if poolexists $TESTPOOL1 ; then destroy_pool $TESTPOOL1 fi + $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL } log_assert "Verify zpool creation and newfs on dump zvol is denied." diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh index 176379e03..9a3632aac 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_004_pos.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -44,6 +44,8 @@ verify_runnable "global" +volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL) + function cleanup { typeset dumpdev=$(get_dumpdevice) @@ -62,6 +64,7 @@ function cleanup log_must $ZFS destroy $TESTPOOL/$TESTVOL@$snap fi done + $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL } function verify_snapshot diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh index f2cec946a..a566f9f80 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_005_neg.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -44,6 +44,8 @@ verify_runnable "global" +volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL) + function cleanup { $SWAP -l | $GREP $voldev > /dev/null 2>&1 @@ -55,6 +57,7 @@ function cleanup if [[ $dumpdev != $savedumpdev ]] ; then safe_dumpadm $savedumpdev fi + $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL } log_assert "Verify a device cannot be dump and swap at the same time." diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh index 3b8737f0f..0298c6893 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_006_pos.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -44,12 +44,15 @@ verify_runnable "global" +volsize=$(zfs get -H -o value volsize $TESTPOOL/$TESTVOL) + function cleanup { typeset dumpdev=$(get_dumpdevice) if [[ $dumpdev != $savedumpdev ]] ; then safe_dumpadm $savedumpdev fi + zfs set volsize=$volsize $TESTPOOL/$TESTVOL } log_assert "zfs volume as dumpdevice should have 128k volblocksize" diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh index 94e598dec..5d0eedf81 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -54,7 +54,7 @@ log_assert "For an added swap zvol, (2G <= volsize <= 16G)" log_onexit cleanup -for vbs in 512 1024 2048 4096 8192 16384 32768 65536 131072; do +for vbs in 8192 16384 32768 65536 131072; do for multiplier in 1 32 16384 131072; do ((volsize = vbs * multiplier)) vol="$TESTPOOL/vol_$volsize" diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh index fcbbefc6e..c49d49643 100755 --- a/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh +++ b/tests/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_006_pos.ksh @@ -26,7 +26,7 @@ # # -# Copyright (c) 2013 by Delphix. All rights reserved. +# Copyright (c) 2013, 2015 by Delphix. All rights reserved. # . $STF_SUITE/include/libtest.shlib @@ -75,13 +75,13 @@ log_note "Verify volume can be add as several segments." # # swaplow swaplen set -A swap_opt $((pageblocks)) \ - $((pageblocks * ((RANDOM % 50) + 1) + (RANDOM % pageblocks) )) \ + $((RANDOM % (50 * pageblocks) + 2 * pageblocks)) \ $((volblocks / 3)) \ - $((pageblocks * ((RANDOM % 50) + 1) + (RANDOM % pageblocks) )) \ + $((RANDOM % (50 * pageblocks) + 2 * pageblocks)) \ $((volblocks / 2)) \ - $((pageblocks * ((RANDOM % 50) + 1) + (RANDOM % pageblocks) )) \ + $((RANDOM % (50 * pageblocks) + 2 * pageblocks)) \ $(((volblocks*2) / 3)) \ - $((pageblocks * ((RANDOM % 50) + 1) + (RANDOM % pageblocks) )) + $((RANDOM % (50 * pageblocks) + 2 * pageblocks)) swapname=${ZVOL_DEVDIR}/$vol typeset -i i=0 count=0 |