@@ -418,7 +418,7 @@ do { \
|
|||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
#define RECEIVE_COPY_RESULTS(...) \
|
#define RECEIVE_COPY_RESULTS(...) \
|
||||||
do { \
|
({ \
|
||||||
int _r; \
|
int _r; \
|
||||||
_r = receive_copy_results(__VA_ARGS__); \
|
_r = receive_copy_results(__VA_ARGS__); \
|
||||||
if (_r == -2) { \
|
if (_r == -2) { \
|
||||||
@@ -429,7 +429,8 @@ do { \
|
|||||||
return; \
|
return; \
|
||||||
} \
|
} \
|
||||||
CU_ASSERT_EQUAL(_r, 0); \
|
CU_ASSERT_EQUAL(_r, 0); \
|
||||||
} while (0);
|
_r; \
|
||||||
|
})
|
||||||
|
|
||||||
#define RELEASE6(...) \
|
#define RELEASE6(...) \
|
||||||
do { \
|
do { \
|
||||||
|
|||||||
@@ -60,27 +60,29 @@ test_async_read(void)
|
|||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
struct tests_async_read_state state = { 0, 0, 0 };
|
struct tests_async_read_state state = { 0, 0, 0 };
|
||||||
int blocksize = 512;
|
const int blocksize = 512;
|
||||||
int blocks_per_io = 8;
|
const int blocks_per_io = 8;
|
||||||
int num_ios = 1000;
|
const int num_ios = 1000;
|
||||||
/* IOs in flight concurrently, so need a buffer large enough for all */
|
/* IOs in flight concurrently, so need a buffer large enough for all */
|
||||||
unsigned char buf[blocksize * blocks_per_io * num_ios];
|
unsigned char *buf = calloc(blocksize * blocks_per_io, num_ios);
|
||||||
|
|
||||||
|
CU_ASSERT_NOT_EQUAL(buf, NULL);
|
||||||
|
if (!buf)
|
||||||
|
goto out;
|
||||||
|
|
||||||
CHECK_FOR_DATALOSS;
|
CHECK_FOR_DATALOSS;
|
||||||
CHECK_FOR_SBC;
|
CHECK_FOR_SBC;
|
||||||
if (sd->iscsi_ctx == NULL) {
|
if (sd->iscsi_ctx == NULL) {
|
||||||
CU_PASS("[SKIPPED] Non-iSCSI");
|
CU_PASS("[SKIPPED] Non-iSCSI");
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (maximum_transfer_length
|
if (maximum_transfer_length
|
||||||
&& (maximum_transfer_length < (blocks_per_io * num_ios))) {
|
&& (maximum_transfer_length < (blocks_per_io * num_ios))) {
|
||||||
CU_PASS("[SKIPPED] device too small for async_read test");
|
CU_PASS("[SKIPPED] device too small for async_read test");
|
||||||
return;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(buf, 0, blocksize * blocks_per_io * num_ios);
|
|
||||||
|
|
||||||
for (i = 0; i < num_ios; i++) {
|
for (i = 0; i < num_ios; i++) {
|
||||||
uint32_t lba = i * blocks_per_io;
|
uint32_t lba = i * blocks_per_io;
|
||||||
struct scsi_task *atask;
|
struct scsi_task *atask;
|
||||||
@@ -116,4 +118,7 @@ test_async_read(void)
|
|||||||
ret = iscsi_service(sd->iscsi_ctx, pfd.revents);
|
ret = iscsi_service(sd->iscsi_ctx, pfd.revents);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
|
free(buf);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,14 +32,16 @@ test_receive_copy_results_op_params(void)
|
|||||||
{
|
{
|
||||||
struct scsi_task *op_task = NULL;
|
struct scsi_task *op_task = NULL;
|
||||||
struct scsi_copy_results_op_params *opp;
|
struct scsi_copy_results_op_params *opp;
|
||||||
|
int ret;
|
||||||
|
|
||||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||||
logging(LOG_VERBOSE, "Test RECEIVE COPY RESULTS, OPERATING PARAMS");
|
logging(LOG_VERBOSE, "Test RECEIVE COPY RESULTS, OPERATING PARAMS");
|
||||||
|
|
||||||
RECEIVE_COPY_RESULTS(&op_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0,
|
ret = RECEIVE_COPY_RESULTS(&op_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0,
|
||||||
(void **)&opp, EXPECT_STATUS_GOOD);
|
(void **)&opp, EXPECT_STATUS_GOOD);
|
||||||
|
|
||||||
logging(LOG_NORMAL,
|
if (ret == 0)
|
||||||
|
logging(LOG_NORMAL,
|
||||||
"max_target_desc=%d, max_seg_desc=%d",
|
"max_target_desc=%d, max_seg_desc=%d",
|
||||||
opp->max_target_desc_count,
|
opp->max_target_desc_count,
|
||||||
opp->max_segment_desc_count);
|
opp->max_segment_desc_count);
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ test_reserve6_itnexus_loss(void)
|
|||||||
logging(LOG_VERBOSE, "Disconnect from the target.");
|
logging(LOG_VERBOSE, "Disconnect from the target.");
|
||||||
iscsi_destroy_context(sd->iscsi_ctx);
|
iscsi_destroy_context(sd->iscsi_ctx);
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Sleep for three seconds incase the target is slow to reset");
|
logging(LOG_VERBOSE, "Sleep for three seconds in case the target is slow to reset");
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Reconnect to target");
|
logging(LOG_VERBOSE, "Reconnect to target");
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ test_reserve6_lun_reset(void)
|
|||||||
}
|
}
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Sleep for three seconds incase the target is slow to reset");
|
logging(LOG_VERBOSE, "Sleep for three seconds in case the target is slow to reset");
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ test_reserve6_target_cold_reset(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Sleep for three seconds incase the target is slow to reset");
|
logging(LOG_VERBOSE, "Sleep for three seconds in case the target is slow to reset");
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||||
|
|||||||
@@ -56,10 +56,9 @@ test_reserve6_target_warm_reset(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Sleep for three seconds incase the target is slow to reset");
|
logging(LOG_VERBOSE, "Sleep for three seconds in case the target is slow to reset");
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Create a second connection to the target");
|
logging(LOG_VERBOSE, "Create a second connection to the target");
|
||||||
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
ret = mpath_sd2_get_or_clone(sd, &sd2);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
CU_ASSERT_EQUAL(ret, 0);
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ test_sanitize_reset(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Sleep for three seconds incase the target is "
|
logging(LOG_VERBOSE, "Sleep for three seconds in case the target is "
|
||||||
"slow to start the SANITIZE");
|
"slow to start the SANITIZE");
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ test_sanitize_reset(void)
|
|||||||
logging(LOG_VERBOSE, "Disconnect from the target.");
|
logging(LOG_VERBOSE, "Disconnect from the target.");
|
||||||
iscsi_destroy_context(sd->iscsi_ctx);
|
iscsi_destroy_context(sd->iscsi_ctx);
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Sleep for one seconds incase the target is "
|
logging(LOG_VERBOSE, "Sleep for one seconds in case the target is "
|
||||||
"slow to reset");
|
"slow to reset");
|
||||||
sleep(1);
|
sleep(1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user