Merge pull request #244 from bvanassche/master

test tool: Set BYTCHK=1 if EDTL != 0
This commit is contained in:
Ronnie Sahlberg
2017-05-03 15:31:55 -07:00
committed by GitHub
15 changed files with 39 additions and 33 deletions

View File

@@ -93,7 +93,7 @@ static void
test_writeverify10(void)
{
logging(LOG_VERBOSE, "Test WRITEVERIFY10 when medium is ejected.");
WRITEVERIFY10(sd, 0, block_size, block_size, 0, 0, 0, 0, scratch,
WRITEVERIFY10(sd, 0, block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_NO_MEDIUM);
}
@@ -101,7 +101,7 @@ static void
test_writeverify12(void)
{
logging(LOG_VERBOSE, "Test WRITEVERIFY12 when medium is ejected.");
WRITEVERIFY12(sd, 0, block_size, block_size, 0, 0, 0, 0, scratch,
WRITEVERIFY12(sd, 0, block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_NO_MEDIUM);
}
@@ -109,7 +109,7 @@ static void
test_writeverify16(void)
{
logging(LOG_VERBOSE, "Test WRITEVERIFY16 when medium is ejected.");
WRITEVERIFY16(sd, 0, block_size, block_size, 0, 0, 0, 0, scratch,
WRITEVERIFY16(sd, 0, block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_NO_MEDIUM);
}

View File

@@ -82,7 +82,7 @@ static void
test_writeverify10(void)
{
logging(LOG_VERBOSE, "Test WRITEVERIFY10 fails with WRITE_PROTECTED");
WRITEVERIFY10(sd, 0, block_size, block_size, 0, 0, 0, 0, scratch,
WRITEVERIFY10(sd, 0, block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_WRITE_PROTECTED);
}
@@ -90,7 +90,7 @@ static void
test_writeverify12(void)
{
logging(LOG_VERBOSE, "Test WRITEVERIFY12 fails with WRITE_PROTECTED");
WRITEVERIFY12(sd, 0, block_size, block_size, 0, 0, 0, 0, scratch,
WRITEVERIFY12(sd, 0, block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_WRITE_PROTECTED);
}
@@ -98,7 +98,7 @@ static void
test_writeverify16(void)
{
logging(LOG_VERBOSE, "Test WRITEVERIFY16 fails with WRITE_PROTECTED");
WRITEVERIFY16(sd, 0, block_size, block_size, 0, 0, 0, 0, scratch,
WRITEVERIFY16(sd, 0, block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_WRITE_PROTECTED);
}

View File

@@ -46,7 +46,7 @@ test_writeverify10_beyond_eol(void)
break;
}
WRITEVERIFY10(sd, num_blocks + 1 - i,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -56,7 +56,7 @@ test_writeverify10_beyond_eol(void)
break;
}
WRITEVERIFY10(sd, 0x80000000,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -66,7 +66,7 @@ test_writeverify10_beyond_eol(void)
break;
}
WRITEVERIFY10(sd, -1, i * block_size,
block_size, 0, 0, 0, 0, scratch,
block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -76,7 +76,7 @@ test_writeverify10_beyond_eol(void)
break;
}
WRITEVERIFY10(sd, num_blocks - 1,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
}

View File

@@ -64,11 +64,11 @@ test_writeverify10_dpo(void)
logging(LOG_VERBOSE, "Test WRITEVERIFY10 with DPO==1");
if (dpofua) {
WRITEVERIFY10(sd, 0, block_size,
block_size, 0, 1, 0, 0, scratch,
block_size, 0, 1, 1, 0, scratch,
EXPECT_STATUS_GOOD);
} else {
WRITEVERIFY10(sd, 0, block_size,
block_size, 0, 1, 0, 0, scratch,
block_size, 0, 1, 1, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
}

View File

@@ -62,6 +62,7 @@ test_writeverify10_residuals(void)
memset(task, 0, sizeof(struct scsi_task));
task->cdb[0] = SCSI_OPCODE_WRITE_VERIFY10;
task->cdb[1] = 2; /* BYTCHK = 1 */
task->cdb[8] = 1;
task->cdb_size = 10;
task->xfer_dir = SCSI_XFER_WRITE;
@@ -121,6 +122,7 @@ test_writeverify10_residuals(void)
memset(task, 0, sizeof(struct scsi_task));
task->cdb[0] = SCSI_OPCODE_WRITE_VERIFY10;
task->cdb[1] = 2; /* BYTCHK = 1 */
task->cdb[8] = 1;
task->cdb_size = 10;
task->xfer_dir = SCSI_XFER_WRITE;
@@ -164,6 +166,7 @@ test_writeverify10_residuals(void)
memset(task, 0, sizeof(struct scsi_task));
task->cdb[0] = SCSI_OPCODE_WRITE_VERIFY10;
task->cdb[1] = 2; /* BYTCHK = 1 */
task->cdb[8] = 1;
task->cdb_size = 10;
task->xfer_dir = SCSI_XFER_WRITE;
@@ -213,6 +216,7 @@ test_writeverify10_residuals(void)
memset(task, 0, sizeof(struct scsi_task));
task->cdb[0] = SCSI_OPCODE_WRITE_VERIFY10;
task->cdb[1] = 2; /* BYTCHK = 1 */
task->cdb[8] = 2;
task->cdb_size = 10;
task->xfer_dir = SCSI_XFER_WRITE;
@@ -266,6 +270,7 @@ test_writeverify10_residuals(void)
memset(task, 0, sizeof(struct scsi_task));
task->cdb[0] = SCSI_OPCODE_WRITE_VERIFY10;
task->cdb[1] = 2; /* BYTCHK = 1 */
task->cdb[8] = 1;
task->cdb_size = 10;
task->xfer_dir = SCSI_XFER_WRITE;
@@ -338,6 +343,7 @@ test_writeverify10_residuals(void)
memset(task, 0, sizeof(struct scsi_task));
task->cdb[0] = SCSI_OPCODE_WRITE_VERIFY10;
task->cdb[1] = 2; /* BYTCHK = 1 */
task->cdb[8] = 2;
task->cdb_size = 10;
task->xfer_dir = SCSI_XFER_WRITE;

View File

@@ -42,7 +42,7 @@ test_writeverify10_simple(void)
break;
}
WRITEVERIFY10(sd, 0, i * block_size,
block_size, 0, 0, 0, 0, scratch,
block_size, 0, 0, 1, 0, scratch,
EXPECT_STATUS_GOOD);
}
@@ -52,7 +52,7 @@ test_writeverify10_simple(void)
break;
}
WRITEVERIFY10(sd, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_STATUS_GOOD);
}
}

View File

@@ -46,7 +46,7 @@ test_writeverify10_wrprotect(void)
logging(LOG_VERBOSE, "Device does not support/use protection information. All commands should fail.");
for (i = 1; i < 8; i++) {
WRITEVERIFY10(sd, 0, block_size, block_size,
i, 0, 0, 0, scratch,
i, 0, 1, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
}
return;

View File

@@ -46,7 +46,7 @@ test_writeverify12_beyond_eol(void)
break;
}
WRITEVERIFY12(sd, num_blocks + 1 - i,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -56,7 +56,7 @@ test_writeverify12_beyond_eol(void)
break;
}
WRITEVERIFY12(sd, 0x80000000,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -66,7 +66,7 @@ test_writeverify12_beyond_eol(void)
break;
}
WRITEVERIFY12(sd, -1, i * block_size,
block_size, 0, 0, 0, 0, scratch,
block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -76,7 +76,7 @@ test_writeverify12_beyond_eol(void)
break;
}
WRITEVERIFY12(sd, num_blocks - 1,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
}

View File

@@ -64,11 +64,11 @@ test_writeverify12_dpo(void)
logging(LOG_VERBOSE, "Test WRITEVERIFY12 with DPO==1");
if (dpofua) {
WRITEVERIFY12(sd, 0, block_size,
block_size, 0, 1, 0, 0, scratch,
block_size, 0, 1, 1, 0, scratch,
EXPECT_STATUS_GOOD);
} else {
WRITEVERIFY12(sd, 0, block_size,
block_size, 0, 1, 0, 0, scratch,
block_size, 0, 1, 1, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
}

View File

@@ -42,7 +42,7 @@ test_writeverify12_simple(void)
break;
}
WRITEVERIFY12(sd, 0, i * block_size,
block_size, 0, 0, 0, 0, scratch,
block_size, 0, 0, 1, 0, scratch,
EXPECT_STATUS_GOOD);
}
@@ -52,7 +52,7 @@ test_writeverify12_simple(void)
break;
}
WRITEVERIFY12(sd, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_STATUS_GOOD);
}
}

