From 2c1912f64b6a794a7caf2791471c37b3f51d2e50 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Tue, 13 Feb 2018 13:13:29 +0100 Subject: [PATCH] ut/vhost: remove test case `Remove nonexistent device` This test case doesn't work. The title suggests that unregistering non-registered device should fail - but in fact we don't check against that. The test expects failure, but fails due to a different issue - the device is in use. And there is already a separate test for this case. Device is considered in use when it's vid is != -1, and we always init the vid to 10 inside alloc_vdev. Change-Id: I8de1afce8f6bcbd2a6bfbb30870265e30b2a9a41 Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/399590 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Daniel Verkamp --- test/unit/lib/vhost/vhost.c/vhost_ut.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/unit/lib/vhost/vhost.c/vhost_ut.c b/test/unit/lib/vhost/vhost.c/vhost_ut.c index 14fe2c918..52ff5f78a 100644 --- a/test/unit/lib/vhost/vhost.c/vhost_ut.c +++ b/test/unit/lib/vhost/vhost.c/vhost_ut.c @@ -303,15 +303,6 @@ remove_controller_test(void) /* Remove device when controller is in use */ ret = spdk_vhost_dev_unregister(vdev); CU_ASSERT(ret != 0); - if (ret == 0) { - vdev->name = strdup("vdev_name_0"); - } - - /* Remove nonexistent device */ - vdev->lcore = -1; - ret = spdk_vhost_dev_unregister(vdev); - CU_ASSERT(ret != 0); - free_vdev(vdev); }