TESTS: convert compareandwrite to new api
Signed-off-by: Ronnie Sahlberg <sahlberg@localhost>
This commit is contained in:
committed by
Ronnie Sahlberg
parent
44d88e3bc6
commit
46eaa7dcc3
@@ -69,9 +69,10 @@ test_compareandwrite_simple(void)
|
||||
"BlockLimits.MaximumCompareAndWriteLength(%d). "
|
||||
"Command should fail with INVALID_FIELD_IN_CDB",
|
||||
i, maxbl);
|
||||
ret = compareandwrite_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||
buf, 2 * i * block_size, block_size,
|
||||
0, 0, 0, 0);
|
||||
ret = compareandwrite(iscsic, tgt_lun, 0,
|
||||
buf, 2 * i * block_size,
|
||||
block_size, 0, 0, 0, 0,
|
||||
EXPECT_INVALID_FIELD_IN_CDB);
|
||||
if (ret == -2) {
|
||||
CU_PASS("[SKIPPED] Target does not support "
|
||||
"COMPARE_AND_WRITE. Skipping test");
|
||||
@@ -87,8 +88,9 @@ test_compareandwrite_simple(void)
|
||||
logging(LOG_VERBOSE, "Overwrite %d blocks with 'B' "
|
||||
"at LBA:0 (if they all contain 'A')", i);
|
||||
ret = compareandwrite(iscsic, tgt_lun, 0,
|
||||
buf, 2 * i * block_size, block_size,
|
||||
0, 0, 0, 0);
|
||||
buf, 2 * i * block_size, block_size,
|
||||
0, 0, 0, 0,
|
||||
EXPECT_STATUS_GOOD);
|
||||
if (ret == -2) {
|
||||
CU_PASS("[SKIPPED] Target does not support "
|
||||
"COMPARE_AND_WRITE. Skipping test");
|
||||
@@ -134,9 +136,10 @@ test_compareandwrite_simple(void)
|
||||
"BlockLimits.MaximumCompareAndWriteLength(%d). "
|
||||
"Command should fail with INVALID_FIELD_IN_CDB",
|
||||
i, maxbl);
|
||||
ret = compareandwrite_invalidfieldincdb(iscsic, tgt_lun, 0,
|
||||
buf, 2 * i * block_size, block_size,
|
||||
0, 0, 0, 0);
|
||||
ret = compareandwrite(iscsic, tgt_lun, 0,
|
||||
buf, 2 * i * block_size,
|
||||
block_size, 0, 0, 0, 0,
|
||||
EXPECT_INVALID_FIELD_IN_CDB);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
continue;
|
||||
@@ -147,7 +150,9 @@ test_compareandwrite_simple(void)
|
||||
"at LBA:%" PRIu64 " (if they all contain 'A')",
|
||||
i, num_blocks - i);
|
||||
ret = compareandwrite(iscsic, tgt_lun, num_blocks - i,
|
||||
buf, 2 * i * block_size, block_size, 0, 0, 0, 0);
|
||||
buf, 2 * i * block_size, block_size,
|
||||
0, 0, 0, 0,
|
||||
EXPECT_STATUS_GOOD);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
logging(LOG_VERBOSE, "Read %d blocks at LBA:%" PRIu64
|
||||
|
||||
Reference in New Issue
Block a user