Tests: add helper macro for REPORT_SUPPORTED_OPCODES

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-02-21 08:30:37 -08:00
parent f699503f8c
commit 4d1e3aecd0
20 changed files with 360 additions and 587 deletions

View File

@@ -76,20 +76,16 @@ test_writeverify12_dpo(void)
logging(LOG_VERBOSE, "Try fetching REPORT_SUPPORTED_OPCODES "
"for WRITEVERIFY12");
ret = report_supported_opcodes(sd, &rso_task,
0, SCSI_REPORT_SUPPORTING_OPCODE,
SCSI_OPCODE_WRITE_VERIFY12,
0,
65535,
EXPECT_STATUS_GOOD);
if (ret == -2) {
logging(LOG_NORMAL, "REPORT_SUPPORTED_OPCODES not implemented. "
"Skipping this part of the test");
goto out;
}
REPORT_SUPPORTED_OPCODES(sd, &rso_task,
0, SCSI_REPORT_SUPPORTING_OPCODE,
SCSI_OPCODE_WRITE_VERIFY12,
0,
65535,
EXPECT_STATUS_GOOD);
logging(LOG_VERBOSE, "Unmarshall the DATA-IN buffer");
rsoc = scsi_datain_unmarshall(rso_task);
CU_ASSERT_NOT_EQUAL(rsoc, NULL);
CU_ASSERT_PTR_NOT_NULL_FATAL(rsoc);
usage_data_dpo = rsoc ? rsoc->cdb_usage_data[1] & 0x10 : -1;
if (dpofua) {
logging(LOG_VERBOSE, "DPOFUA is set. Verify the DPO flag "
@@ -101,6 +97,5 @@ test_writeverify12_dpo(void)
CU_ASSERT_EQUAL(usage_data_dpo, 0x00);
}
out:
scsi_free_scsi_task(rso_task);
}