View File

@@ -46,7 +46,7 @@ test_writeverify12_wrprotect(void)
logging(LOG_VERBOSE, "Device does not support/use protection information. All commands should fail.");
for (i = 1; i < 8; i++) {
WRITEVERIFY12(sd, 0, block_size, block_size,
i, 0, 0, 0, scratch,
i, 0, 1, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
}
return;

View File

@@ -42,7 +42,7 @@ test_writeverify16_beyond_eol(void)
break;
}
WRITEVERIFY16(sd, num_blocks + 1 - i,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -52,7 +52,7 @@ test_writeverify16_beyond_eol(void)
break;
}
WRITEVERIFY16(sd, 0x8000000000000000ULL,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -62,7 +62,7 @@ test_writeverify16_beyond_eol(void)
break;
}
WRITEVERIFY16(sd, -1,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
@@ -72,7 +72,7 @@ test_writeverify16_beyond_eol(void)
break;
}
WRITEVERIFY16(sd, num_blocks - 1,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_LBA_OOB);
}
}

View File

@@ -65,11 +65,11 @@ test_writeverify16_dpo(void)
memset(scratch, 0xa6, block_size);
if (dpofua) {
WRITEVERIFY16(sd, 0, block_size,
block_size, 0, 1, 0, 0, scratch,
block_size, 0, 1, 1, 0, scratch,
EXPECT_STATUS_GOOD);
} else {
WRITEVERIFY16(sd, 0, block_size,
block_size, 0, 1, 0, 0, scratch,
block_size, 0, 1, 1, 0, scratch,
EXPECT_INVALID_FIELD_IN_CDB);
}

View File

@@ -53,7 +53,7 @@ test_writeverify16_residuals(void)
}
/* check if writeverify16 is supported */
WRITEVERIFY16(sd, 0, 0, block_size, 0, 0, 0, 0, NULL,
WRITEVERIFY16(sd, 0, 0, block_size, 0, 0, 1, 0, NULL,
EXPECT_STATUS_GOOD);
if (sd->iscsi_ctx == NULL) {

View File

@@ -43,7 +43,7 @@ test_writeverify16_simple(void)
break;
}
WRITEVERIFY16(sd, 0, i * block_size,
block_size, 0, 0, 0, 0, scratch,
block_size, 0, 0, 1, 0, scratch,
EXPECT_STATUS_GOOD);
}
@@ -53,7 +53,7 @@ test_writeverify16_simple(void)
break;
}
WRITEVERIFY16(sd, num_blocks - i,
i * block_size, block_size, 0, 0, 0, 0, scratch,
i * block_size, block_size, 0, 0, 1, 0, scratch,
EXPECT_STATUS_GOOD);
}
}