ZTS: Don't use lsblk on FreeBSD
These tests use lsblk to find the sector size of a disk. FreeBSD doesn't have lsblk. Use diskinfo -v to get sector size on FreeBSD. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Igor Kozhukhov <igor@dilos.org>\ Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10033
This commit is contained in:
parent
ca7ea23f8a
commit
6a60841631
|
@ -61,7 +61,11 @@ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
|
|||
# that small test disks may fill before creating small volumes. However,
|
||||
# testing 512b and 1K blocks on ashift=9 pools is an ok approximation for
|
||||
# testing the problems that arise from 4K and 8K blocks on ashift=12 pools.
|
||||
bps=$(lsblk -nrdo min-io /dev/${alldisks[0]})
|
||||
if is_freebsd; then
|
||||
bps=$(diskinfo -v ${alldisks[0]} | awk '/sectorsize/ { print $1 }')
|
||||
elif is_linux; then
|
||||
bps=$(lsblk -nrdo min-io /dev/${alldisks[0]})
|
||||
fi
|
||||
case "$bps" in
|
||||
512)
|
||||
allshifts=(9 10 17)
|
||||
|
|
|
@ -63,7 +63,11 @@ poolexists "$TESTPOOL" && log_must_busy zpool destroy "$TESTPOOL"
|
|||
# that small test disks may fill before creating small volumes. However,
|
||||
# testing 512b and 1K blocks on ashift=9 pools is an ok approximation for
|
||||
# testing the problems that arise from 4K and 8K blocks on ashift=12 pools.
|
||||
bps=$(lsblk -nrdo min-io /dev/${alldisks[0]})
|
||||
if is_freebsd; then
|
||||
bps=$(diskinfo -v ${alldisks[0]} | awk '/sectorsize/ { print $1 }')
|
||||
elif is_linux; then
|
||||
bps=$(lsblk -nrdo min-io /dev/${alldisks[0]})
|
||||
fi
|
||||
log_must test "$bps" -eq 512 -o "$bps" -eq 4096
|
||||
case "$bps" in
|
||||
512)
|
||||
|
|
Loading…
Reference in New Issue