TESTS: Fix COMPAREANDWRITE tests to send write data

Previously COMPAREANDWRITE was only sending verify instance data which
can cause targets to generate COMMAND ABORTED/NOT ENOUGH UNSOLICITED
DATA errors due to the buffer being obviously too small to contain
verify AND write instance data.

The buffer size check has been modified and compareandwrite tests
updated to pass a larger buffer with interesting write instance data.
This commit is contained in:
Sitsofe Wheeler
2013-09-09 16:42:15 +01:00
parent 45a3752d16
commit 0b6b12ba53
5 changed files with 28 additions and 12 deletions

View File

@@ -981,9 +981,9 @@ iscsi_compareandwrite_task(struct iscsi_context *iscsi, int lun, uint64_t lba,
struct scsi_task *task;
struct iscsi_data d;
if (datalen % blocksize != 0) {
if (datalen % (blocksize * 2) != 0) {
iscsi_set_error(iscsi, "Datalen:%d is not a multiple of the "
"blocksize:%d.", datalen, blocksize);
"blocksize * 2:%d.", datalen, blocksize * 2);
return NULL;
}