From 686b0d34d262f2f4840e5c0db4c1904586a960cf Mon Sep 17 00:00:00 2001 From: Pawel Kaminski Date: Mon, 17 Feb 2020 10:01:59 -0500 Subject: [PATCH] test/vhost Add negative test for vhost_create_blk_controller rpc Try to create blk controller with bdev that is already claimed by lvol module Change-Id: Id034968e12c946d18c063056f5b7fb01883af6d6 Signed-off-by: Pawel Kaminski Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/929 Tested-by: SPDK CI Jenkins Reviewed-by: Michal Berger Reviewed-by: Shuhei Matsumoto Reviewed-by: Karol Latecki Reviewed-by: Darek Stojaczyk --- test/vhost/other/negative.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/vhost/other/negative.sh b/test/vhost/other/negative.sh index d8b57dd7a..350f0a844 100755 --- a/test/vhost/other/negative.sh +++ b/test/vhost/other/negative.sh @@ -180,6 +180,18 @@ if $rpc_py vhost_create_blk_controller . Malloc0; then error "Creating block controller with incorrect name succeeded, but it shouldn't" fi +notice "Trying to create block controller with nonexistent bdev" +if $rpc_py vhost_create_blk_controller blk_ctrl Malloc3; then + error "Creating block controller with nonexistent bdev succeeded, but shouldn't" +fi + +notice "Trying to create block controller with claimed bdev" +$rpc_py bdev_lvol_create_lvstore Malloc0 lvs +if $rpc_py vhost_create_blk_controller blk_ctrl Malloc0; then + error "Creating block controller with claimed bdev succeeded, but shouldn't" +fi +$rpc_py bdev_lvol_delete_lvstore -l lvs + notice "Testing done -> shutting down" notice "killing vhost app" vhost_kill 0