TESTS: *protect field set to non-zero are only guaranteed to fail if the device does not support protection information
This commit is contained in:
@@ -41,6 +41,10 @@ test_orwrite_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test ORWRITE with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test ORWRITE with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = orwrite_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = orwrite_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -53,3 +57,4 @@ test_orwrite_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ test_read10_rdprotect(void)
|
|||||||
|
|
||||||
CHECK_FOR_SBC;
|
CHECK_FOR_SBC;
|
||||||
|
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = read10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = read10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -47,3 +51,4 @@ test_read10_rdprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ test_read12_rdprotect(void)
|
|||||||
|
|
||||||
CHECK_FOR_SBC;
|
CHECK_FOR_SBC;
|
||||||
|
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = read12_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = read12_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -51,3 +55,4 @@ test_read12_rdprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -38,15 +38,20 @@ test_read16_rdprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test READ16 with non-zero RDPROTECT");
|
logging(LOG_VERBOSE, "Test READ16 with non-zero RDPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = read16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = read16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
i, 0, 0, 0, 0, NULL);
|
i, 0, 0, 0, 0, NULL);
|
||||||
if (ret == -2) {
|
if (ret == -2) {
|
||||||
logging(LOG_NORMAL, "[SKIPPED] READ16 is not implemented on this target and it does not claim SBC-3 support.");
|
logging(LOG_NORMAL, "[SKIPPED] READ16 is not im lemented on this target and it does not claim SBC-3 support.");
|
||||||
CU_PASS("READ16 is not implemented and no SBC-3 support claimed.");
|
CU_PASS("READ16 is not implemented and no SBC-3 support claimed.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ test_verify10_vrprotect(void)
|
|||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test VERIFY10 with non-zero VRPROTECT");
|
logging(LOG_VERBOSE, "Test VERIFY10 with non-zero VRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = read10(iscsic, tgt_lun, 0, block_size,
|
ret = read10(iscsic, tgt_lun, 0, block_size,
|
||||||
block_size, 0, 0, 0, 0, 0, buf);
|
block_size, 0, 0, 0, 0, 0, buf);
|
||||||
@@ -51,3 +54,4 @@ test_verify10_vrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,7 +34,10 @@ test_verify12_vrprotect(void)
|
|||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test VERIFY12 with non-zero VRPROTECT");
|
logging(LOG_VERBOSE, "Test VERIFY12 with non-zero VRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
|
|
||||||
ret = read10(iscsic, tgt_lun, 0, block_size,
|
ret = read10(iscsic, tgt_lun, 0, block_size,
|
||||||
@@ -50,3 +53,4 @@ test_verify12_vrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,7 +35,10 @@ test_verify16_vrprotect(void)
|
|||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test VERIFY16 with non-zero VRPROTECT");
|
logging(LOG_VERBOSE, "Test VERIFY16 with non-zero VRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = read16(iscsic, tgt_lun, 0, block_size,
|
ret = read16(iscsic, tgt_lun, 0, block_size,
|
||||||
block_size, 0, 0, 0, 0, 0, buf);
|
block_size, 0, 0, 0, 0, 0, buf);
|
||||||
@@ -50,3 +53,4 @@ test_verify16_vrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ test_write10_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITE10 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITE10 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = write10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = write10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -52,3 +56,4 @@ test_write10_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ test_write12_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITE12 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITE12 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = write12_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = write12_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -52,3 +56,4 @@ test_write12_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,6 +41,10 @@ test_write16_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITE16 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITE16 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = write16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = write16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -53,3 +57,4 @@ test_write16_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ test_writesame10_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITESAME10 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITESAME10 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
buf = malloc(block_size);
|
buf = malloc(block_size);
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = writesame10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = writesame10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
@@ -54,3 +58,4 @@ test_writesame10_wrprotect(void)
|
|||||||
}
|
}
|
||||||
free(buf);
|
free(buf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -41,7 +41,10 @@ test_writesame16_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITESAME16 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITESAME16 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = writesame16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = writesame16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, 1,
|
block_size, 1,
|
||||||
@@ -54,3 +57,4 @@ test_writesame16_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ test_writeverify10_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITEVERIFY10 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITEVERIFY10 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = writeverify10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = writeverify10_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -52,3 +56,4 @@ test_writeverify10_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ test_writeverify12_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITEVERIFY12 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITEVERIFY12 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = writeverify12_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = writeverify12_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -52,3 +56,4 @@ test_writeverify12_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ test_writeverify16_wrprotect(void)
|
|||||||
*/
|
*/
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test WRITEVERIFY16 with non-zero WRPROTECT");
|
logging(LOG_VERBOSE, "Test WRITEVERIFY16 with non-zero WRPROTECT");
|
||||||
|
if (inq->protect) {
|
||||||
|
logging(LOG_VERBOSE, "No tests for devices that support protection information yet.");
|
||||||
|
} else {
|
||||||
|
logging(LOG_VERBOSE, "Device does not support protection information. All commands should fail.");
|
||||||
for (i = 1; i < 8; i++) {
|
for (i = 1; i < 8; i++) {
|
||||||
ret = writeverify16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
ret = writeverify16_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||||
block_size, block_size,
|
block_size, block_size,
|
||||||
@@ -55,3 +59,4 @@ test_writeverify16_wrprotect(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user