From 0c653409dc406f6eddf6885906934d76b67e1397 Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Tue, 24 Jan 2023 11:05:00 +0100 Subject: [PATCH] test/vhost: add virtio blk transport negative test Try to create virtio blk transport. Transport is created at application start, so EEXIST error is expected. This is aimed purely at using rpc_virtio_blk_create_transport() from vhost_rpc.c to increase code coverage. Signed-off-by: Karol Latecki Change-Id: Iba87ef73f8d5a962bf5eac28c7e6c93bdb65b67f Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/16436 Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki Tested-by: SPDK CI Jenkins --- test/vhost/other/negative.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index e40627e22..806fa9152 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -205,6 +205,13 @@ if $rpc_py vhost_create_blk_controller blk_ctrl Malloc0; then fi $rpc_py bdev_lvol_delete_lvstore -l lvs +notice "Trying to create already existing block transport layer" +# vhost_user_blk transport is created by default on application start, +# so first rpc call to create the transport should fail with EEXIST. +if $rpc_py virtio_blk_create_transport vhost_user_blk; then + error "Creating already existing virtio blk transport succeded, but shouldn't" +fi + notice "Testing done -> shutting down" notice "killing vhost app" vhost_kill 0