test/llvm_nvme_fuzz: add NAMESPACE ATTACHMENT and NAMESPACE MANAGEMENT

command test cases

Change-Id: I48a9a37d54269b2d7038a96dace9aefba334ede8
Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11011
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Dong Yi <dongx.yi@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Yifan Bian 2022-01-10 07:29:22 +00:00 committed by Tomasz Zawadzki
parent d9f1d4e1dd
commit daacb4264a

View File

@ -208,6 +208,30 @@ fuzz_admin_delete_io_submission_queue_command(struct fuzz_command *cmd)
g_data += 2;
}
static void
fuzz_admin_namespace_attachment_command(struct fuzz_command *cmd)
{
memset(&cmd->cmd, 0, sizeof(cmd->cmd));
cmd->cmd.opc = SPDK_NVME_OPC_NS_ATTACHMENT;
cmd->cmd.cdw10_bits.raw = 0;
cmd->cmd.cdw10_bits.ns_attach.sel = (g_data[0] >> 4) & 0x0f;
g_data += 1;
}
static void
fuzz_admin_namespace_management_command(struct fuzz_command *cmd)
{
memset(&cmd->cmd, 0, sizeof(cmd->cmd));
cmd->cmd.opc = SPDK_NVME_OPC_NS_MANAGEMENT;
cmd->cmd.cdw10_bits.raw = 0;
cmd->cmd.cdw10_bits.ns_manage.sel = (g_data[0] >> 4) & 0x0f;
g_data += 1;
}
static struct fuzz_type g_fuzzers[] = {
{ .fn = fuzz_admin_command, .bytes_per_cmd = sizeof(struct spdk_nvme_cmd) },
{ .fn = fuzz_admin_get_log_page_command, .bytes_per_cmd = 6 },
@ -217,6 +241,8 @@ static struct fuzz_type g_fuzzers[] = {
{ .fn = fuzz_admin_create_io_submission_queue_command, .bytes_per_cmd = 9},
{ .fn = fuzz_admin_delete_io_completion_queue_command, .bytes_per_cmd = 2},
{ .fn = fuzz_admin_delete_io_submission_queue_command, .bytes_per_cmd = 2},
{ .fn = fuzz_admin_namespace_attachment_command, .bytes_per_cmd = 1},
{ .fn = fuzz_admin_namespace_management_command, .bytes_per_cmd = 1},
{ .fn = NULL, .bytes_per_cmd = 0 }
};