Commit fba24e2f authored by Jim Harris's avatar Jim Harris Committed by Changpeng Liu
Browse files

reduce_ut: add test for null backing_dev fn_ptrs



Ensure in init_failure() that even after we generate
a UUID, the init still fails since the backing_dev
function pointers are still NULL.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I3287da8626152649416b4aaf4285eb9f84f79200

Reviewed-on: https://review.gerrithub.io/433084


Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
parent df79ac68
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -243,6 +243,17 @@ init_failure(void)
	CU_ASSERT(g_ziperrno == -EINVAL);
	SPDK_CU_ASSERT_FATAL(g_vol == NULL);

	/* uuid is now valid, but backing_dev still has null function pointers.
	 * This should fail.
	 */
	spdk_uuid_generate(&params.uuid);

	g_vol = NULL;
	g_ziperrno = 0;
	spdk_reduce_vol_init(&params, &backing_dev, &pm_file, init_cb, NULL);
	CU_ASSERT(g_ziperrno == -EINVAL);
	SPDK_CU_ASSERT_FATAL(g_vol == NULL);

	pm_file_close(&pm_file);
	pm_file_destroy();
}