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:
Ronnie Sahlberg
2014-09-16 12:48:38 -07:00
committed by Ronnie Sahlberg
parent 905695575f
commit 138939cb0e
10 changed files with 77 additions and 303 deletions

View File

@@ -54,7 +54,8 @@ test_orwrite_verify(void)
logging(LOG_VERBOSE, "OrWrite %d blocks with 0xa5", i);
memset(buf, 0xa5, block_size * i);
ret = orwrite(iscsic, tgt_lun, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf);
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
if (ret == -2) {
logging(LOG_NORMAL, "[SKIPPED] ORWRITE is not implemented.");
CU_PASS("ORWRITE is not implemented.");
@@ -74,7 +75,8 @@ test_orwrite_verify(void)
logging(LOG_VERBOSE, "OrWrite %d blocks with 0x5a", i);
memset(buf, 0x5a, block_size * i);
ret = orwrite(iscsic, tgt_lun, 0, i * block_size,
block_size, 0, 0, 0, 0, 0, buf);
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks back", i);
@@ -103,7 +105,8 @@ test_orwrite_verify(void)
logging(LOG_VERBOSE, "OrWrite %d blocks with 0xa5", i);
memset(buf, 0xa5, block_size * i);
ret = orwrite(iscsic, tgt_lun, num_blocks - i, i * block_size,
block_size, 0, 0, 0, 0, 0, buf);
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks back", i);
@@ -118,7 +121,8 @@ test_orwrite_verify(void)
logging(LOG_VERBOSE, "OrWrite %d blocks with 0x5a", i);
memset(buf, 0x5a, block_size * i);
ret = orwrite(iscsic, tgt_lun, num_blocks - i, i * block_size,
block_size, 0, 0, 0, 0, 0, buf);
block_size, 0, 0, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Read %d blocks back", i);