Skip to content

Commit

Permalink
macOS test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ilovezfs committed May 13, 2021
1 parent a5f1643 commit f319d55
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/zfs-tests/include/libtest.shlib
Original file line number Diff line number Diff line change
Expand Up @@ -1066,13 +1066,16 @@ function set_partition
fi

typeset bytes
bytes=size_mb * 1024
((bytes = size_mb * 1024))

# Dont create zero sized partitions
[[ $bytes == 0 ]] && return 0

# Convert to a sector count
typeset sectors=$(( $bytes / $sector_size ))
typeset sectors=$((bytes / sector_size))

# Make sure we have a gpt
gpt show $disk | grep -q GPT || gpt create $disk

# Add partition as "ZFS" - hopefully prevent DiskArbitrator popup.
log_must gpt add -s $sectors -t "6A898CC3-1DD2-11B2-99A6-080020736631" $disk
Expand Down Expand Up @@ -1144,6 +1147,14 @@ function delete_partitions
log_fail "Partitions for ${disk} not deleted"
fi
done
elif is_macos; then
for disk in $DISKSARRAY; do
if gpt destroy $disk; then
log_note "Partitions for ${disk} deleted"
else
log_fail "Partitions for ${disk} not deleted"
fi
done
fi
}

Expand Down

0 comments on commit f319d55

Please sign in to comment.