UT/bdev/bdev_zone.c:add the test of zone_appendv_with_md
Signed-off-by: KanKuo <kuox.kan@intel.com> Change-Id: I8e669ac94a2df2e0e6c204413b30cd04d6f7e685 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/15097 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Community-CI: Mellanox Build Bot
This commit is contained in:
parent
9191665486
commit
df00a867f4
@ -62,7 +62,6 @@ static uint64_t g_start_lba;
|
||||
static uint64_t g_unexpected_start_lba;
|
||||
static uint64_t g_bdev_blocklen;
|
||||
static uint64_t g_unexpected_bdev_blocklen;
|
||||
static bool g_append_with_md;
|
||||
static int g_unexpected_iovcnt;
|
||||
static void *g_md_buf;
|
||||
static void *g_unexpected_md_buf;
|
||||
@ -83,7 +82,6 @@ test_setup(void)
|
||||
g_unexpected_start_lba = 0;
|
||||
g_bdev_blocklen = 4096;
|
||||
g_unexpected_bdev_blocklen = 0;
|
||||
g_append_with_md = false;
|
||||
g_unexpected_iovcnt = 1000;
|
||||
g_md_buf = (void *)0xEFDCFEDE;
|
||||
g_unexpected_md_buf = (void *)0xFECDEFDC;
|
||||
@ -385,7 +383,6 @@ test_bdev_zone_append(void)
|
||||
DECLARE_VIRTUAL_BDEV_START();
|
||||
|
||||
g_io_type = SPDK_BDEV_IO_TYPE_ZONE_APPEND;
|
||||
g_append_with_md = false;
|
||||
|
||||
start_operation();
|
||||
|
||||
@ -410,7 +407,6 @@ test_bdev_zone_append_with_md(void)
|
||||
DECLARE_VIRTUAL_BDEV_START();
|
||||
|
||||
g_io_type = SPDK_BDEV_IO_TYPE_ZONE_APPEND;
|
||||
g_append_with_md = true;
|
||||
|
||||
start_operation();
|
||||
|
||||
@ -436,7 +432,6 @@ test_bdev_zone_appendv(void)
|
||||
DECLARE_VIRTUAL_BDEV_START();
|
||||
|
||||
g_io_type = SPDK_BDEV_IO_TYPE_ZONE_APPEND;
|
||||
g_append_with_md = true;
|
||||
|
||||
start_operation();
|
||||
|
||||
@ -455,6 +450,30 @@ test_bdev_zone_appendv(void)
|
||||
stop_operation();
|
||||
}
|
||||
|
||||
static void
|
||||
test_bdev_zone_appendv_with_md(void)
|
||||
{
|
||||
DECLARE_VIRTUAL_BDEV_START();
|
||||
|
||||
g_io_type = SPDK_BDEV_IO_TYPE_ZONE_APPEND;
|
||||
|
||||
start_operation();
|
||||
|
||||
rc = spdk_bdev_zone_appendv_with_md(desc, ch, g_zone_op->bdev.iovs, g_unexpected_iovcnt, g_md_buf,
|
||||
g_start_lba, g_num_blocks, NULL, NULL);
|
||||
|
||||
CU_ASSERT(rc == 0);
|
||||
CU_ASSERT(g_bdev_io->internal.desc == desc);
|
||||
CU_ASSERT(g_bdev_io->type == SPDK_BDEV_IO_TYPE_ZONE_APPEND);
|
||||
CU_ASSERT(g_bdev_io->u.bdev.iovs == g_zone_op->bdev.iovs);
|
||||
CU_ASSERT(g_bdev_io->u.bdev.iovcnt == g_unexpected_iovcnt);
|
||||
CU_ASSERT(g_bdev_io->u.bdev.md_buf == g_md_buf);
|
||||
CU_ASSERT(g_bdev_io->u.bdev.num_blocks == g_num_blocks);
|
||||
CU_ASSERT(g_bdev_io->u.bdev.offset_blocks == g_expected_zone_id);
|
||||
|
||||
stop_operation();
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
@ -471,6 +490,7 @@ main(int argc, char **argv)
|
||||
CU_ADD_TEST(suite, test_bdev_zone_append);
|
||||
CU_ADD_TEST(suite, test_bdev_zone_append_with_md);
|
||||
CU_ADD_TEST(suite, test_bdev_zone_appendv);
|
||||
CU_ADD_TEST(suite, test_bdev_zone_appendv_with_md);
|
||||
CU_ADD_TEST(suite, test_bdev_io_get_append_location);
|
||||
|
||||
CU_basic_set_mode(CU_BRM_VERBOSE);
|
||||
|
Loading…
Reference in New Issue
Block a user