TESTS: change ORWRITE to use a single helper function for all
Switch orwrite helpers to use _command_async instead of calling _orwrite_sync() to prepare for switching to non-iscsi targets. Use the new check_result API so that we only need a single helper function for ORWRITE instead of one helper for each expected result. Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
905695575f
commit
138939cb0e
@@ -40,10 +40,9 @@ test_orwrite_beyond_eol(void)
|
||||
if (maximum_transfer_length && maximum_transfer_length < i) {
|
||||
break;
|
||||
}
|
||||
ret = orwrite_lbaoutofrange(iscsic, tgt_lun,
|
||||
num_blocks + 1 - i,
|
||||
i * block_size, block_size,
|
||||
0, 0, 0, 0, 0, buf);
|
||||
ret = orwrite(iscsic, tgt_lun, num_blocks + 1 - i,
|
||||
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
|
||||
EXPECT_LBA_OOB);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] ORWRITE is not implemented.");
|
||||
CU_PASS("ORWRITE is not implemented.");
|
||||
@@ -58,10 +57,9 @@ test_orwrite_beyond_eol(void)
|
||||
if (maximum_transfer_length && maximum_transfer_length < i) {
|
||||
break;
|
||||
}
|
||||
ret = orwrite_lbaoutofrange(iscsic, tgt_lun,
|
||||
0x8000000000000000ULL,
|
||||
i * block_size, block_size,
|
||||
0, 0, 0, 0, 0, buf);
|
||||
ret = orwrite(iscsic, tgt_lun, 0x8000000000000000ULL,
|
||||
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
|
||||
EXPECT_LBA_OOB);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
|
||||
@@ -71,10 +69,9 @@ test_orwrite_beyond_eol(void)
|
||||
if (maximum_transfer_length && maximum_transfer_length < i) {
|
||||
break;
|
||||
}
|
||||
ret = orwrite_lbaoutofrange(iscsic, tgt_lun,
|
||||
-1,
|
||||
i * block_size, block_size,
|
||||
0, 0, 0, 0, 0, buf);
|
||||
ret = orwrite(iscsic, tgt_lun, -1,
|
||||
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
|
||||
EXPECT_LBA_OOB);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
|
||||
@@ -84,10 +81,9 @@ test_orwrite_beyond_eol(void)
|
||||
if (maximum_transfer_length && maximum_transfer_length < i) {
|
||||
break;
|
||||
}
|
||||
ret = orwrite_lbaoutofrange(iscsic, tgt_lun,
|
||||
num_blocks - 1,
|
||||
i * block_size, block_size,
|
||||
0, 0, 0, 0, 0, buf);
|
||||
ret = orwrite(iscsic, tgt_lun, num_blocks - 1,
|
||||
i * block_size, block_size, 0, 0, 0, 0, 0, buf,
|
||||
EXPECT_LBA_OOB);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user