test_read6_beyond_eol: Fix an assertion failure
Avoid that running the regression tests against a LUN with size zero triggers the following assertion failure: lt-iscsi-test-cu: iscsi-support.c:1666: read6: Assertion `task != ((void *)0)' failed. Aborted Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
393165d66a
commit
5231923bc8
@@ -37,7 +37,7 @@ test_read6_beyond_eol(void)
|
|||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test READ6 1-255 blocks one block beyond the end");
|
logging(LOG_VERBOSE, "Test READ6 1-255 blocks one block beyond the end");
|
||||||
for (i = 1; i <= 255; i++) {
|
for (i = 1; i <= 255 && i + 0U <= num_blocks + 1; i++) {
|
||||||
ret = read6(sd, NULL, num_blocks + 1 - i,
|
ret = read6(sd, NULL, num_blocks + 1 - i,
|
||||||
i * block_size, block_size, NULL,
|
i * block_size, block_size, NULL,
|
||||||
EXPECT_LBA_OOB);
|
EXPECT_LBA_OOB);
|
||||||
@@ -58,6 +58,10 @@ test_read6_beyond_eol(void)
|
|||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (num_blocks == 0) {
|
||||||
|
CU_PASS("LUN is too small for read-beyond-eol tests with READ6. Skipping test.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Test READ6 2-255 blocks all but one block beyond the end");
|
logging(LOG_VERBOSE, "Test READ6 2-255 blocks all but one block beyond the end");
|
||||||
for (i = 2; i <= 255; i++) {
|
for (i = 2; i <= 255; i++) {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ test_read6_simple(void)
|
|||||||
if (num_blocks > 0x200000) {
|
if (num_blocks > 0x200000) {
|
||||||
CU_PASS("LUN is too big for read-at-eol tests with READ6. Skipping test.\n");
|
CU_PASS("LUN is too big for read-at-eol tests with READ6. Skipping test.\n");
|
||||||
} else {
|
} else {
|
||||||
for (i = 1; i <= 255; i++) {
|
for (i = 1; i <= 255 && i + 0U <= num_blocks; i++) {
|
||||||
if (maximum_transfer_length && maximum_transfer_length < i) {
|
if (maximum_transfer_length && maximum_transfer_length < i) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user