From e1accdca3a91d9705569b04bd9453ed4a125ec49 Mon Sep 17 00:00:00 2001 From: Dariusz Stojaczyk Date: Mon, 12 Feb 2018 18:40:23 +0100 Subject: [PATCH] ut/vhost: remove test case `Remove device with too long name and path` This was originally introduced to improve code coverage in vhost_dev_unregister() where we used to check against buffer overflow. But the check has been removed long ago. The vdev socket path string is validated only on device registration. The test case is being removed because it conflicts with upcoming changes. Rather than trying to refactor and fix it, let's remove it - it's no longer needed. Change-Id: I3bac15725e94b38d375db6376bea4a7b1e44d75c Signed-off-by: Dariusz Stojaczyk Reviewed-on: https://review.gerrithub.io/399441 Reviewed-by: Daniel Verkamp Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris --- test/unit/lib/vhost/vhost.c/vhost_ut.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/test/unit/lib/vhost/vhost.c/vhost_ut.c b/test/unit/lib/vhost/vhost.c/vhost_ut.c index c8bda33a2..923dcd659 100644 --- a/test/unit/lib/vhost/vhost.c/vhost_ut.c +++ b/test/unit/lib/vhost/vhost.c/vhost_ut.c @@ -278,7 +278,6 @@ static void remove_controller_test(void) { struct spdk_vhost_dev *vdev; - char long_name[PATH_MAX]; int ret; vdev = alloc_vdev(); @@ -296,25 +295,8 @@ remove_controller_test(void) vdev->lcore = -1; ret = spdk_vhost_dev_unregister(vdev); CU_ASSERT(ret != 0); - if (ret != 0) { - free(vdev->name); - } - - /* Remove device with too long name and path */ - memset(long_name, 'x', sizeof(long_name)); - long_name[PATH_MAX - 1] = 0; - snprintf(dev_dirname, sizeof(dev_dirname), "some_path/"); - vdev->name = strdup(long_name); - g_spdk_vhost_devices[0] = vdev; - ret = spdk_vhost_dev_unregister(vdev); - CU_ASSERT(ret != 0); - if (ret == 0) { - vdev->name = NULL; - } free_vdev(vdev); - g_spdk_vhost_devices[0] = NULL; - dev_dirname[0] = 0; } int