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); }
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); }