TESTS: Flag a whole bunch of tests as not supported on non-iSCSI backends

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2014-09-27 08:58:24 -07:00
parent abbf9a11b0
commit 45d87238e2
35 changed files with 384 additions and 24 deletions

View File

@@ -1653,7 +1653,7 @@ preventallow(struct scsi_device *sdev, int prevent)
}
int
read6(struct scsi_device *sdev, uint32_t lba,
read6(struct scsi_device *sdev, struct scsi_task **out_task, uint32_t lba,
uint32_t datalen, int blocksize,
unsigned char *data,
int status, enum scsi_sense_key key, int *ascq, int num_ascq)
@@ -1674,7 +1674,9 @@ read6(struct scsi_device *sdev, uint32_t lba,
if (data && task) {
memcpy(data, task->datain.data, task->datain.size);
}
if (task) {
if (out_task) {
*out_task = task;
} else if (task) {
scsi_free_scsi_task(task);
}
return ret;

View File

@@ -277,7 +277,7 @@ int orwrite(struct scsi_device *sdev, uint64_t lba, uint32_t datalen, int blocks
int prefetch10(struct scsi_device *sdev, uint32_t lba, int num_blocks, int immed, int group, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int prefetch16(struct scsi_device *sdev, uint64_t lba, int num_blocks, int immed, int group, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int preventallow(struct scsi_device *sdev, int prevent);
int read6(struct scsi_device *sdev, uint32_t lba, uint32_t datalen, int blocksize, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read6(struct scsi_device *sdev, struct scsi_task **task, uint32_t lba, uint32_t datalen, int blocksize, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read10(struct scsi_device *sdev, struct scsi_task **task, uint32_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read12(struct scsi_device *sdev, uint32_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);
int read16(struct scsi_device *sdev, uint64_t lba, uint32_t datalen, int blocksize, int rdprotect, int dpo, int fua, int fua_nv, int group, unsigned char *data, int status, enum scsi_sense_key key, int *ascq, int num_ascq);

View File

@@ -51,6 +51,14 @@ void test_iscsi_cmdsn_toohigh(void)
logging(LOG_VERBOSE, "Test sending invalid iSCSI CMDSN");
logging(LOG_VERBOSE, "CMDSN MUST be in the range EXPCMDSN and MAXCMDSN");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "RFC3720:3.2.2.1 CMDSN > MAXCMDSN must be silently ignored by the target");
logging(LOG_VERBOSE, "Send a TESTUNITREADY with CMDSN == MAXCMDSN+1. Should be ignored by the target.");

View File

@@ -51,6 +51,14 @@ void test_iscsi_cmdsn_toolow(void)
logging(LOG_VERBOSE, "Test sending invalid iSCSI CMDSN");
logging(LOG_VERBOSE, "CMDSN MUST be in the range EXPCMDSN and MAXCMDSN");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "RFC3720:3.2.2.1 CMDSN < EXPCMDSN must be silently ignored by the target");
logging(LOG_VERBOSE, "Send a TESTUNITREADY with CMDSN == EXPCMDSN-1. Should be ignored by the target.");

View File

@@ -65,6 +65,13 @@ void test_iscsi_datasn_invalid(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test sending invalid iSCSI DATASN");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Send 2 DATAIN with DATASN==0. Should fail.");
change_datasn = 1;

View File

@@ -36,6 +36,14 @@ test_preventallow_2_itnexuses(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that PREVENT MEDIUM REMOVAL are seen on other nexuses as well");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PREVENTALLOW test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Set the PREVENT flag");
ret = preventallow(sd, 1);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -35,6 +35,14 @@ test_preventallow_cold_reset(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that Target Warm Reset clears PREVENT MEDIUM REMOVAL");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PREVENTALLOW test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Set the PREVENT flag");
ret = preventallow(sd, 1);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -35,6 +35,14 @@ test_preventallow_itnexus_loss(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that IT-Nexus loss clears PREVENT MEDIUM REMOVAL");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PREVENTALLOW test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Set the PREVENT flag");
ret = preventallow(sd, 1);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -35,6 +35,14 @@ test_preventallow_logout(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that Logout loss clears PREVENT MEDIUM REMOVAL");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PREVENTALLOW test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Set the PREVENT flag");
ret = preventallow(sd, 1);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -35,6 +35,14 @@ test_preventallow_lun_reset(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that Target Warm Reset clears PREVENT MEDIUM REMOVAL");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PREVENTALLOW test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Set the PREVENT flag");
ret = preventallow(sd, 1);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -35,6 +35,14 @@ test_preventallow_warm_reset(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that Target Warm Reset clears PREVENT MEDIUM REMOVAL");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PREVENTALLOW test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Set the PREVENT flag");
ret = preventallow(sd, 1);
CU_ASSERT_EQUAL(ret, 0);

View File

@@ -124,7 +124,18 @@ test_prout_reserve_access_ea(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -140,7 +151,18 @@ test_prout_reserve_access_we(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -156,7 +178,18 @@ test_prout_reserve_access_earo(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -172,7 +205,18 @@ test_prout_reserve_access_wero(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -188,7 +232,18 @@ test_prout_reserve_access_eaar(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -204,7 +259,18 @@ test_prout_reserve_access_wear(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;

View File

@@ -98,7 +98,18 @@ test_prout_reserve_ownership_ea(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -113,7 +124,18 @@ test_prout_reserve_ownership_we(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -128,7 +150,18 @@ test_prout_reserve_ownership_earo(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -143,7 +176,18 @@ test_prout_reserve_ownership_wero(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -158,7 +202,18 @@ test_prout_reserve_ownership_eaar(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;
@@ -173,7 +228,18 @@ test_prout_reserve_ownership_wear(void)
{
struct scsi_device sd2;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This PERSISTENT RESERVE test is "
"only supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;
sd2.iscsi_lun = sd->iscsi_lun;
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd2.iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {
logging(LOG_VERBOSE, "Failed to login to target");
return;

View File

@@ -39,6 +39,14 @@ test_read10_invalid(void)
logging(LOG_VERBOSE, "Test invalid READ10 commands");
logging(LOG_VERBOSE, "Block size is %zu", block_size);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This READ10 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* Try a read10 of 1 block but xferlength == 0 */
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);

View File

@@ -40,6 +40,14 @@ test_read10_residuals(void)
logging(LOG_VERBOSE, "Test READ10 commands with residuals");
logging(LOG_VERBOSE, "Block size is %zu", block_size);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This READ10 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* Try a read10 of 1 block but xferlength == 0 */
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);

View File

@@ -36,6 +36,14 @@ test_read12_residuals(void)
logging(LOG_VERBOSE, "Test READ12 commands with residuals");
logging(LOG_VERBOSE, "Block size is %zu", block_size);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This READ12 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);

View File

@@ -36,6 +36,14 @@ test_read16_residuals(void)
logging(LOG_VERBOSE, "Test READ16 commands with residuals");
logging(LOG_VERBOSE, "Block size is %zu", block_size);
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This READ16 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);

View File

@@ -38,7 +38,7 @@ test_read6_beyond_eol(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test READ6 1-255 blocks one block beyond the end");
for (i = 1; i <= 255; i++) {
ret = read6(sd, num_blocks + 1 - i,
ret = read6(sd, NULL, num_blocks + 1 - i,
i * block_size, block_size, NULL,
EXPECT_LBA_OOB);
if (ret == -2) {
@@ -52,7 +52,7 @@ test_read6_beyond_eol(void)
logging(LOG_VERBOSE, "Test READ6 1-255 blocks at LBA==0x1fffff");
for (i = 1; i <= 255; i++) {
ret = read6(sd, 0x1fffff,
ret = read6(sd, NULL, 0x1fffff,
i * block_size, block_size, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);
@@ -61,7 +61,7 @@ test_read6_beyond_eol(void)
logging(LOG_VERBOSE, "Test READ6 2-255 blocks all but one block beyond the end");
for (i = 2; i <= 255; i++) {
ret = read6(sd, num_blocks - 1,
ret = read6(sd, NULL, num_blocks - 1,
i * block_size, block_size, NULL,
EXPECT_LBA_OOB);
CU_ASSERT_EQUAL(ret, 0);

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(sd, 0, i * block_size,
ret = read6(sd, NULL, 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(sd, num_blocks - i,
ret = read6(sd, NULL, num_blocks - i,
i * block_size, block_size, NULL,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
@@ -64,11 +64,12 @@ 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(sd->iscsi_ctx, sd->iscsi_lun, 0,
256 * block_size, block_size);
ret = read6(sd, &task, 0,
256 * block_size, block_size, NULL,
EXPECT_STATUS_GOOD);
if (task->status != SCSI_STATUS_GOOD) {
logging(LOG_NORMAL, "[FAILED] READ6 command: "
"failed with sense. %s", iscsi_get_error(sd->iscsi_ctx));
"failed with sense. %s", sd->error_str );
}
CU_ASSERT_EQUAL(task->status, SCSI_STATUS_GOOD);

View File

@@ -34,6 +34,13 @@ test_reserve6_2initiators(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test RESERVE6/RELEASE6 across two initiators");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This RESERVE6 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_NORMAL, "Take out a RESERVE6 from the first initiator");
ret = reserve6(sd);

View File

@@ -34,6 +34,13 @@ test_reserve6_itnexus_loss(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that RESERVE6 is released on it-nexus loss");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This RESERVE6 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_NORMAL, "Take out a RESERVE6 from the first initiator");
ret = reserve6(sd);

View File

@@ -34,6 +34,13 @@ test_reserve6_logout(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that RESERVE6 is released on logout");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This RESERVE6 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_NORMAL, "Take out a RESERVE6 from the first initiator");
ret = reserve6(sd);

View File

@@ -34,6 +34,13 @@ test_reserve6_lun_reset(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that RESERVE6 is released on lun reset");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This RESERVE6 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Take out a RESERVE6 from the first initiator");
ret = reserve6(sd);

View File

@@ -34,6 +34,13 @@ test_reserve6_target_cold_reset(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that RESERVE6 is released on target cold reset");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This RESERVE6 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Take out a RESERVE6 from the first initiator");
ret = reserve6(sd);

View File

@@ -34,6 +34,13 @@ test_reserve6_target_warm_reset(void)
logging(LOG_VERBOSE, LOG_BLANK_LINE);
logging(LOG_VERBOSE, "Test that RESERVE6 is released on target warm reset");
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This RESERVE6 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Take out a RESERVE6 from the first initiator");
ret = reserve6(sd);

View File

@@ -121,7 +121,7 @@ check_unmap(void)
if (task_ret->status != SCSI_STATUS_GOOD) {
logging(LOG_VERBOSE, "[FAILED] Failed to read LBA mapping "
"from the target. Sense: %s",
iscsi_get_error(sd->iscsi_ctx));
sd->error_str);
CU_FAIL("[FAILED] Failed to read LBA mapping "
"from the target.");
scsi_free_scsi_task(task_ret);

View File

@@ -40,6 +40,14 @@ test_sanitize_readonly(void)
CHECK_FOR_SANITIZE;
CHECK_FOR_DATALOSS;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This SANITIZE test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Create a second connection to the target");
memset(&sd2, 0, sizeof(sd2));
sd2.iscsi_url = sd->iscsi_url;

View File

@@ -40,6 +40,14 @@ test_sanitize_reservations(void)
CHECK_FOR_SANITIZE;
CHECK_FOR_DATALOSS;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This SANITIZE test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Create a second connection to the target");
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
if (sd2.iscsi_ctx == NULL) {

View File

@@ -46,6 +46,14 @@ test_sanitize_reset(void)
CHECK_FOR_SANITIZE;
CHECK_FOR_DATALOSS;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This SANITIZE test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Check that SANITIZE OVERWRITE will continue "
"even after Task/Lun/Target/* reset.");
cd = get_command_descriptor(SCSI_OPCODE_SANITIZE,

View File

@@ -43,6 +43,14 @@ test_write10_residuals(void)
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This WRITE10 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* Try a write10 of 1 block but xferlength == 0 */
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);

View File

@@ -43,6 +43,14 @@ test_write12_residuals(void)
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This WRITE12 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* Try a write12 of 1 block but xferlength == 0 */
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);

View File

@@ -43,6 +43,14 @@ test_write16_residuals(void)
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This WRITE16 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* Try a write16 of 1 block but xferlength == 0 */
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);

View File

@@ -43,6 +43,14 @@ test_writeverify10_residuals(void)
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This WRITEVERIFY10 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* check if writeverify10 is supported */
ret = writeverify10(sd, 0, 0,
block_size, 0, 0, 0, 0, NULL,

View File

@@ -43,6 +43,14 @@ test_writeverify12_residuals(void)
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This WRITEVERIFY12 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* check if writeverify12 is supported */
ret = writeverify12(sd, 0, 0,
block_size, 0, 0, 0, 0, NULL,

View File

@@ -43,6 +43,14 @@ test_writeverify16_residuals(void)
CHECK_FOR_DATALOSS;
CHECK_FOR_SBC;
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] This WRITEVERIFY16 test is only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* check if writeverify16 is supported */
ret = writeverify16(sd, 0, 0,
block_size, 0, 0, 0, 0, NULL,
@@ -53,6 +61,14 @@ test_writeverify16_residuals(void)
return;
}
if (sd->iscsi_ctx == NULL) {
const char *err = "[SKIPPED] WRITEVERIFY16 tests are only "
"supported for iSCSI backends";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
/* Try a writeverify16 of 1 block but xferlength == 0 */
task = malloc(sizeof(struct scsi_task));
CU_ASSERT_PTR_NOT_NULL(task);