TESTS: Update the READ10 tests for the new test tool

This commit is contained in:
Ronnie Sahlberg
2013-01-06 17:08:50 -08:00
parent 179d7b4f55
commit 4b3a53f7be
9 changed files with 227 additions and 200 deletions

View File

@@ -22,32 +22,28 @@
#include "iscsi.h"
#include "scsi-lowlevel.h"
#include "iscsi-support.h"
#include "iscsi-test-cu.h"
void
test_read10_simple(void)
{
int i;
int i, ret;
/* read the first 1 - 256 blocks at the start of the LUN */
logging(LOG_VERBOSE, "\nTest READ10 of 1-256 blocks at the start of the LUN");
for (i = 1; i <= 256; i++) {
task = iscsi_read10_sync(iscsic, tgt_lun, 0, i * block_size,
block_size, 0, 0, 0, 0, 0);
CU_ASSERT_PTR_NOT_NULL(task);
CU_ASSERT_EQUAL(task->status, SCSI_STATUS_GOOD);
scsi_free_scsi_task(task);
task = NULL;
ret = read10(iscsic, tgt_lun, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
}
/* read the last 1 - 256 blocks at the end of the LUN */
logging(LOG_VERBOSE, "Test READ10 of 1-256 blocks at the end of the LUN");
for (i = 1; i <= 256; i++) {
task = iscsi_read10_sync(iscsic, tgt_lun, num_blocks +1 - i,
i * block_size, block_size, 0, 0, 0, 0, 0);
CU_ASSERT_PTR_NOT_NULL(task);
CU_ASSERT_EQUAL(task->status, SCSI_STATUS_GOOD);
scsi_free_scsi_task(task);
task = NULL;
ret = read10(iscsic, tgt_lun, num_blocks +1 - i,
i * block_size, block_size, 0, 0, 0, 0, 0, NULL);
CU_ASSERT_EQUAL(ret, 0);
}
}