TESTS: change the function signatures for the helpers
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ test_sanitize_readonly(void)
|
||||
int ret;
|
||||
struct iscsi_data data;
|
||||
struct scsi_command_descriptor *cd;
|
||||
struct scsi_device sd2;
|
||||
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test SANITIZE with READONLY devices");
|
||||
@@ -40,14 +41,14 @@ test_sanitize_readonly(void)
|
||||
CHECK_FOR_DATALOSS;
|
||||
|
||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||
iscsic2 = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd->iscsi_lun);
|
||||
if (iscsic2 == NULL) {
|
||||
sd2.iscsi_ctx = iscsi_context_login(initiatorname2, sd->iscsi_url, &sd2.iscsi_lun);
|
||||
if (sd2.iscsi_ctx == NULL) {
|
||||
logging(LOG_VERBOSE, "Failed to login to target");
|
||||
return;
|
||||
}
|
||||
|
||||
logging(LOG_VERBOSE, "Set Software Write Protect on the second connection");
|
||||
ret = set_swp(iscsic2, sd->iscsi_lun);
|
||||
ret = set_swp(&sd2);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
if (ret != 0) {
|
||||
return;
|
||||
@@ -55,7 +56,7 @@ test_sanitize_readonly(void)
|
||||
|
||||
logging(LOG_VERBOSE, "Use TESTUNITREADY to clear unit attention on "
|
||||
"first connection");
|
||||
while (testunitready_clear_ua(sd->iscsi_ctx, sd->iscsi_lun)) {
|
||||
while (testunitready_clear_ua(sd)) {
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
@@ -77,7 +78,7 @@ test_sanitize_readonly(void)
|
||||
data.data[1] = 0x00;
|
||||
data.data[2] = block_size >> 8;
|
||||
data.data[3] = block_size & 0xff;
|
||||
ret = sanitize_writeprotected(sd->iscsi_ctx, sd->iscsi_lun,
|
||||
ret = sanitize_writeprotected(sd,
|
||||
0, 0, SCSI_SANITIZE_OVERWRITE, data.size, &data);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
@@ -92,7 +93,7 @@ test_sanitize_readonly(void)
|
||||
"implemented according to REPORT_SUPPORTED_OPCODES.");
|
||||
} else {
|
||||
logging(LOG_VERBOSE, "Test SANITIZE BLOCK_ERASE");
|
||||
ret = sanitize_writeprotected(sd->iscsi_ctx, sd->iscsi_lun,
|
||||
ret = sanitize_writeprotected(sd,
|
||||
0, 0, SCSI_SANITIZE_BLOCK_ERASE, 0, NULL);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
@@ -106,21 +107,20 @@ test_sanitize_readonly(void)
|
||||
"implemented according to REPORT_SUPPORTED_OPCODES.");
|
||||
} else {
|
||||
logging(LOG_VERBOSE, "Test SANITIZE CRYPTO_ERASE");
|
||||
ret = sanitize_writeprotected(sd->iscsi_ctx, sd->iscsi_lun,
|
||||
ret = sanitize_writeprotected(sd,
|
||||
0, 0, SCSI_SANITIZE_CRYPTO_ERASE, 0, NULL);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "Clear Software Write Protect on the second connection");
|
||||
ret = clear_swp(iscsic2, sd->iscsi_lun);
|
||||
ret = clear_swp(&sd2);
|
||||
|
||||
logging(LOG_VERBOSE, "Use TESTUNITREADY to clear unit attention on "
|
||||
"first connection");
|
||||
while (testunitready_clear_ua(sd->iscsi_ctx, sd->iscsi_lun)) {
|
||||
while (testunitready_clear_ua(sd)) {
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
iscsi_destroy_context(iscsic2);
|
||||
iscsic2 = NULL;
|
||||
iscsi_destroy_context(sd2.iscsi_ctx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user