TESTS: move the default url, lun and iscsi context into a structure

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2014-09-18 16:42:45 -07:00
parent 40de7d95a9
commit 9b768f7de9
177 changed files with 939 additions and 934 deletions

View File

@@ -34,7 +34,7 @@ test_read6_simple(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test READ6 of 1-255 blocks at the start of the LUN");
for (i = 1; i <= 255; i++) {
ret = read6(iscsic, tgt_lun, 0, i * block_size,
ret = read6(sd->iscsi_ctx, sd->iscsi_lun, 0, i * block_size,
block_size, NULL,
EXPECT_STATUS_GOOD);
if (ret == -2) {
@@ -51,7 +51,7 @@ test_read6_simple(void)
CU_PASS("LUN is too big for read-at-eol tests with READ6. Skipping test.\n");
} else {
for (i = 1; i <= 255; i++) {
ret = read6(iscsic, tgt_lun, num_blocks - i,
ret = read6(sd->iscsi_ctx, sd->iscsi_lun, num_blocks - i,
i * block_size, block_size, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -64,11 +64,11 @@ test_read6_simple(void)
logging(LOG_VERBOSE, "Test sending a READ6 with transfer length == 0 "
"(meaning 256 blocks)");
/* 256 is converted to 0 when the CDB is marshalled by the helper */
task = iscsi_read6_sync(iscsic, tgt_lun, 0,
task = iscsi_read6_sync(sd->iscsi_ctx, sd->iscsi_lun, 0,
256 * block_size, block_size);
if (task->status != SCSI_STATUS_GOOD) {
logging(LOG_NORMAL, "[FAILED] READ6 command: "
"failed with sense. %s", iscsi_get_error(iscsic));
"failed with sense. %s", iscsi_get_error(sd->iscsi_ctx));
}
CU_ASSERT_EQUAL(task->status, SCSI_STATUS_GOOD);