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
@@ -34,8 +34,8 @@ test_orwrite_0blocks(void)
|
||||
logging(LOG_VERBOSE, LOG_BLANK_LINE);
|
||||
logging(LOG_VERBOSE, "Test ORWRITE 0-blocks at LBA==0");
|
||||
ret = orwrite(iscsic, tgt_lun, 0,
|
||||
0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
0, block_size, 0, 0, 0, 0, 0, NULL,
|
||||
EXPECT_STATUS_GOOD);
|
||||
if (ret == -2) {
|
||||
logging(LOG_NORMAL, "[SKIPPED] ORWRITE is not implemented.");
|
||||
CU_PASS("ORWRITE is not implemented.");
|
||||
@@ -44,22 +44,22 @@ test_orwrite_0blocks(void)
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
logging(LOG_VERBOSE, "Test ORWRITE 0-blocks one block past end-of-LUN");
|
||||
ret = orwrite_lbaoutofrange(iscsic, tgt_lun, num_blocks + 1,
|
||||
0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
ret = orwrite(iscsic, tgt_lun, num_blocks + 1,
|
||||
0, block_size, 0, 0, 0, 0, 0, NULL,
|
||||
EXPECT_LBA_OOB);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "Test ORWRITE 0-blocks at LBA==2^63");
|
||||
ret = orwrite_lbaoutofrange(iscsic, tgt_lun, 0x8000000000000000ULL,
|
||||
0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
ret = orwrite(iscsic, tgt_lun, 0x8000000000000000ULL,
|
||||
0, block_size, 0, 0, 0, 0, 0, NULL,
|
||||
EXPECT_LBA_OOB);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
|
||||
|
||||
logging(LOG_VERBOSE, "Test ORWRITE 0-blocks at LBA==-1");
|
||||
ret = orwrite_lbaoutofrange(iscsic, tgt_lun, -1,
|
||||
0, block_size,
|
||||
0, 0, 0, 0, 0, NULL);
|
||||
ret = orwrite(iscsic, tgt_lun, -1,
|
||||
0, block_size, 0, 0, 0, 0, 0, NULL,
|
||||
EXPECT_LBA_OOB);
|
||||
CU_ASSERT_EQUAL(ret, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user