Skip to content

Commit 9e160e0

Browse files
committed
test-tool: Use block_size instead of hardcoded 512 bytes
Fix another couple of tests that fail on 4Kn drives: * iSCSI.iSCSITMF.AbortTaskSimpleAsync * iSCSI.iSCSITMF.LUNResetSimpleAsync
1 parent 0e9b297 commit 9e160e0

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

test-tool/test_async_abort_simple.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ test_async_abort_simple(void)
9292
{
9393
int ret;
9494
struct tests_async_abort_state state = { NULL, 0, 0, 0, 0 };
95-
int blocksize = 512;
9695
int blocks_per_io = 8;
9796
unsigned char *buf;
9897
uint64_t timeout_sec;
@@ -107,18 +106,18 @@ test_async_abort_simple(void)
107106
return;
108107
}
109108

110-
buf = calloc(blocksize, blocks_per_io);
109+
buf = calloc(block_size, blocks_per_io);
111110
CU_ASSERT(buf != NULL);
112111
if (!buf)
113112
return;
114113

115114
/* queue and dispatch write before the abort */
116-
state.wtask = scsi_cdb_write10(0, blocks_per_io * blocksize,
117-
blocksize, 0, 0, 0, 0, 0);
115+
state.wtask = scsi_cdb_write10(0, blocks_per_io * block_size,
116+
block_size, 0, 0, 0, 0, 0);
118117
CU_ASSERT_PTR_NOT_NULL_FATAL(state.wtask);
119118

120119
ret = scsi_task_add_data_out_buffer(state.wtask,
121-
blocks_per_io * blocksize,
120+
blocks_per_io * block_size,
122121
buf);
123122
CU_ASSERT_EQUAL(ret, 0);
124123

test-tool/test_async_lu_reset_simple.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ test_async_lu_reset_simple(void)
9191
{
9292
int ret;
9393
struct tests_async_reset_state state = { NULL, 0, 0, 0, };
94-
int blocksize = 512;
9594
int blocks_per_io = 8;
9695
unsigned char *buf;
9796
uint64_t timeout_sec;
@@ -106,18 +105,18 @@ test_async_lu_reset_simple(void)
106105
return;
107106
}
108107

109-
buf = calloc(blocksize, blocks_per_io);
108+
buf = calloc(block_size, blocks_per_io);
110109
CU_ASSERT(buf != NULL);
111110
if (!buf)
112111
return;
113112

114113
/* queue and dispatch write before the reset */
115-
state.wtask = scsi_cdb_write10(0, blocks_per_io * blocksize,
116-
blocksize, 0, 0, 0, 0, 0);
114+
state.wtask = scsi_cdb_write10(0, blocks_per_io * block_size,
115+
block_size, 0, 0, 0, 0, 0);
117116
CU_ASSERT_PTR_NOT_NULL_FATAL(state.wtask);
118117

119118
ret = scsi_task_add_data_out_buffer(state.wtask,
120-
blocks_per_io * blocksize,
119+
blocks_per_io * block_size,
121120
buf);
122121
CU_ASSERT_EQUAL(ret, 0);
123122

0 commit comments

Comments
 (0)