From 5883d34300b84c97ce6d36b82c22483c5e37838a Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Tue, 17 Dec 2019 15:12:07 -0700 Subject: [PATCH] test/blockdev: parameterize the nbd test. This allows us to run the NBD tests on any combination of bdevs based on the flags passed to the script. Previously we ran the tests on a specific grouping of bdevs and opted to only free one type (passthru) over RPC after the test ran. Rather than free all bdev types in the new implementation, I opted to not free any of them via RPC and rather allow the application to close them at termination time. Change-Id: I574db4f941bfbb073cceed4610e1f5d43028569f Signed-off-by: Seth Howell Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478246 Tested-by: SPDK CI Jenkins Reviewed-by: Tomasz Zawadzki Reviewed-by: Karol Latecki Reviewed-by: Jim Harris --- test/bdev/blockdev.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/bdev/blockdev.sh b/test/bdev/blockdev.sh index bec007507..f5d1db4e6 100755 --- a/test/bdev/blockdev.sh +++ b/test/bdev/blockdev.sh @@ -92,9 +92,12 @@ function nbd_function_test() { if [ $(uname -s) = Linux ] && modprobe -n nbd; then local rpc_server=/var/tmp/spdk-nbd.sock local conf=$1 - local nbd_num=6 local nbd_all=($(ls /dev/nbd* | grep -v p)) local bdev_all=($bdevs_name) + local nbd_num=${#bdevs_all[@]} + if [ ${#nbd_all[@]} -le $nbd_num ]; then + nbd_num=${#nbd_all[@]} + fi local nbd_list=(${nbd_all[@]:0:$nbd_num}) local bdev_list=(${bdev_all[@]:0:$nbd_num}) @@ -112,8 +115,6 @@ function nbd_function_test() { nbd_rpc_start_stop_verify $rpc_server "${bdev_list[*]}" nbd_rpc_data_verify $rpc_server "${bdev_list[*]}" "${nbd_list[*]}" - $rpc_py -s $rpc_server bdev_passthru_delete TestPT - killprocess $nbd_pid trap - SIGINT SIGTERM EXIT fi