summaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-02-10 16:10:25 -0500
committerGitHub <[email protected]>2020-02-10 13:10:25 -0800
commit572b5b302a8353814f8631085fcdb7623698b191 (patch)
tree0c0c57875581ff25b70d14e35dc568b42ef59b55 /tests/zfs-tests
parent31b160f0a6c673c8f926233af2ed6d5354808393 (diff)
ZTS: Test zvol I/O in different volmodes
We found that our zvol code had some issues with volmode=dev that were not revealed by ZTS. Add some basic I/O operations to exercise more code paths in the volmode test. Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9953
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-xtests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh
index aabd746f3..7451bf8b7 100755
--- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh
+++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh
@@ -83,6 +83,17 @@ function sysctl_volmode # value
log_must set_tunable32 VOL_MODE $value
}
+#
+# Exercise open and close, read and write operations
+#
+function test_io # dev
+{
+ typeset dev=$1
+
+ log_must dd if=/dev/zero of=$dev count=1
+ log_must dd if=$dev of=/dev/null count=1
+}
+
log_assert "Verify that ZFS volume property 'volmode' works as intended"
log_onexit cleanup
@@ -96,6 +107,8 @@ log_must zfs create -o mountpoint=none $VOLFS
log_must zfs create -V $VOLSIZE -s $SUBZVOL
log_must zfs create -V $VOLSIZE -s $ZVOL
udev_wait
+test_io $ZDEV
+test_io $SUBZDEV
# 1. Verify "volmode" property does not accept invalid values
typeset badvals=("off" "on" "1" "nope" "-")
@@ -114,6 +127,7 @@ log_must zfs create -V $VOLSIZE -s $ZVOL
udev_wait
log_must zfs set volmode=full $ZVOL
blockdev_exists $ZDEV
+test_io $ZDEV
log_must verify_partition $ZDEV
udev_wait
# 3.1 Verify "volmode=geom" is an alias for "volmode=full"
@@ -130,6 +144,7 @@ log_must zfs create -V $VOLSIZE -s $ZVOL
udev_wait
log_must zfs set volmode=dev $ZVOL
blockdev_exists $ZDEV
+test_io $ZDEV
log_mustnot verify_partition $ZDEV
udev_wait
log_must_busy zfs destroy $ZVOL