TESTS: Read standard inq page before we spawn the tests
We dont need to call inq so often from the tests if we read the standard page once before the tests begin
This commit is contained in:
@@ -25,9 +25,7 @@ int T0360_startstopunit_simple(const char *initiator, const char *url)
|
||||
{
|
||||
struct iscsi_context *iscsi;
|
||||
struct scsi_task *task;
|
||||
struct scsi_inquiry_standard *inq;
|
||||
int ret, lun, removable;
|
||||
int full_size;
|
||||
int ret, lun;
|
||||
|
||||
printf("0360_startstopunit_simple:\n");
|
||||
printf("===================\n");
|
||||
@@ -47,32 +45,6 @@ int T0360_startstopunit_simple(const char *initiator, const char *url)
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* See how big this inquiry data is */
|
||||
task = iscsi_inquiry_sync(iscsi, lun, 0, 0, 64);
|
||||
if (task == NULL || task->status != SCSI_STATUS_GOOD) {
|
||||
printf("Inquiry command failed : %s\n", iscsi_get_error(iscsi));
|
||||
return -1;
|
||||
}
|
||||
full_size = scsi_datain_getfullsize(task);
|
||||
if (full_size > task->datain.size) {
|
||||
scsi_free_scsi_task(task);
|
||||
|
||||
/* we need more data for the full list */
|
||||
if ((task = iscsi_inquiry_sync(iscsi, lun, 0, 0, full_size)) == NULL) {
|
||||
printf("Inquiry command failed : %s\n", iscsi_get_error(iscsi));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
inq = scsi_datain_unmarshall(task);
|
||||
if (inq == NULL) {
|
||||
printf("failed to unmarshall inquiry datain blob\n");
|
||||
scsi_free_scsi_task(task);
|
||||
return -1;
|
||||
}
|
||||
removable = inq->rmb;
|
||||
|
||||
scsi_free_scsi_task(task);
|
||||
|
||||
if (!data_loss) {
|
||||
printf("--dataloss flag is not set. Skipping test\n");
|
||||
ret = -2;
|
||||
|
||||
Reference in New Issue
Block a user