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 <dariuszx.stojaczyk@intel.com> Reviewed-on: https://review.gerrithub.io/399441 Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
ea6c27099c
commit
e1accdca3a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user