summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Kozhukhov <ikozhukhov@gmail.com>2016-06-09 16:38:35 -0400
committerMatthew Ahrens <mahrens@delphix.com>2016-06-09 16:59:08 -0400
commit3f85b2aed8a5768f4c20db925cdf8fc072472037 (patch)
treeb90e21e4a16780161f77a4e9fb6197ffcccc81b4
parent10e67aa0db0823d5464aafdd681f3c966155c68e (diff)
downloadillumos-joyent-3f85b2aed8a5768f4c20db925cdf8fc072472037.tar.gz
7036 zvol_swap_004_pos test failed
Reviewed by: John Kennedy <john.kennedy@delphix.com> Approved by: Dan McDonald <danmcd@omniti.com>
-rw-r--r--usr/src/test/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh32
1 files changed, 12 insertions, 20 deletions
diff --git a/usr/src/test/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh b/usr/src/test/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh
index 28709a7865..500a6576b6 100644
--- a/usr/src/test/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh
+++ b/usr/src/test/zfs-tests/tests/functional/zvol/zvol_swap/zvol_swap_004_pos.ksh
@@ -30,26 +30,29 @@
#
. $STF_SUITE/include/libtest.shlib
+. $STF_SUITE/tests/functional/zvol/zvol_common.shlib
#
# DESCRIPTION:
-# When a swap zvol is added it is resized to be equal to 1/4 c_max,
-# capped between 2G and 16G.
+# When a swap zvol is added its volsize does not change.
#
# STRATEGY:
# 1. Determine what 1/4 arc_c_max is.
# 2. Create a zvols in a variety of sizes.
-# 3. Add them as swap, and verify the volsize is resized correctly.
+# 3. Add them as swap, and verify the volsize is not changed.
#
verify_runnable "global"
+function cleanup
+{
+ is_swap_inuse $swapname && log_must $SWAP -d $swapname
+ datasetexists $vol && log_must $ZFS destroy $vol
+}
+
log_assert "For an added swap zvol, (2G <= volsize <= 16G)"
-typeset -i min max mem
-((mem = $($KSTAT -p ::arcstats:c_max | $AWK '{print $2}') / 4))
-((min = 2 * 1024 * 1024 * 1024))
-((max = 16 * 1024 * 1024 * 1024))
+log_onexit cleanup
for vbs in 8192 16384 32768 65536 131072; do
for multiplier in 1 32 16384 131072; do
@@ -61,19 +64,8 @@ for vbs in 8192 16384 32768 65536 131072; do
log_must $ZFS create -s -b $vbs -V $volsize $vol
log_must $SWAP -a $swapname
- if ((mem <= min)); then # volsize should be 2G
- new_volsize=$(get_prop volsize $vol)
- ((new_volsize == min)) || log_fail \
- "Unexpected volsize: $new_volsize"
- elif ((mem >= max)); then # volsize should be 16G
- new_volsize=$(get_prop volsize $vol)
- ((new_volsize == max)) || log_fail \
- "Unexpected volsize: $new_volsize"
- else # volsize should be 'mem'
- new_volsize=$(get_prop volsize $vol)
- ((new_volsize == mem)) || log_fail \
- "Unexpected volsize: $new_volsize"
- fi
+ new_volsize=$(get_prop volsize $vol)
+ [[ $volsize -eq $new_volsize ]] || log_fail "$volsize $new_volsize"
log_must $SWAP -d $swapname
log_must $ZFS destroy $vol