aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/include/libtest.shlib
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zfs-tests/include/libtest.shlib')
-rw-r--r--tests/zfs-tests/include/libtest.shlib15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/zfs-tests/include/libtest.shlib b/tests/zfs-tests/include/libtest.shlib
index 464b59d3f..3a310680b 100644
--- a/tests/zfs-tests/include/libtest.shlib
+++ b/tests/zfs-tests/include/libtest.shlib
@@ -806,7 +806,11 @@ function zero_partitions #<whole_disk_name>
typeset i
if is_linux; then
- log_must parted $DEV_DSKDIR/$diskname -s -- mklabel gpt
+ DSK=$DEV_DSKDIR/$diskname
+ DSK=$(echo $DSK | sed -e "s|//|/|g")
+ log_must parted $DSK -s -- mklabel gpt
+ blockdev --rereadpt $DSK 2>/dev/null
+ block_device_wait
else
for i in 0 1 3 4 5 6 7
do
@@ -834,10 +838,11 @@ function set_partition #<slice_num> <slice_start> <size_plus_units> <whole_disk
typeset start=$2
typeset size=$3
typeset disk=$4
- [[ -z $slicenum || -z $size || -z $disk ]] && \
- log_fail "The slice, size or disk name is unspecified."
if is_linux; then
+ if [[ -z $size || -z $disk ]]; then
+ log_fail "The size or disk name is unspecified."
+ fi
typeset size_mb=${size%%[mMgG]}
size_mb=${size_mb%%[mMgG][bB]}
@@ -880,6 +885,10 @@ function set_partition #<slice_num> <slice_start> <size_plus_units> <whole_disk
blockdev --rereadpt $DEV_DSKDIR/$disk 2>/dev/null
block_device_wait
else
+ if [[ -z $slicenum || -z $size || -z $disk ]]; then
+ log_fail "The slice, size or disk name is unspecified."
+ fi
+
typeset format_file=/var/tmp/format_in.$$
echo "partition" >$format_file