From 6ac949c0d1c1aced0f516147ebd0896a0995c203 Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Wed, 18 Dec 2019 08:27:53 -0700 Subject: [PATCH] test/blockdev: check bdev list before running unmap Some bdevs don't support unmap so they may not be able to run the fio unmap tests. In case none of the bdevs we are testing support this operation, the test will be skipped. Change-Id: I5063297f0378bc87abf50e5311d147251cfe0ad9 Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478337 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Karol Latecki Reviewed-by: Jim Harris Reviewed-by: Paul Luse --- test/bdev/blockdev.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/bdev/blockdev.sh b/test/bdev/blockdev.sh index f5d1db4e6..989c644da 100755 --- a/test/bdev/blockdev.sh +++ b/test/bdev/blockdev.sh @@ -144,9 +144,14 @@ function fio_test_suite() { # Generate the fio config file given the list of all unclaimed bdevs that support unmap fio_config_gen $testdir/bdev.fio trim - for b in $(echo $bdevs | jq -r 'select(.supported_io_types.unmap == true) | .name'); do - fio_config_add_job $testdir/bdev.fio $b - done + if [ "$(echo $bdevs | jq -r 'select(.supported_io_types.unmap == true) | .name')" != "" ]; then + for b in $(echo $bdevs | jq -r 'select(.supported_io_types.unmap == true) | .name'); do + fio_config_add_job $testdir/bdev.fio $b + done + else + rm -f $testdir/bdev.fio + return 0 + fi run_test "bdev_fio_trim" fio_bdev $fio_params --output=$output_dir/blockdev_trim.txt rm -f ./*.state