Tests: add helper macro for REPORT_SUPPORTED_OPCODES
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -29,41 +29,23 @@
|
||||
void
|
||||
test_report_supported_opcodes_rctd(void)
|
||||
{
|
||||
int i, ret;
|
||||
int i;
|
||||
struct scsi_task *rso_task;
|
||||
struct scsi_report_supported_op_codes *rsoc;
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test READ_SUPPORTED_OPCODES RCTD flag");
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "Test READ_SUPPORTED_OPCODES report ALL opcodes "
|
||||
"without timeout descriptors. RCTD==0");
|
||||
ret = report_supported_opcodes(
|
||||
sd, &rso_task,
|
||||
0, SCSI_REPORT_SUPPORTING_OPS_ALL, 0, 0,
|
||||
65535,
|
||||
EXPECT_STATUS_GOOD);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] READ_SUPPORTED_OPCODES is not "
|
||||
"implemented.");
|
||||
CU_PASS("READ_SUPPORTED_OPCODES is not implemented.");
|
||||
goto out;
|
||||
}
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret != 0)
|
||||
goto out;
|
||||
REPORT_SUPPORTED_OPCODES(sd, &rso_task,
|
||||
0, SCSI_REPORT_SUPPORTING_OPS_ALL, 0, 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);
|
||||
if (!rsoc) {
|
||||
logging(LOG_NORMAL, "[FAILED] Target did not return any data "
|
||||
"for ReportSupportedOpcodes\n");
|
||||
CU_FAIL("Target did not return any data for "
|
||||
"ReportSupportedOpcodes");
|
||||
goto out;
|
||||
}
|
||||
CU_ASSERT_PTR_NOT_NULL_FATAL(rsoc);
|
||||
|
||||
logging(LOG_VERBOSE, "Verify that all returned command descriptors "
|
||||
"lack timeout description");
|
||||
@@ -75,20 +57,15 @@ test_report_supported_opcodes_rctd(void)
|
||||
"CTDP set");
|
||||
}
|
||||
}
|
||||
|
||||
scsi_free_scsi_task(rso_task);
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "Test READ_SUPPORTED_OPCODES report ALL opcodes "
|
||||
"with timeout descriptors. RCTD==1");
|
||||
ret = report_supported_opcodes(
|
||||
sd, &rso_task,
|
||||
1, SCSI_REPORT_SUPPORTING_OPS_ALL, 0, 0,
|
||||
65535,
|
||||
EXPECT_STATUS_GOOD);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret != 0)
|
||||
goto out;
|
||||
REPORT_SUPPORTED_OPCODES(sd, &rso_task,
|
||||
1, SCSI_REPORT_SUPPORTING_OPS_ALL, 0, 0,
|
||||
65535,
|
||||
EXPECT_STATUS_GOOD);
|
||||
|
||||
logging(LOG_VERBOSE, "Unmarshall the DATA-IN buffer");
|
||||
rsoc = scsi_datain_unmarshall(rso_task);
|
||||
@@ -117,6 +94,5 @@ test_report_supported_opcodes_rctd(void)
|
||||
}
|
||||
}
|
||||
|
||||
out:
|
||||
scsi_free_scsi_task(rso_task);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user