예제 #1
0
void
test1(void)
{
	struct nvme_qpair qpair = {};
	struct nvme_command cmd = {};

	outbuf[0] = '\0';

	/*
	 * qpair.id == 0 means it is an admin queue.  Ensure
	 *  that the opc is decoded as an admin opc and not an
	 *  I/o opc.
	 */
	qpair.id = 0;
	cmd.opc = NVME_OPC_IDENTIFY;

	nvme_qpair_print_command(&qpair, &cmd);

	CU_ASSERT(strstr(outbuf, "IDENTIFY") != NULL);
}
예제 #2
0
파일: nvme_qpair_ut.c 프로젝트: ceph/spdk
static void
test2(void)
{
	struct nvme_qpair qpair = {};
	struct spdk_nvme_cmd cmd = {};

	outbuf[0] = '\0';

	/*
	 * qpair.id != 0 means it is an I/O queue.  Ensure
	 *  that the opc is decoded as an I/O opc and not an
	 *  admin opc.
	 */
	qpair.id = 1;
	cmd.opc = SPDK_NVME_OPC_DATASET_MANAGEMENT;

	nvme_qpair_print_command(&qpair, &cmd);

	CU_ASSERT(strstr(outbuf, "DATASET MANAGEMENT") != NULL);
}