Add a test for mandatory opcodes for SBC devices.

Note that Read16/Readcapacity16 are mandatory on SBC3 but not prior.
Not all mandatory opcodes are tested for yet.
This commit is contained in:
Ronnie Sahlberg
2013-04-21 14:50:41 -07:00
parent 91a98d6b92
commit af6d1c9c13
9 changed files with 127 additions and 5 deletions

View File

@@ -36,5 +36,15 @@ test_readcapacity16_simple(void)
logging(LOG_VERBOSE, "Test that READCAPACITY16 works");
ret = readcapacity16(iscsic, tgt_lun, 16);
if (sbc3_support && ret == -2) {
logging(LOG_NORMAL, "[FAILED] READCAPACITY16 is not available but the device claims SBC-3 support.");
CU_FAIL("READCAPACITY16 failed but the device claims SBC-3 support.");
return;
}
if (!sbc3_support && ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] READCAPACITY16 is not implemented on this target and it does not claim SBC-3 support.");
CU_PASS("READCAPACITY16 is not implemented and no SBC-3 support claimed.");
return;
}
CU_ASSERT_EQUAL(ret, 0);
}