Authored by: Matthew Ahrens <mahrens@delphix.com>
6405 zvol test setup is non deterministic
Reviewed by: George Wilson <george.wilson@delphix.com>
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed by: Will Andrews <will@freebsd.org>
Approved by: Dan McDonald <danmcd@omniti.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Ported-by: George Melikov <mail@gmelikov.ru>
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
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
log_must $ZFS create -V $size $TESTPOOL/$TESTVOL
block_device_wait
-
- set_dumpsize $TESTPOOL/$TESTVOL
}
#
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
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 "Verify that a ZFS volume can act as dump device."
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
+volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+
function cleanup
{
snapexists $TESTPOOL/$TESTVOL@snap && \
(( $? == 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"
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"
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
+volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+
function cleanup
{
typeset dumpdev=$(get_dumpdevice)
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."
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
+volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+
function cleanup
{
typeset dumpdev=$(get_dumpdevice)
log_must $ZFS destroy $TESTPOOL/$TESTVOL@$snap
fi
done
+ $ZFS set volsize=$volsize $TESTPOOL/$TESTVOL
}
function verify_snapshot
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
verify_runnable "global"
+volsize=$($ZFS get -H -o value volsize $TESTPOOL/$TESTVOL)
+
function cleanup
{
$SWAP -l | $GREP $voldev > /dev/null 2>&1
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."
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
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"
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
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"
#
#
-# Copyright (c) 2013 by Delphix. All rights reserved.
+# Copyright (c) 2013, 2015 by Delphix. All rights reserved.
#
. $STF_SUITE/include/libtest.shlib
#
# 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