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

@@ -40,8 +40,8 @@ test_orwrite_flags(void)
logging(LOG_VERBOSE, "Test ORWRITE with DPO==1");
ret = orwrite(iscsic, tgt_lun, 0,
block_size, block_size,
0, 1, 0, 0, 0, buf);
block_size, block_size, 0, 1, 0, 0, 0, buf,
EXPECT_STATUS_GOOD);
if (ret == -2) {
CU_PASS("[SKIPPED] Target does not support VERIFY16. Skipping test");
return;
@@ -51,28 +51,28 @@ test_orwrite_flags(void)
logging(LOG_VERBOSE, "Test ORWRITE with FUA==1 FUA_NV==0");
ret = orwrite(iscsic, tgt_lun, 0,
block_size, block_size,
0, 0, 1, 0, 0, buf);
block_size, block_size, 0, 0, 1, 0, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test ORWRITE with FUA==1 FUA_NV==1");
ret = orwrite(iscsic, tgt_lun, 0,
block_size, block_size,
0, 0, 1, 1, 0, buf);
block_size, block_size, 0, 0, 1, 1, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test ORWRITE with FUA==0 FUA_NV==1");
ret = orwrite(iscsic, tgt_lun, 0,
block_size, block_size,
0, 0, 0, 1, 0, buf);
block_size, block_size, 0, 0, 0, 1, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
logging(LOG_VERBOSE, "Test ORWRITE with DPO==1 FUA==1 FUA_NV==1");
ret = orwrite(iscsic, tgt_lun, 0,
block_size, block_size,
0, 1, 1, 1, 0, buf);
block_size, block_size, 0, 1, 1, 1, 0, buf,
EXPECT_STATUS_GOOD);
CU_ASSERT_EQUAL(ret, 0);
}