test/llvm_nvme_fuzz: add ABORT command test case

Change-Id: Ibfdb75771abc20ecf0c436314d26c1791cf0a518
Signed-off-by: Yifan Bian <yifan.bian@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10922
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Bianyfan 2021-12-30 08:29:04 +00:00 committed by Tomasz Zawadzki
parent 7de351f1d7
commit 5d5b293387

View File

@ -127,10 +127,24 @@ fuzz_admin_identify_command(struct fuzz_command *cmd)
g_data += 7;
}
static void
fuzz_admin_abort_command(struct fuzz_command *cmd)
{
memset(&cmd->cmd, 0, sizeof(cmd->cmd));
cmd->cmd.opc = SPDK_NVME_OPC_ABORT;
cmd->cmd.cdw10_bits.raw = 0;
cmd->cmd.cdw10_bits.abort.sqid = (g_data[0] << 8) + g_data[1];
cmd->cmd.cdw10_bits.abort.cid = (g_data[2] << 8) + g_data[3];
g_data += 4;
}
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 },
{ .fn = fuzz_admin_identify_command, .bytes_per_cmd = 7 },
{ .fn = fuzz_admin_abort_command, .bytes_per_cmd = 4},
{ .fn = NULL, .bytes_per_cmd = 0 }
};