TESTS: Add helper function for READ10 that returns a task*

This commit is contained in:
Ronnie Sahlberg
2013-07-05 16:14:21 -07:00
parent d8d10c0a44
commit 6a65874dd9
4 changed files with 34 additions and 18 deletions

View File

@@ -33,15 +33,8 @@ check_wabereq(void)
struct scsi_task *task_ret;
logging(LOG_VERBOSE, "Read one block from LBA 0");
task_ret = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task_ret);
memset(task_ret, 0, sizeof(struct scsi_task));
task_ret->cdb[0] = SCSI_OPCODE_READ10;
task_ret->cdb[8] = 1;
task_ret->cdb_size = 10;
task_ret->xfer_dir = SCSI_XFER_READ;
task_ret->expxferlen = 0;
task_ret = iscsi_scsi_command_sync(iscsic, tgt_lun, task_ret, NULL);
task_ret = read10_task(iscsic, tgt_lun, 0, block_size, block_size,
0, 0, 0, 0, 0, NULL);
CU_ASSERT_PTR_NOT_NULL(task_ret);
CU_ASSERT_NOT_EQUAL(task_ret->status, SCSI_STATUS_CANCELLED);