TESTS: add a flag --usb so we can clamp all i/o to at most 120k

Add checks for maximum tranfer length to all commands that are limited
by BlockLimits/MTL
This commit is contained in:
Ronnie Sahlberg
2013-04-27 09:59:59 -07:00
parent c866787dcb
commit 2627a8845e
69 changed files with 500 additions and 354 deletions

View File

@@ -16,6 +16,7 @@
*/
#include <stdio.h>
#include <alloca.h>
#include <CUnit/CUnit.h>
@@ -29,7 +30,9 @@ void
test_writesame16_simple(void)
{
int i, ret;
unsigned char *buf = alloca(block_size);
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
@@ -37,13 +40,11 @@ test_writesame16_simple(void)
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the start of the LUN");
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size);
ret = writesame16(iscsic, tgt_lun, 0,
block_size, i,
0, 0, 0, 0, buf);
free(buf);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] WRITEVERIFY16 is not implemented.");
CU_PASS("[SKIPPED] Target does not support WRITESAME16. Skipping test");
return;
}
@@ -52,12 +53,9 @@ test_writesame16_simple(void)
logging(LOG_VERBOSE, "Test WRITESAME16 of 1-256 blocks at the end of the LUN");
for (i = 1; i <= 256; i++) {
unsigned char *buf = malloc(block_size );
ret = writesame16(iscsic, tgt_lun, num_blocks - i,
block_size, i,
0, 0, 0, 0, buf);
free(buf);
CU_ASSERT_EQUAL(ret, 0);
}