Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZTS: Waiting for zvols to be available #12515

Merged
merged 1 commit into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/zfs-tests/include/blkdev.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function block_device_wait
typeset missing=false
typeset dev
for dev in "${@}"; do
if ! [[ -f $dev ]]; then
if ! [[ -e $dev ]]; then
missing=true
break
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function do_vol_test

log_must zfs create -V $VOLSIZE -o copies=$copies $vol
log_must zfs set refreservation=none $vol
block_device_wait
block_device_wait $vol_r_path

case "$type" in
"ext2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,37 +117,37 @@ log_must diff $SRC_FILE $obj
if is_global_zone; then
vol=$TESTPOOL/$TESTFS/vol.$$ ; volclone=$TESTPOOL/$TESTFS/volclone.$$
log_must zfs create -V 100M $vol
block_device_wait

obj=$(target_obj $vol)
block_device_wait $obj
log_must dd if=$SRC_FILE of=$obj bs=$BS count=$CNT

snap=${vol}@snap.$$
log_must zfs snapshot $snap
log_must zfs clone $snap $volclone
block_device_wait

# Rename dataset & clone
log_must zfs rename $vol ${vol}-new
log_must zfs rename $volclone ${volclone}-new
block_device_wait

# Compare source file and target file
obj=$(target_obj ${vol}-new)
block_device_wait $obj
log_must dd if=$obj of=$DST_FILE bs=$BS count=$CNT
log_must diff $SRC_FILE $DST_FILE
obj=$(target_obj ${volclone}-new)
block_device_wait $obj
log_must dd if=$obj of=$DST_FILE bs=$BS count=$CNT
log_must diff $SRC_FILE $DST_FILE

# Rename snapshot and re-clone dataset
log_must zfs rename ${vol}-new $vol
log_must zfs rename $snap ${snap}-new
log_must zfs clone ${snap}-new $volclone
block_device_wait

# Compare source file and target file
obj=$(target_obj $volclone)
block_device_wait $obj
log_must dd if=$obj of=$DST_FILE bs=$BS count=$CNT
log_must diff $SRC_FILE $DST_FILE
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ log_must eval "bzcat <$sendfile_compressed >$sendfile"
log_must eval "zstream redup $sendfile | zfs recv $TESTPOOL/recv"

log_must zfs load-key $TESTPOOL/recv
block_device_wait
block_device_wait $volfile

log_must eval "bzcat <$volfile_compressed >$volfile"
log_must diff $volfile $recvdev
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ for compress in "${compress_prop_vals[@]}"; do
datasetexists $send_vol && log_must_busy zfs destroy -r $send_vol
log_must zfs create -o compress=$compress $send_ds
log_must zfs create -V 1g -o compress=$compress $send_vol
block_device_wait
block_device_wait $send_voldev

typeset dir=$(get_prop mountpoint $send_ds)
log_must cp $file $dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ for vbs in 8192 16384 32768 65536 131072; do

# Create a sparse volume to test larger sizes
log_must zfs create -s -b $vbs -V $volsize $vol
block_device_wait
block_device_wait $swapname
log_must swap_setup $swapname

new_volsize=$(get_prop volsize $vol)
Expand Down