diff options
author | Ryan Moeller <[email protected]> | 2020-02-21 11:38:34 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-21 08:38:34 -0800 |
commit | 6a608416315ab9a109b948baa02a90171b09a337 (patch) | |
tree | 9903e61c79c559c370752e1f305dbbc7464f1351 /tests/zfs-tests | |
parent | ca7ea23f8a173b554fa89f46de298fa038f9c6e2 (diff) |
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 <[email protected]>
Reviewed-by: Igor Kozhukhov <[email protected]>\
Reviewed-by: John Kennedy <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ryan Moeller <[email protected]>
Closes #10033
Diffstat (limited to 'tests/zfs-tests')
-rwxr-xr-x | tests/zfs-tests/tests/functional/refreserv/refreserv_multi_raidz.ksh | 6 | ||||
-rwxr-xr-x | tests/zfs-tests/tests/functional/refreserv/refreserv_raidz.ksh | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv_multi_raidz.ksh b/tests/zfs-tests/tests/functional/refreserv/refreserv_multi_raidz.ksh index c904a807f..ff79764ba 100755 --- a/tests/zfs-tests/tests/functional/refreserv/refreserv_multi_raidz.ksh +++ b/tests/zfs-tests/tests/functional/refreserv/refreserv_multi_raidz.ksh @@ -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) diff --git a/tests/zfs-tests/tests/functional/refreserv/refreserv_raidz.ksh b/tests/zfs-tests/tests/functional/refreserv/refreserv_raidz.ksh index 9f25242de..22891ef1d 100755 --- a/tests/zfs-tests/tests/functional/refreserv/refreserv_raidz.ksh +++ b/tests/zfs-tests/tests/functional/refreserv/refreserv_raidz.ksh @@ -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) |