From d8ed7d40537f6e5a758db38214f46c9a70679fc0 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 21 Jul 2012 12:26:24 +1000 Subject: [PATCH] TESTS, After a target/lun reset, wait until the lun stabilizes before continuing the tests --- test-tool/0383_preventallow_target_warm_reset.c | 13 +++++++++++++ test-tool/0384_preventallow_target_cold_reset.c | 13 +++++++++++++ test-tool/0385_preventallow_lun_reset.c | 13 +++++++++++++ 3 files changed, 39 insertions(+) diff --git a/test-tool/0383_preventallow_target_warm_reset.c b/test-tool/0383_preventallow_target_warm_reset.c index b975c23..a4c9dce 100644 --- a/test-tool/0383_preventallow_target_warm_reset.c +++ b/test-tool/0383_preventallow_target_warm_reset.c @@ -204,6 +204,19 @@ test3: } printf("[OK]\n"); +again: + task = iscsi_testunitready_sync(iscsi, lun); + if (task == NULL) { + printf("[FAILED]\n"); + printf("Failed to send TESTUNITREADY command: %s\n", iscsi_get_error(iscsi)); + ret++; + goto finished; + } + if (task->status != SCSI_STATUS_GOOD) { + scsi_free_scsi_task(task); + goto again; + } + scsi_free_scsi_task(task); test4: diff --git a/test-tool/0384_preventallow_target_cold_reset.c b/test-tool/0384_preventallow_target_cold_reset.c index af61780..3160371 100644 --- a/test-tool/0384_preventallow_target_cold_reset.c +++ b/test-tool/0384_preventallow_target_cold_reset.c @@ -204,6 +204,19 @@ test3: } printf("[OK]\n"); +again: + task = iscsi_testunitready_sync(iscsi, lun); + if (task == NULL) { + printf("[FAILED]\n"); + printf("Failed to send TESTUNITREADY command: %s\n", iscsi_get_error(iscsi)); + ret++; + goto finished; + } + if (task->status != SCSI_STATUS_GOOD) { + scsi_free_scsi_task(task); + goto again; + } + scsi_free_scsi_task(task); test4: diff --git a/test-tool/0385_preventallow_lun_reset.c b/test-tool/0385_preventallow_lun_reset.c index 020b37d..db40b45 100644 --- a/test-tool/0385_preventallow_lun_reset.c +++ b/test-tool/0385_preventallow_lun_reset.c @@ -204,6 +204,19 @@ test3: } printf("[OK]\n"); +again: + task = iscsi_testunitready_sync(iscsi, lun); + if (task == NULL) { + printf("[FAILED]\n"); + printf("Failed to send TESTUNITREADY command: %s\n", iscsi_get_error(iscsi)); + ret++; + goto finished; + } + if (task->status != SCSI_STATUS_GOOD) { + scsi_free_scsi_task(task); + goto again; + } + scsi_free_scsi_task(task); test4: