Tests: Add helpers for ExtendedCopy and ReceiveCopyResults
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
@@ -195,6 +195,34 @@ do { \
|
|||||||
CU_ASSERT_EQUAL(_r, 0); \
|
CU_ASSERT_EQUAL(_r, 0); \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|
||||||
|
#define EXTENDEDCOPY(...) \
|
||||||
|
do { \
|
||||||
|
int _r; \
|
||||||
|
_r = extendedcopy(__VA_ARGS__); \
|
||||||
|
if (_r == -2) { \
|
||||||
|
logging(LOG_NORMAL, "[SKIPPED] EXTENDEDCOPY " \
|
||||||
|
"is not implemented."); \
|
||||||
|
CU_PASS("[SKIPPED] Target does not support " \
|
||||||
|
"EXTENDEDCOPY. Skipping test"); \
|
||||||
|
return; \
|
||||||
|
} \
|
||||||
|
CU_ASSERT_EQUAL(_r, 0); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
#define RECEIVE_COPY_RESULTS(...) \
|
||||||
|
do { \
|
||||||
|
int _r; \
|
||||||
|
_r = receive_copy_results(__VA_ARGS__); \
|
||||||
|
if (_r == -2) { \
|
||||||
|
logging(LOG_NORMAL, "[SKIPPED] RECEIVE_COPY" \
|
||||||
|
"_RESULTS is not implemented."); \
|
||||||
|
CU_PASS("[SKIPPED] Target does not support " \
|
||||||
|
"RECEIVE_COPY_RESULTS. Skipping test"); \
|
||||||
|
return; \
|
||||||
|
} \
|
||||||
|
CU_ASSERT_EQUAL(_r, 0); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
#define RELEASE6(...) \
|
#define RELEASE6(...) \
|
||||||
do { \
|
do { \
|
||||||
int _r; \
|
int _r; \
|
||||||
|
|||||||
@@ -52,11 +52,10 @@ int init_xcopy_descr(unsigned char *buf, int offset, int num_tgt_desc,
|
|||||||
void
|
void
|
||||||
test_extendedcopy_descr_limits(void)
|
test_extendedcopy_descr_limits(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct scsi_task *edl_task;
|
struct scsi_task *edl_task;
|
||||||
struct iscsi_data data;
|
struct iscsi_data data;
|
||||||
unsigned char *xcopybuf;
|
unsigned char *xcopybuf;
|
||||||
struct scsi_copy_results_op_params *opp;
|
struct scsi_copy_results_op_params *opp = NULL;
|
||||||
int tgt_desc_len = 0, seg_desc_len = 0;
|
int tgt_desc_len = 0, seg_desc_len = 0;
|
||||||
unsigned int alloc_len;
|
unsigned int alloc_len;
|
||||||
|
|
||||||
@@ -66,14 +65,8 @@ test_extendedcopy_descr_limits(void)
|
|||||||
CHECK_FOR_DATALOSS;
|
CHECK_FOR_DATALOSS;
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Issue RECEIVE COPY RESULTS (OPERATING PARAMS)");
|
logging(LOG_VERBOSE, "Issue RECEIVE COPY RESULTS (OPERATING PARAMS)");
|
||||||
ret = receive_copy_results(&edl_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0,
|
RECEIVE_COPY_RESULTS(&edl_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0,
|
||||||
(void **)&opp, EXPECT_STATUS_GOOD);
|
(void **)&opp, EXPECT_STATUS_GOOD);
|
||||||
if (ret < 0) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"RECEIVE_COPY_RESULTS. Skipping test");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
/* Allocate buffer to accommodate (MAX+1) target and
|
/* Allocate buffer to accommodate (MAX+1) target and
|
||||||
* segment descriptors */
|
* segment descriptors */
|
||||||
@@ -93,13 +86,7 @@ test_extendedcopy_descr_limits(void)
|
|||||||
&tgt_desc_len, &seg_desc_len);
|
&tgt_desc_len, &seg_desc_len);
|
||||||
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
ret = extendedcopy(sd, &data, EXPECT_TOO_MANY_DESCR);
|
EXTENDEDCOPY(sd, &data, EXPECT_TOO_MANY_DESCR);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"EXTENDED_COPY. Skipping test");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE,
|
logging(LOG_VERBOSE,
|
||||||
"Test sending more than supported segment descriptors");
|
"Test sending more than supported segment descriptors");
|
||||||
@@ -109,8 +96,7 @@ test_extendedcopy_descr_limits(void)
|
|||||||
&tgt_desc_len, &seg_desc_len);
|
&tgt_desc_len, &seg_desc_len);
|
||||||
populate_param_header(xcopybuf, 2, 0, 0, 0,
|
populate_param_header(xcopybuf, 2, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
ret = extendedcopy(sd, &data, EXPECT_TOO_MANY_DESCR);
|
EXTENDEDCOPY(sd, &data, EXPECT_TOO_MANY_DESCR);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE,
|
logging(LOG_VERBOSE,
|
||||||
"Test sending descriptors > Maximum Descriptor List Length");
|
"Test sending descriptors > Maximum Descriptor List Length");
|
||||||
@@ -122,10 +108,8 @@ test_extendedcopy_descr_limits(void)
|
|||||||
&tgt_desc_len, &seg_desc_len);
|
&tgt_desc_len, &seg_desc_len);
|
||||||
populate_param_header(xcopybuf, 3, 0, 0, 0,
|
populate_param_header(xcopybuf, 3, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
ret = extendedcopy(sd, &data, EXPECT_PARAM_LIST_LEN_ERR);
|
EXTENDEDCOPY(sd, &data, EXPECT_PARAM_LIST_LEN_ERR);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
|
||||||
scsi_free_scsi_task(edl_task);
|
scsi_free_scsi_task(edl_task);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ int init_xcopybuf(unsigned char *buf, int tgt_desc_type, int seg_desc_type,
|
|||||||
void
|
void
|
||||||
test_extendedcopy_descr_type(void)
|
test_extendedcopy_descr_type(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
int tgt_desc_len = 0, seg_desc_len = 0, alloc_len;
|
int tgt_desc_len = 0, seg_desc_len = 0, alloc_len;
|
||||||
struct iscsi_data data;
|
struct iscsi_data data;
|
||||||
unsigned char *xcopybuf;
|
unsigned char *xcopybuf;
|
||||||
@@ -74,13 +73,7 @@ test_extendedcopy_descr_type(void)
|
|||||||
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_UNSUPP_DESCR_CODE);
|
EXTENDEDCOPY(sd, &data, EXPECT_UNSUPP_DESCR_CODE);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"EXTENDED_COPY. Skipping test");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Send Stream-to-Stream Copy segment descriptor");
|
logging(LOG_VERBOSE, "Send Stream-to-Stream Copy segment descriptor");
|
||||||
memset(xcopybuf, 0, alloc_len);
|
memset(xcopybuf, 0, alloc_len);
|
||||||
@@ -90,6 +83,5 @@ test_extendedcopy_descr_type(void)
|
|||||||
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_UNSUPP_DESCR_CODE);
|
EXTENDEDCOPY(sd, &data, EXPECT_UNSUPP_DESCR_CODE);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
void
|
void
|
||||||
test_extendedcopy_param(void)
|
test_extendedcopy_param(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
||||||
struct iscsi_data data;
|
struct iscsi_data data;
|
||||||
unsigned char *xcopybuf;
|
unsigned char *xcopybuf;
|
||||||
@@ -62,24 +61,16 @@ test_extendedcopy_param(void)
|
|||||||
"Test parameter list length truncating target descriptor");
|
"Test parameter list length truncating target descriptor");
|
||||||
data.size = XCOPY_DESC_OFFSET +
|
data.size = XCOPY_DESC_OFFSET +
|
||||||
get_desc_len(IDENT_DESCR_TGT_DESCR) - 1;
|
get_desc_len(IDENT_DESCR_TGT_DESCR) - 1;
|
||||||
ret = extendedcopy(sd, &data, EXPECT_PARAM_LIST_LEN_ERR);
|
EXTENDEDCOPY(sd, &data, EXPECT_PARAM_LIST_LEN_ERR);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"EXTENDED_COPY. Skipping test");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE,
|
logging(LOG_VERBOSE,
|
||||||
"Test parameter list length truncating segment descriptor");
|
"Test parameter list length truncating segment descriptor");
|
||||||
data.size = XCOPY_DESC_OFFSET +
|
data.size = XCOPY_DESC_OFFSET +
|
||||||
get_desc_len(IDENT_DESCR_TGT_DESCR) +
|
get_desc_len(IDENT_DESCR_TGT_DESCR) +
|
||||||
get_desc_len(BLK_TO_BLK_SEG_DESCR) - 1;
|
get_desc_len(BLK_TO_BLK_SEG_DESCR) - 1;
|
||||||
ret = extendedcopy(sd, &data, EXPECT_PARAM_LIST_LEN_ERR);
|
EXTENDEDCOPY(sd, &data, EXPECT_PARAM_LIST_LEN_ERR);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Test parameter list length = 0");
|
logging(LOG_VERBOSE, "Test parameter list length = 0");
|
||||||
data.size = 0;
|
data.size = 0;
|
||||||
ret = extendedcopy(sd, &data, EXPECT_STATUS_GOOD);
|
EXTENDEDCOPY(sd, &data, EXPECT_STATUS_GOOD);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
void
|
void
|
||||||
test_extendedcopy_simple(void)
|
test_extendedcopy_simple(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
||||||
struct iscsi_data data;
|
struct iscsi_data data;
|
||||||
unsigned char *xcopybuf;
|
unsigned char *xcopybuf;
|
||||||
@@ -45,14 +44,8 @@ test_extendedcopy_simple(void)
|
|||||||
|
|
||||||
logging(LOG_VERBOSE, "Write 2048 blocks of 'A' at LBA:0");
|
logging(LOG_VERBOSE, "Write 2048 blocks of 'A' at LBA:0");
|
||||||
memset(buf1, 'A', 2048*block_size);
|
memset(buf1, 'A', 2048*block_size);
|
||||||
ret = write16(sd, 0, 2048*block_size, block_size, 0, 0, 0, 0, 0,
|
WRITE16(sd, 0, 2048*block_size, block_size, 0, 0, 0, 0, 0,
|
||||||
buf1, EXPECT_STATUS_GOOD);
|
buf1, EXPECT_STATUS_GOOD);
|
||||||
if (ret == -2) {
|
|
||||||
logging(LOG_NORMAL, "[SKIPPED] WRITE16 is not implemented.");
|
|
||||||
CU_PASS("WRITE16 is not implemented.");
|
|
||||||
goto finished;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
data.size = XCOPY_DESC_OFFSET +
|
data.size = XCOPY_DESC_OFFSET +
|
||||||
get_desc_len(IDENT_DESCR_TGT_DESCR) +
|
get_desc_len(IDENT_DESCR_TGT_DESCR) +
|
||||||
@@ -75,25 +68,17 @@ test_extendedcopy_simple(void)
|
|||||||
populate_param_header(xcopybuf, 1, 0, LIST_ID_USAGE_DISCARD, 0,
|
populate_param_header(xcopybuf, 1, 0, LIST_ID_USAGE_DISCARD, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_STATUS_GOOD);
|
EXTENDEDCOPY(sd, &data, EXPECT_STATUS_GOOD);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"EXTENDED_COPY. Skipping test");
|
|
||||||
goto finished;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Read 2048 blocks from end of the LUN");
|
logging(LOG_VERBOSE, "Read 2048 blocks from end of the LUN");
|
||||||
ret = read16(sd, NULL, num_blocks - 2048, 2048*block_size,
|
read16(sd, NULL, num_blocks - 2048, 2048*block_size,
|
||||||
block_size, 0, 0, 0, 0, 0, buf2,
|
block_size, 0, 0, 0, 0, 0, buf2,
|
||||||
EXPECT_STATUS_GOOD);
|
EXPECT_STATUS_GOOD);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
ret = memcmp(buf1, buf2, 2048);
|
if (memcmp(buf1, buf2, 2048)) {
|
||||||
if (ret != 0)
|
|
||||||
CU_FAIL("Blocks were not copied correctly");
|
CU_FAIL("Blocks were not copied correctly");
|
||||||
|
}
|
||||||
|
|
||||||
finished:
|
|
||||||
free(buf1);
|
free(buf1);
|
||||||
free(buf2);
|
free(buf2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
void
|
void
|
||||||
test_extendedcopy_validate_seg_descr(void)
|
test_extendedcopy_validate_seg_descr(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
||||||
struct iscsi_data data;
|
struct iscsi_data data;
|
||||||
unsigned char *xcopybuf;
|
unsigned char *xcopybuf;
|
||||||
@@ -58,13 +57,7 @@ test_extendedcopy_validate_seg_descr(void)
|
|||||||
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_COPY_ABORTED);
|
EXTENDEDCOPY(sd, &data, EXPECT_COPY_ABORTED);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"EXTENDED_COPY. Skipping test");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE,
|
logging(LOG_VERBOSE,
|
||||||
"Number of copy blocks beyond destination block device capacity");
|
"Number of copy blocks beyond destination block device capacity");
|
||||||
@@ -80,6 +73,5 @@ test_extendedcopy_validate_seg_descr(void)
|
|||||||
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_COPY_ABORTED);
|
EXTENDEDCOPY(sd, &data, EXPECT_COPY_ABORTED);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
void
|
void
|
||||||
test_extendedcopy_validate_tgt_descr(void)
|
test_extendedcopy_validate_tgt_descr(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
int tgt_desc_len = 0, seg_desc_len = 0, offset = XCOPY_DESC_OFFSET;
|
||||||
struct iscsi_data data;
|
struct iscsi_data data;
|
||||||
unsigned char *xcopybuf;
|
unsigned char *xcopybuf;
|
||||||
@@ -58,13 +57,7 @@ test_extendedcopy_validate_tgt_descr(void)
|
|||||||
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_INVALID_FIELD_IN_CDB);
|
EXTENDEDCOPY(sd, &data, EXPECT_INVALID_FIELD_IN_CDB);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"EXTENDED_COPY. Skipping test");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "Test NUL bit in target descriptor");
|
logging(LOG_VERBOSE, "Test NUL bit in target descriptor");
|
||||||
/* NUL bit */
|
/* NUL bit */
|
||||||
@@ -79,6 +72,5 @@ test_extendedcopy_validate_tgt_descr(void)
|
|||||||
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
populate_param_header(xcopybuf, 1, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_COPY_ABORTED);
|
EXTENDEDCOPY(sd, &data, EXPECT_COPY_ABORTED);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
void
|
void
|
||||||
test_receive_copy_results_copy_status(void)
|
test_receive_copy_results_copy_status(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
struct scsi_task *cs_task;
|
struct scsi_task *cs_task;
|
||||||
struct scsi_copy_results_copy_status *csp;
|
struct scsi_copy_results_copy_status *csp;
|
||||||
int tgt_desc_len = 0, seg_desc_len = 0;
|
int tgt_desc_len = 0, seg_desc_len = 0;
|
||||||
@@ -42,16 +41,10 @@ test_receive_copy_results_copy_status(void)
|
|||||||
logging(LOG_VERBOSE, "Test RECEIVE COPY RESULTS, COPY STATUS");
|
logging(LOG_VERBOSE, "Test RECEIVE COPY RESULTS, COPY STATUS");
|
||||||
|
|
||||||
logging(LOG_VERBOSE, "No copy in progress");
|
logging(LOG_VERBOSE, "No copy in progress");
|
||||||
ret = receive_copy_results(&cs_task, sd, SCSI_COPY_RESULTS_COPY_STATUS,
|
RECEIVE_COPY_RESULTS(&cs_task, sd, SCSI_COPY_RESULTS_COPY_STATUS,
|
||||||
list_id, NULL, EXPECT_INVALID_FIELD_IN_CDB);
|
list_id, NULL, EXPECT_INVALID_FIELD_IN_CDB);
|
||||||
scsi_free_scsi_task(cs_task);
|
scsi_free_scsi_task(cs_task);
|
||||||
cs_task = NULL;
|
cs_task = NULL;
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"RECEIVE_COPY_STATUS. Skipping test");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
CHECK_FOR_DATALOSS;
|
CHECK_FOR_DATALOSS;
|
||||||
|
|
||||||
@@ -77,20 +70,12 @@ test_receive_copy_results_copy_status(void)
|
|||||||
populate_param_header(xcopybuf, list_id, 0, 0, 0,
|
populate_param_header(xcopybuf, list_id, 0, 0, 0,
|
||||||
tgt_desc_len, seg_desc_len, 0);
|
tgt_desc_len, seg_desc_len, 0);
|
||||||
|
|
||||||
ret = extendedcopy(sd, &data, EXPECT_STATUS_GOOD);
|
EXTENDEDCOPY(sd, &data, EXPECT_STATUS_GOOD);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] Target does not support "
|
|
||||||
"EXTENDED_COPY. Skipping test");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_VERBOSE,
|
logging(LOG_VERBOSE,
|
||||||
"Copy Status for the above Extended Copy command");
|
"Copy Status for the above Extended Copy command");
|
||||||
ret = receive_copy_results(&cs_task, sd, SCSI_COPY_RESULTS_COPY_STATUS,
|
RECEIVE_COPY_RESULTS(&cs_task, sd, SCSI_COPY_RESULTS_COPY_STATUS,
|
||||||
list_id, (void **)&csp, EXPECT_STATUS_GOOD);
|
list_id, (void **)&csp, EXPECT_STATUS_GOOD);
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
out:
|
|
||||||
scsi_free_scsi_task(cs_task);
|
scsi_free_scsi_task(cs_task);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,26 +30,19 @@
|
|||||||
void
|
void
|
||||||
test_receive_copy_results_op_params(void)
|
test_receive_copy_results_op_params(void)
|
||||||
{
|
{
|
||||||
int ret;
|
struct scsi_task *op_task = NULL;
|
||||||
struct scsi_task *op_task;
|
|
||||||
struct scsi_copy_results_op_params *opp;
|
struct scsi_copy_results_op_params *opp;
|
||||||
|
|
||||||
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");
|
||||||
|
|
||||||
ret = receive_copy_results(&op_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0,
|
RECEIVE_COPY_RESULTS(&op_task, sd, SCSI_COPY_RESULTS_OP_PARAMS, 0,
|
||||||
(void **)&opp, EXPECT_STATUS_GOOD);
|
(void **)&opp, EXPECT_STATUS_GOOD);
|
||||||
if (ret == -2) {
|
|
||||||
CU_PASS("[SKIPPED] RECEIVE_COPY_RESULT is not implemented.");
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
CU_ASSERT_EQUAL(ret, 0);
|
|
||||||
|
|
||||||
logging(LOG_NORMAL,
|
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);
|
||||||
|
|
||||||
out:
|
|
||||||
scsi_free_scsi_task(op_task);
|
scsi_free_scsi_task(op_task);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user