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 <seth.howell@intel.com> Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/478246 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Karol Latecki <karol.latecki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
b2235c1f97
commit
5883d34300
@ -92,9 +92,12 @@ function nbd_function_test() {
|
|||||||
if [ $(uname -s) = Linux ] && modprobe -n nbd; then
|
if [ $(uname -s) = Linux ] && modprobe -n nbd; then
|
||||||
local rpc_server=/var/tmp/spdk-nbd.sock
|
local rpc_server=/var/tmp/spdk-nbd.sock
|
||||||
local conf=$1
|
local conf=$1
|
||||||
local nbd_num=6
|
|
||||||
local nbd_all=($(ls /dev/nbd* | grep -v p))
|
local nbd_all=($(ls /dev/nbd* | grep -v p))
|
||||||
local bdev_all=($bdevs_name)
|
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 nbd_list=(${nbd_all[@]:0:$nbd_num})
|
||||||
local bdev_list=(${bdev_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_start_stop_verify $rpc_server "${bdev_list[*]}"
|
||||||
nbd_rpc_data_verify $rpc_server "${bdev_list[*]}" "${nbd_list[*]}"
|
nbd_rpc_data_verify $rpc_server "${bdev_list[*]}" "${nbd_list[*]}"
|
||||||
|
|
||||||
$rpc_py -s $rpc_server bdev_passthru_delete TestPT
|
|
||||||
|
|
||||||
killprocess $nbd_pid
|
killprocess $nbd_pid
|
||||||
trap - SIGINT SIGTERM EXIT
|
trap - SIGINT SIGTERM EXIT
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user