From 7816a6b85b456fb8aa69afb835246c5af1797889 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Mon, 13 Sep 2021 12:18:01 -0700 Subject: ZTS: Waiting for zvols to be available This is a follow up patch for PR #12515 which addresses some additional ZTS tests which are unreliable are should explicitly wait for the required zvols to be available. Reviewed-by: John Kennedy Reviewed-by: Ryan Moeller Reviewed-by: @Theo13111 Signed-off-by: Brian Behlendorf Closes #12553 --- .../tests/functional/cli_root/zfs_copies/zfs_copies.kshlib | 7 +++---- .../tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh | 2 +- .../functional/cli_root/zpool_import/zpool_import_errata3.ksh | 4 ++-- .../tests/functional/zvol/zvol_misc/zvol_misc_volmode.ksh | 2 ++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib index c2ccb2438..1273ed59d 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_copies/zfs_copies.kshlib @@ -83,25 +83,24 @@ function do_vol_test vol=$TESTPOOL/$TESTVOL1 vol_b_path=$ZVOL_DEVDIR/$TESTPOOL/$TESTVOL1 - vol_r_path=$ZVOL_RDEVDIR/$TESTPOOL/$TESTVOL1 log_must zfs create -V $VOLSIZE -o copies=$copies $vol log_must zfs set refreservation=none $vol - block_device_wait $vol_r_path + block_device_wait $vol_b_path case "$type" in "ext2") if is_freebsd; then log_unsupported "ext2 test not implemented for freebsd" fi - log_must eval "new_fs $vol_r_path >/dev/null 2>&1" + log_must eval "new_fs $vol_b_path >/dev/null 2>&1" log_must mount -o rw $vol_b_path $mntp ;; "ufs") if is_linux; then log_unsupported "ufs test not implemented for linux" fi - log_must eval "new_fs $vol_r_path >/dev/null 2>&1" + log_must eval "new_fs $vol_b_path >/dev/null 2>&1" log_must mount $vol_b_path $mntp ;; "zfs") diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh index 3ad7d4e80..4d1605152 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_rename/zfs_rename_006_pos.ksh @@ -69,7 +69,7 @@ rename_dataset ${vol}-new $vol clone=$TESTPOOL/${snap}_clone create_clone $vol@$snap $clone -block_device_wait +block_device_wait $VOLDATA #verify data integrity for input in $VOL_R_PATH $ZVOL_RDEVDIR/$clone; do diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_errata3.ksh b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_errata3.ksh index 86baf1f6e..40b6ca1c1 100755 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_errata3.ksh +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_import/zpool_import_errata3.ksh @@ -72,7 +72,7 @@ log_must zfs mount -o ro $POOL_NAME/testfs old_mntpnt=$(get_prop mountpoint $POOL_NAME/testfs) log_must eval "ls $old_mntpnt | grep -q testfile" -block_device_wait +block_device_wait /dev/zvol/$POOL_NAME/testvol log_mustnot dd if=/dev/zero of=/dev/zvol/$POOL_NAME/testvol bs=512 count=1 log_must dd if=/dev/zvol/$POOL_NAME/testvol of=/dev/null bs=512 count=1 @@ -90,7 +90,7 @@ log_must eval "zfs send $POOL_NAME/testfs@snap1 | \ zfs recv $POOL_NAME/encroot/testfs" log_must eval "zfs send $POOL_NAME/testvol@snap1 | \ zfs recv $POOL_NAME/encroot/testvol" -block_device_wait +block_device_wait /dev/zvol/$POOL_NAME/encroot/testvol log_must dd if=/dev/zero of=/dev/zvol/$POOL_NAME/encroot/testvol bs=512 count=1 new_mntpnt=$(get_prop mountpoint $POOL_NAME/encroot/testfs) log_must eval "ls $new_mntpnt | grep -q testfile" 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 7451bf8b7..322a31e07 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 @@ -107,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 +blockdev_exists $ZDEV +blockdev_exists $SUBZDEV test_io $ZDEV test_io $SUBZDEV -- cgit v1.2.3