Skip to content

Commit

Permalink
ZTS: Waiting for zvols to be available
Browse files Browse the repository at this point in the history
This is a follow up patch for PR openzfs#12515 which addresses some
additional ZTS tests which are unreliable are should explicitly
wait for the required zvols to be available.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
  • Loading branch information
behlendorf committed Sep 10, 2021
1 parent 5a54a4e commit fa8bac2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fa8bac2

Please sign in to comment.