TESTS: Abort the cold/warm reset tests if the target support is missing.

Not all targets support cold/warm reset task management functions.
Abort these tests if the support is missing and the commands fail.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-10-02 15:35:46 -07:00
parent c27db02a30
commit f6570e6f12
2 changed files with 15 additions and 2 deletions

View File

@@ -57,7 +57,13 @@ test_preventallow_cold_reset(void)
logging(LOG_VERBOSE, "Perform cold reset on target");
ret = iscsi_task_mgmt_target_cold_reset_sync(sd->iscsi_ctx);
CU_ASSERT_EQUAL(ret, 0);
if (ret != 0) {
const char *err = "[SKIPPED] Task Management function"
"for ColdReset is not working/implemented\n";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Wait until all unit attentions clear");
while (testunitready(sd, EXPECT_STATUS_GOOD) != 0)

View File

@@ -57,7 +57,14 @@ test_preventallow_warm_reset(void)
logging(LOG_VERBOSE, "Perform warm reset on target");
ret = iscsi_task_mgmt_target_warm_reset_sync(sd->iscsi_ctx);
CU_ASSERT_EQUAL(ret, 0);
if (ret != 0) {
const char *err = "[SKIPPED] Task Management function"
"for WarmReset is not working/implemented\n";
logging(LOG_NORMAL, "%s", err);
CU_PASS(err);
return;
}
logging(LOG_VERBOSE, "Wait until all unit attentions clear");
while (testunitready(sd, EXPECT_STATUS_GOOD) != 0)
;