test/bdev: properly cleanup bdev layer in bdev_io_wait_test

A new unit test in an upcoming patch will initialize the bdev
layer separately, so modify the existing tests now so that
they properly cleanup the bdev layer after the unit test
that initialized it is complete.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: Ie00837a90391ca4d0dd578e978fb26483fe5c0cf

Reviewed-on: https://review.gerrithub.io/423023
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Jim Harris 2018-08-21 13:33:54 -07:00
parent 9f2dd0c4f8
commit 8ef7818a2e

View File

@ -158,6 +158,7 @@ bdev_ut_module_init(void)
static void
bdev_ut_module_fini(void)
{
spdk_io_device_unregister(&g_bdev_ut_io_device, NULL);
}
struct spdk_bdev_module bdev_ut_if = {
@ -595,6 +596,11 @@ bdev_init_cb(void *arg, int rc)
CU_ASSERT(rc == 0);
}
static void
bdev_fini_cb(void *arg)
{
}
struct bdev_ut_io_wait_entry {
struct spdk_bdev_io_wait_entry entry;
struct spdk_io_channel *io_ch;
@ -685,6 +691,7 @@ bdev_io_wait_test(void)
spdk_put_io_channel(io_ch);
spdk_bdev_close(desc);
free_bdev(bdev);
spdk_bdev_finish(bdev_fini_cb, NULL);
}
int