aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPrakash Surya <[email protected]>2017-01-17 17:08:12 -0800
committerBrian Behlendorf <[email protected]>2017-02-15 17:19:54 -0800
commitce456d483c6a30223bbbfd2308f44945d34dec8d (patch)
tree27ff5dd1f4d99276d27c182f7d090617d49a5d1d /tests
parentc30e58c4628de46c36870cdedea9052711092a85 (diff)
OpenZFS 7762 - avoid division by zero in property_alias_001_pos
Authored by: Prakash Surya <[email protected]> Reviewed by: John Kennedy <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Approved by: Dan McDonald <[email protected]> Reviewed-by: George Melikov <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: Giuseppe Di Natale <[email protected]> OpenZFS-issue: https://www.illumos.org/issues/7762 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/ebaf15cb Closes #5798
Diffstat (limited to 'tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh
index d2f8cee92..5d24515b5 100755
--- a/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh
+++ b/tests/zfs-tests/tests/functional/cli_root/zfs_set/property_alias_001_pos.ksh
@@ -25,6 +25,10 @@
# Use is subject to license terms.
#
+#
+# Copyright (c) 2016, 2017 by Delphix. All rights reserved.
+#
+
. $STF_SUITE/include/libtest.shlib
. $STF_SUITE/tests/functional/cli_root/zfs_set/zfs_set_common.kshlib
@@ -107,7 +111,7 @@ for ds in $pool $fs $vol; do
done
;;
reservation|reserv )
- (( reservsize = $avail_space % $RANDOM ))
+ (( reservsize = $avail_space % (( $RANDOM + 1 )) ))
for val in "0" "$reservsize" "none"; do
set_and_check $ds ${rw_prop[i]} $val ${chk_prop[i]}
done