Fix zfs_copies_001_pos/zfs_copies_004_neg

Call block_device_wait when creating/destroying volumes in order
to make the operations synchronous as expected by the test cases.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4560
This commit is contained in:
Brian Behlendorf 2016-04-25 11:50:39 -07:00
parent 325414e483
commit 16794374b3
2 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,7 @@ for val in 1 2 3; do
log_must $ZFS create -o copies=$val $fs1 log_must $ZFS create -o copies=$val $fs1
if is_global_zone; then if is_global_zone; then
log_must $ZFS create -V $VOLSIZE -o copies=$val $vol1 log_must $ZFS create -V $VOLSIZE -o copies=$val $vol1
block_device_wait
else else
log_must $ZFS create -o copies=$val $vol1 log_must $ZFS create -o copies=$val $vol1
fi fi
@ -83,17 +84,20 @@ for val in 1 2 3; do
log_must $ZFS create -o copies=$val2 $fs2 log_must $ZFS create -o copies=$val2 $fs2
if is_global_zone; then if is_global_zone; then
log_must $ZFS create -V $VOLSIZE -o copies=$val2 $vol2 log_must $ZFS create -V $VOLSIZE -o copies=$val2 $vol2
block_device_wait
else else
log_must $ZFS create -o copies=$val2 $vol2 log_must $ZFS create -o copies=$val2 $vol2
fi fi
for ds in $fs2 $vol2; do for ds in $fs2 $vol2; do
cmp_prop $ds $val2 cmp_prop $ds $val2
log_must $ZFS destroy $ds log_must $ZFS destroy $ds
block_device_wait
done done
done done
for ds in $fs1 $vol1; do for ds in $fs1 $vol1; do
log_must $ZFS destroy $ds log_must $ZFS destroy $ds
block_device_wait
done done
done done

View File

@ -48,6 +48,7 @@ for val in ${badval[@]}; do
log_mustnot $ZFS create -V $VOLSIZE -o copies=$val $TESTPOOL/$TESTVOL1 log_mustnot $ZFS create -V $VOLSIZE -o copies=$val $TESTPOOL/$TESTVOL1
log_mustnot $ZFS set copies=$val $TESTPOOL/$TESTFS log_mustnot $ZFS set copies=$val $TESTPOOL/$TESTFS
log_mustnot $ZFS set copies=$val $TESTPOOL/$TESTVOL log_mustnot $ZFS set copies=$val $TESTPOOL/$TESTVOL
block_device_wait
done done
log_pass "The copies property cannot be set to any value other than 1,2 or 3 as expected" log_pass "The copies property cannot be set to any value other than 1,2 or 3 as expected"